[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #VCT-362793]: NetCDF-Java Parsing Nested User-Defined Types



Hi Justin:

1) Here are some docs on how to work with nested vlens:

  
http://www.unidata.ucar.edu/software/thredds/v4.5/netcdf-java/reference/StructureData.html#vlen

2) theres a bug in the library that your example uncovered, which make your 
data look like:

Structure {
  int shutterPositionA;
  int shutterPositionD;
  int shutterPositionB;
  int shutterPositionC;
  int dspGainMode;
  int coneActiveStateA;
  int coneActiveStateD;
  int coneActiveStateB;
  int coneActiveStateC;
  int loopDataA(1, *, *);
  int loopDataB(1, *, *);
  long sampleVtcw;
} tim_records(time=29);


when it should be:

Structure {
  int shutterPositionA;
  int shutterPositionD;
  int shutterPositionB;
  int shutterPositionC;
  int dspGainMode;
  int coneActiveStateA;
  int coneActiveStateD;
  int coneActiveStateB;
  int coneActiveStateC;
  int loopDataA(1, *);
  int loopDataB(1, *);
  long sampleVtcw;
} tim_records(time=29);


This will be fixed in next release 4.5.2 probably in a few days. However I 
_think_ you can still access the data as above with previous versions.

John

> Hello,
> 
> I'm working with NetCDF-Java to read a NetCDF file. My NetCDF file contains a 
> compound type with several int records nested in it. The compound type also 
> contains two nested VLEN int types. I'm able to read values in the non-VLEN 
> int fields of the compound type, but I'm not able to read values in VLEN 
> types. I can only read their lengths. I have looked on the Github project to 
> try and find an example of reading VLEN types using Java but I was not able 
> to find anything. Do you have any resources available that demonstrate how to 
> read values out of a VLEN type that is nested inside of a compound type?
> 
> I've attached my IntTimSciSamp.nc file, the output of "ncdump 
> IntTimSciSamp.nc", and my IntTimSciSampRead.java code to this email. I 
> appreciate any help you could give me.
> 
> Thank you,
> Justin Spurgeon
> 

Ticket Details
===================
Ticket ID: VCT-362793
Department: Support netCDF Java
Priority: Normal
Status: Closed