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

[netCDF #NCE-670062]: How to produce NcML from a netCDF-4 file



The problem is that the _nc3_strict attribute
is a reserved attribute and its occurrence means that when
the file was created, it was verified by the netcdf-c library
to not actually conform to the netcdf classic data model.
If you forcibly add that attribute thru the HDF5 API, then
it should work if and only if the file actually conforms to classic.
If you accidentally include, say, non classic data types, then
the -x output may or may not succeed, but the result may
not be valid ncml. My speculation is that if the only violations of classic
are the use of primitive atomic datatypes (the unsigned byte, short,
int, int64), the the result will be ok. Use of string type, groups
enumerations, vlens, or compound will almost certainly be meaningless.


> What if the file was netcdf-4 (not netcdf-4 classic), but then HDF5 API was
> used to add the _nc3_strict attribute to make the file look like classic?
> If ncdump -x doesn't fail while processing this modified file, can its
> output be trusted?
> 
> Thank you,
> 
> Anatoli
> 
> address@hidden> wrote:
> 
> > Looking at the ncdump.c code, it appears that if the file is of
> > netcdf-4 format, then ncdump should fail with this message:
> > "NcML output (-x) currently only permitted for netCDF classic model"
> > It also appears that if the file is netcdf-4 classic format, then it should
> > work ok.
> >
> >
> > >
> > > As far as I understand, even if a netcdf-4 file is made to look like
> > > classic (either by adding the _nc3_strict attribute via HDF5 API or
> > running
> > > nccopy), ncdump -x is not guaranteed to work correctly.
> > >
> > > Is my understanding right?
> > >
> > > In our case ncdump -x appears to work correctly, but this is probably
> > > because the files we receive from the GOES-R system don't use much of the
> > > enhanced model.  Does this make sense?
> > >
> > > Just trying to make sure I understand.
> > >
> > > Thank you,
> > >
> > > Anatoli
> > >
> > > address@hidden> wrote:
> > >
> > > > Good Morning Dennis,
> > > >
> > > > Thank you for your prompt response.
> > > >
> > > > We do not produce the files, we just archive and disseminate them to
> > > > users.  Some users want NcML representation of the metadata in the
> > files
> > > > instead of getting the actual files.  My guess would be that they look
> > > > through small NcML files to decide which ones to order at a later time.
> > > > Running ncdump -x from netCDF 4.1.1 (old version we are moving away
> > from)
> > > > produces the same output as running ncdump -x from a more recent
> > version
> > > > (4.3.3) on a file produced from the original by running nccopy -k
> > "netCDF4
> > > > classic model" on it.   Unfortunately, ncdump v. 4.3.3 does not
> > support the
> > > > -x option on these files.
> > > >
> > > > Attached is a small GOES-R file of the kind we work with.
> > > >
> > > > Thank you,
> > > >
> > > > Anatoli
> > > >
> > > > address@hidden> wrote:
> > > >
> > > >> There is currently no way to do this for netcdf-4 files.
> > > >> It is doable but would take some time.
> > > >> Your comment about faking classic makes me think that you
> > > >> are not using a lot of  the netcdf-4 data model.
> > > >> Can you describe which netcdf-4 features you are using?
> > > >>
> > > >> > Hardware:
> > > >> > Description of problem: I work on a NOAA project, CLASS, and our
> > > >> software depends on being able to run ncdump -x to obtain NcML
> > metadata
> > > >> representation for a GOES-R file, which is reported as netCDF-4 by
> > ncdump
> > > >> -k.
> > > >> >
> > > >> > We are upgrading to a more recent version of netCDF and have found
> > that
> > > >> the -x option is only supported for the classic model.  I understand
> > we
> > > >> might be able to circumvent the problem by changing an attribute in
> > the
> > > >> file to make it appear classic, but we would like to avoid
> > manipulating or
> > > >> copying files.
> > > >> >
> > > >> > Is there a command line utility or an API call that would allow us
> > to
> > > >> generate NcML from a netCDF-4 file?
> > > >> >
> > > >> > Thank you,
> > > >> >
> > > >> > Anatoli
> > > >> >
> > > >> >
> > > >>
> > > >> =Dennis Heimbigner
> > > >>   Unidata
> > > >>
> > > >>
> > > >> Ticket Details
> > > >> ===================
> > > >> Ticket ID: NCE-670062
> > > >> Department: Support netCDF
> > > >> Priority: Normal
> > > >> Status: Open
> > > >> ===================
> > > >> NOTE: All email exchanges with Unidata User Support are recorded in
> > the
> > > >> Unidata inquiry tracking system and then made publicly available
> > through
> > > >> the web.  If you do not want to have your interactions made available
> > in
> > > >> this way, you must let us know in each email you send to us.
> > > >>
> > > >>
> > > >>
> > > >
> > >
> > >
> >
> > =Dennis Heimbigner
> >   Unidata
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: NCE-670062
> > Department: Support netCDF
> > Priority: Normal
> > Status: Open
> > ===================
> > NOTE: All email exchanges with Unidata User Support are recorded in the
> > Unidata inquiry tracking system and then made publicly available through
> > the web.  If you do not want to have your interactions made available in
> > this way, you must let us know in each email you send to us.
> >
> >
> 
> 

=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: NCE-670062
Department: Support netCDF
Priority: Normal
Status: Open
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.