This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
ok, i think i understand now. the intention is to put the values as content: <enumTypedef name="cloud_t" type="enum1"> <enum key="1">value1</enum> <enum key="2">value2</enum> <enum key="3">value3</enum> <enum key="4">value4</enum> <enum key="5">value5</enum> <enum key="6">value6</enum> <enum key="7">value7</enum> </enumTypedef> and i believe thats what the netcdf java library will do. looking at the schema, im guessing that <!-- XML encoding of enum typedef object --> <xsd:element name="enumTypedef"> <xsd:complexType> <xsd:sequence> <xsd:element name="enum" minOccurs="1" maxOccurs="unbounded"> <xsd:complexType mixed="true"> <xsd:attribute name="key" type="xsd:int" use="required"/> </xsd:complexType> </xsd:element> </xsd:sequence> <xsd:attribute name="name" type="xsd:token" use="required"/> <xsd:attribute name="type" type="DataType" default="enum1"/> </xsd:complexType> </xsd:element> should be <xsd:element name="enumTypedef"> <xsd:complexType mixed="true"> <xsd:sequence> <xsd:element name="enum" minOccurs="1" maxOccurs="unbounded"> <xsd:complexType mixed="true"> <xsd:attribute name="key" type="xsd:int" use="required"/> </xsd:complexType> </xsd:element> </xsd:sequence> <xsd:attribute name="name" type="xsd:token" use="required"/> <xsd:attribute name="type" type="DataType" default="enum1"/> </xsd:complexType> </xsd:element> ?? Does that seem right to you? In terms of converting CDL to NcML, yes you have to create a binary file as an intermediary, whether you use the C or Java library to generate the NcML. BTW, The Java library is the reference implementation for NcML, and the C library for CDL. The Java library does not currently read CDL. John > > Human V1.0 :) > > I'm helping to write specification documents for netCDF products. We > originally specified the format using CDL notation, but for various reasons, > we'd like to move to NcML, so I'm manually creating NcML descriptions using > XMLSpy and validating them against the latest NcML schema. > > These are large, complex specifications so I haven't yet written code to > generate an actual product and I didn't find any way of converting from CDL > to NcML without an actual intervening file for ncdump to use. > > I guess I could generate a small test dataset using CDL and ncgen, and then > use ncdump to output the contents, just to see how it handles the enhanced > netCDF features. Would that be useful input? > > Regards, > > Tim > > > > > > -----Original Message----- > From: Unidata netCDF Java Support [mailto:address@hidden] > Sent: Friday, October 17, 2014 4:20 PM > To: Timothy Patterson > Cc: address@hidden; Timothy Patterson > Subject: [netCDFJava #ZVT-747191]: Latest NcML schema with netCDF-4 support > > sorry, i meant to say what version of what software program generated the > ncml? > > > > > It's this one from the website: > > > > http://www.unidata.ucar.edu/schemas/netcdf/ncml-2.2.xsd > > > > which was updated fairly recently. > > > > We're potentially using a number of the enchanced features, so I'll test > > the ncml schema by converting most of the cdl examples at the link below > > into ncml equivalents: > > > > http://www.unidata.ucar.edu/software/netcdf/workshops/2011/groups-type > > s/index.html > > > > (I'm using the examples as there aren't many actual implementations yet). > > > > Thanks, > > > > Tim > > ________________________________________ > > From: Unidata netCDF Java Support > > [address@hidden] > > Sent: 17 October 2014 02:19 > > To: Timothy Patterson > > Cc: address@hidden; Timothy Patterson > > Subject: [netCDFJava #ZVT-747191]: Latest NcML schema with netCDF-4 > > support > > > > Hi Tim: > > > > Looks like a bug. What version generated that? > > > > John > > > > > > > > > > > Hi John, > > > > > > > > > > > > I'm not a schema expert, so I thought I'd check something with you before > > > raising a ticket in case I have misunderstood something. > > > > > > > > > > > > netCDF4 has an enumerated datatype that looks like this in cdl: > > > > > > > > > > > > > > > > > > netcdf clouds { > > > > > > types: > > > > > > byte enum cloud_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, > > > > > > Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, > > > > > > Altocumulus = 7, Missing = 127} ; > > > > > > dimensions: > > > > > > time = UNLIMITED ; // (5 currently) > > > > > > variables: > > > > > > cloud_t primary_cloud(time) ; > > > > > > cloud_t primary_cloud:_FillValue = Missing ; > > > > > > data: > > > > > > > > > > > > primary_cloud = Clear, Stratus, Cumulus, _, Cumulonimbus ; > > > > > > } > > > > > > > > > > > > > > > > > > But the ncml schema doesn’t seem to match as I can only define the > > > integer key values and not the associated strings. > > > > > > This appears to be the closest I can get: > > > > > > > > > <enumTypedef name="cloud_t" type="enum1"> <enum key="1"></enum> > > > <enum key="2"></enum> <enum key="3"></enum> <enum key="4"></enum> > > > <enum key="5"></enum> <enum key="6"></enum> <enum key="7"></enum> > > > > > > </enumTypedef> > > > > > > > > > > > > > > > > > > Am I overlooking something, or is something additional needed in the ncml > > > schema? > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Tim Patterson > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > From: Unidata netCDF Java Support > > > [mailto:address@hidden] > > > Sent: Friday, September 12, 2014 12:32 AM > > > To: Timothy Patterson > > > Cc: address@hidden > > > Subject: [netCDFJava #ZVT-747191]: Latest NcML schema with netCDF-4 > > > support > > > > > > > > > > > > Hi Timothy: > > > > > > > > > > > > http://www.unidata.ucar.edu/schemas/netcdf/ncml-2.2.xsd is in fact the > > > current schema (actually it was one rev out of date but i just updated > > > it). I think we are stuck with the name (even though we are long past > > > 2.2) due to backwards compatability. Perhaps we need a version attribute > > > in it? > > > > > > > > > > > > The best documentation is: > > > > > > > > > > > > http://www.unidata.ucar.edu/software/thredds/v4.5/netcdf-java/ncml/A > > > nnotatedSchema4.html > > > > > > > > > > > > I hope that is sufficient for your needs. > > > > > > > > > > > > John > > > > > > > > > > > > > > > > > > > > Dear Dennis, > > > > > > > > > > > > > > Thanks for the quick response. > > > > > > > > > > > > > > I'm happy to hear the schema has been updated, but I haven't been able > > > > to locate the updated version online or as part of any of the > > > > tools/libraries. Only the previous release at > > > > http://www.unidata.ucar.edu/schemas/netcdf/ncml-2.2.xsd seems to be > > > > available. > > > > > > > > > > > > > > I understand it can take a while for the documentation to be > > > > updated, but if it is possible to get a copy of the updated schema > > > > file, that would be a great help. Our datasets are making use of a > > > > number of the enhanced model features and our ncml descriptions > > > > are currently "hacked" with our best-guess to cope with the > > > > missing elements and we'd like to be in line with the official > > > > schema as soon a possible to avoid problems later > > > > > > > > > > > > > > Best regards, > > > > > > > > > > > > > > Tim Patterson > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > > From: Unidata netCDF Java Support > > > > [mailto:address@hidden] > > > > > > > Sent: Wednesday, September 10, 2014 7:54 PM > > > > > > > To: Timothy Patterson > > > > > > > Cc: > > > > address@hidden<mailto:support-netcdf-java@un > > > > idata.ucar.edu> > > > > > > > Subject: [netCDFJava #ZVT-747191]: Latest NcML schema with > > > > netCDF-4 support > > > > > > > > > > > > > > A Jira bug-tracking issue was created for this. > > > > > > > See https://bugtracking.unidata.ucar.edu/browse/TDS-498 > > > > > > > It appears to be fixed and tested. It is possible the documentation has > > > > not caught up with this fix. > > > > > > > =Dennis Heimbigner > > > > > > > Unidata > > > > > > > > > > > > > > > > > > > > > Ticket Details > > > > > > > =================== > > > > > > > Ticket ID: ZVT-747191 > > > > > > > Department: Support netCDF Java > > > > > > > Priority: Normal > > > > > > > Status: Closed > > > > > > > > > > > > > > > > > > > > > > > > > > Ticket Details > > > > > > =================== > > > > > > Ticket ID: ZVT-747191 > > > > > > Department: Support netCDF Java > > > > > > Priority: Normal > > > > > > Status: Closed > > > > > > > > > > > > > > > Ticket Details > > =================== > > Ticket ID: ZVT-747191 > > Department: Support netCDF Java > > Priority: Normal > > Status: Open > > > > > > > Ticket Details > =================== > Ticket ID: ZVT-747191 > Department: Support netCDF Java > Priority: Normal > Status: Open > > Ticket Details =================== Ticket ID: ZVT-747191 Department: Support netCDF Java Priority: Normal Status: Open