comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: netcdf and hdf together
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: netcdf and hdf together [message #49656] Tue, 08 August 2006 19:29 Go to next message
badjelly.witch is currently offline  badjelly.witch
Messages: 27
Registered: May 2006
Junior Member
Paul van Delst wrote:
>
> $ hdfdump file.hdf | ncgen -b ofile.nc -
>
> Then in IDL, just read and write netCDF and forget about HDF. :o)

Perhaps you should explain that hdfdump is a version of ncdump, but
linked against the HDF libraries instead of the netCDF libraries:

http://www.ferret.noaa.gov/Ferret/Mail_Archives/fu_2002/msg0 0501.html

Does this always work? Aren't there features supported by HDF but not
netCDF?
Re: netcdf and hdf together [message #49681 is a reply to message #49656] Tue, 08 August 2006 07:04 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
queiny98@yahoo.com wrote:
> I am trying to read in data from a HDF file and put the results input a
> NetCDF file. The NetCDF file has one dimension and it is unlimited.
> While I only have ~5000 data points, the output NetCDF has 7474 records
> as shown by 'ncdump -h'. And the data in the NetCDF file look
> reasonable, I just don't know where the extra data are from. I printed
> out the # of record when writing, it is correct.
>
> I have tried debug the program for a while. Can anyone point me to the
> right track? Or can anyone answer me the following wild questions.
>
> Can we use both HDF and NetCDF in the same file?

This is how I deal with it:

$ hdfdump file.hdf | ncgen -b ofile.nc -

Then in IDL, just read and write netCDF and forget about HDF. :o)

paulv

--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Ph: (301)763-8000 x7748
Fax:(301)763-8545
Re: netcdf and hdf together [message #49722 is a reply to message #49656] Thu, 10 August 2006 11:53 Go to previous message
liamgumley is currently offline  liamgumley
Messages: 74
Registered: June 2005
Member
Mark Hadfield wrote:
> Paul van Delst wrote:
>>
>> $ hdfdump file.hdf | ncgen -b ofile.nc -
>>
>> Then in IDL, just read and write netCDF and forget about HDF. :o)
>
> Perhaps you should explain that hdfdump is a version of ncdump, but
> linked against the HDF libraries instead of the netCDF libraries:
>
> http://www.ferret.noaa.gov/Ferret/Mail_Archives/fu_2002/msg0 0501.html
>
> Does this always work? Aren't there features supported by HDF but not
> netCDF?

If the dimension, variable, and attribute names in the HDF file conform
to netCDF specifications (e.g., no special characters such as *), then
it should work.

Large HDF files may cause problems because the dump step creates an
ASCII representation of the data in the file.

Finally, it's not all that difficult to work with HDF4 files in IDL,
particularly the 'Scientific Data Set' variant. However with HDF5, all
bets are off.

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Interpolation from irregular to regular grid
Next Topic: Re: Need Some Advice on Seperating Out Some Data

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:10:55 PDT 2025

Total time taken to generate the page: 0.00501 seconds