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

[netCDF #BBA-614330]: Need Help



> Thank You sir, for such information.
> Will you please tell me how do i convert a simple HDF5 file
> to NetCDF. I need your help.

Whether it can be done or not depends on what you mean by "simple HDF5
file".  If it conforms to the enhanced netCDF-4 data model, then
cornering can be quite simple, using the new "nccopy" utility
available with the latest netCDF- software release:

  nccopy input.h5 output.nc

to convert the HDF5 file "input.h5" to the netCDF-4 file "output.nc".
If the input conforms to the even simpler netCDF classic data model,
you can even convert to a netCDF-3 file, which more software
understands, using 

  nccopy -k 1 input.h5 output.nc

where now the output file will be a netCDF-3 classic format file.

To determine whether this will work for HDF5 input data, see the FAQ

  "How can I convert HDF5 files into netCDF-4 files?"
  http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#fv15

Other approaches are also possible:

  - Put the HDF5 file on an OPeNDAP server, such as Hyrax or TDS.
    Then copy it to a netCDF file using the nccopy utility, giving the
    OPeNDAP URL as the first argument and a netCDF file name as the
    second argument.  This may work for more kinds of HDF5 files that
    the simpler solution above, because the server-side software may
    be able to read more complex HDF5 data than the C-based netCDF
    library on which nccopy depends.

  - Use this NASA-developed converter, that works for HDF5-EOS files:
    "HDF-EOS4/5 files to netCDF Converter"
    
http://idn.ceos.org/KeywordSearch/Metadata.do?Portal=GCMD&KeywordPath=[Keyword%3D%27HDF%27]&EntryId=hdfeos_netcdf&MetadataView=Full&MetadataType=1&lbnode=mdlb3

  - Write a program that uses the HDF5 library to read the HDF5 file and
    uses the netCDF library to write the equivalent netCDF file.

  - Use the h5dump utility to dump the HDF5 data out as text.  Use
    a text editor or other text tools to reformat the h5dump output
    into CDL (used to represent netCDF data as text) or NcML (used to
    represent netCDF data in XML form).  Then use ncgen or the
    Java-based ToolsUI tool to convert the CDL or NcML text into a
    binary netCDF file,

--Russ

> address@hidden> wrote:
> 
> > Hi Tapash,
> >
> > > Sir I am student of MCA, doing my project in NAL, India.
> > >
> > > My project is to convert HDF to NetCDF but I have no idea on NetCDF.
> > > Can you please help me.
> >
> > Rather than trying to read all the documentation, I recommend looking at
> > last years'
> > netCDF Workshop:
> >
> >  http://www.unidata.ucar.edu/software/netcdf/workshops/2009/
> >
> > and looking through the list of Frequently Asked Questions:
> >
> >  http://www.unidata.ucar.edu/software/netcdf/docs/faq.html
> >
> > Note that the latest version of the C-based netCDF-4 (4.1.1) can read some
> > HDF4 and
> > HDF5 data through the netCDF interface.  Also, netCDF-4 uses HDF5 as its
> > storage layer.
> >
> > However, a project to convert any HDF5 data to netCDF seems ambitious anf
> > difficult,
> > because HDF5 has a different, more complex data model than the netCDF
> > enhanced data
> > model of netCDF-4.  For example, it would be difficult for netCDF to
> > represent these
> > HDF5 features:
> >
> >  - non-hierarchical Groups, for example A a parent of B and B a parent of A
> >  - user-defined primitive types, for example floating point values with 5
> > bits
> >    of exponent and 13 bits of mantissa
> >  - Reference data types, which store pointers to other data objects within
> > a
> >    dataset
> >
> > NetCDF supports most of the features of HDF5, but it is intended to be
> > simpler to
> > use and understand, at the cost of not supporting some of the most complex
> > (and
> > powerful) features of HDF5.
> >
> > --Russ
> >
> > ambitious
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: BBA-614330
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> >
> 
> 

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: BBA-614330
Department: Support netCDF
Priority: Normal
Status: Closed