Project

General

Profile

HDF4 open/import

Added by Lee Miller almost 11 years ago

Hi,

I would like to use CDO to open several different NASA datasets which are in HDF4 format (not HDF EOS-2 or HDF5). Is this possible? Various searches on this forum for HDF4 related issues suggests I'm the only one with this problem.

As a crutch, I've tried using NCL (via ncl_convert2nc) and this works fine for small files like the one attached, but corrupts anything larger than about ~100 MB.

I really want to utilize how easily CDO handles spatial and temporal analysis --- I'd greatly appreciate your help.

Thanks,
Lee


Replies (3)

RE: HDF4 open/import - Added by Jaison-Thomas Ambadan almost 11 years ago

probably you've already solved your problem by now! I don't think cdo can handle HDF4 files (unfortunately). There are some tools available from the HDF group website, for converting to NetCDF-3/4 and HDF5 - have you tried those. May be Uwe can help you with more info.

Cheers,
J

RE: HDF4 open/import - Added by Uwe Schulzweida almost 11 years ago

CDO can't process HDF4 file!

RE: HDF4 open/import - Added by Jaison-Thomas Ambadan over 10 years ago

Hi Lee,

I thought I'll update you with some tricks for converting your HDF4 file to NetCDF.

[Assuming that you've the latest NetCDF library and the HDF4 library (hdf-4.2.9) installed with NetCDF support.]

use the "ncdump" from the HDF4 build library (ie, $HDF4/bin/ncdump in hdf-4.2.9) to dump your input file (DO NOT confuse with the "ncdump" from NetCDF library! I repeat, "ncdump" from $HDF4/bin/), and then use "ncgen" FROM NetCDF library (NOT from HDF4). Here are the steps:

STEP 1: $HDF4/bin/ncdump -u LISOTD_HRFC_V2.3.2012.hdf > test.cdl
STEP 2: $NETCDF/bin/ncgen -o test.nc test.cdl

That's it! DONE! check it with "cdo sinfov test.nc"

I've tested it with your input file. It looks fine to me. You could write a shell script to convert all your input files. Hope this helps.

Cheers,
Jaison

    (1-3/3)