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

Home » Public Forums » archive » Coyote NCDF_FILE object to read HDF
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
Coyote NCDF_FILE object to read HDF [message #88608] Fri, 16 May 2014 17:17 Go to next message
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
David,

I was very excited to see (years ago now) that you updated your NCDF_FILE object to read HDF4 as well. The NCDF_BROWSER implements a "Read Entire File" method which is analogous to (though it may predate) the H5_PARSE routine. This works like a charm.

However, when I tried to call it without using the GUI, I find that

IDL> sObj=Obj_New('NCDF_FILE',hdf_file)

fails:
Traceback Report from NCDF_FILE::INIT:

% NCDF_OPEN: Unable to open the file "/aerosol_cal/users/hyer/data/scratch/Matc
h_Aerosol_MODIS.VIIRS.COLLOC.20130729.201520130729.2015.BLK1 0.8x
8.AEROSOL.hdf". (NC_ERROR=-128)
% Execution halted at: NCDF_FILE::INIT 3229 /shared/aerosol_dev2/users/hyer/calsrc/idlpro/idl_res/coyote /ncdf_file__define.pro
% $MAIN$
% Compiled module: CGROOTNAME.


Is there a trick to making something like this happen for HDF files:

sObj = Obj_New('NCDF_FILE',hdf_file)
allData = ncdfObject -> ReadFile(filename)

--Edward H.
Re: Coyote NCDF_FILE object to read HDF [message #88612 is a reply to message #88608] Sat, 17 May 2014 05:27 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Edward Hyer writes:

> I was very excited to see (years ago now) that you updated your
NCDF_FILE object to read HDF4 as well. The NCDF_BROWSER implements a
"Read Entire File" method which is analogous to (though it may predate)
the H5_PARSE routine. This works like a charm.
>
> However, when I tried to call it without using the GUI, I find that
>
> IDL> sObj=Obj_New('NCDF_FILE',hdf_file)
>
> fails:
> Traceback Report from NCDF_FILE::INIT:
>
> % NCDF_OPEN: Unable to open the file "/aerosol_cal/users/hyer/data/scratch/Matc
> h_Aerosol_MODIS.VIIRS.COLLOC.20130729.201520130729.2015.BLK1 0.8x
> 8.AEROSOL.hdf". (NC_ERROR=-128)
> % Execution halted at: NCDF_FILE::INIT 3229 /shared/aerosol_dev2/users/hyer/calsrc/idlpro/idl_res/coyote /ncdf_file__define.pro
> % $MAIN$
> % Compiled module: CGROOTNAME.
>
>
> Is there a trick to making something like this happen for HDF files:
>
> sObj = Obj_New('NCDF_FILE',hdf_file)
> allData = ncdfObject -> ReadFile(filename)

The ability to read HDF files is built into the NCDF_DATA object (a
precursor to the NCDF_FILE object). You want this:

sObj = Obj_New('NCDF_DATA',hdf_file)

The methods are similar, but less powerful. I wrote NCDF_FILE
specificially because I was working with netCDF files at the time and
needed a more robust object for them specificially.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Debugging overload
Next Topic: When is double not double? (converting from string to double)

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

Current Time: Wed Oct 08 13:34:21 PDT 2025

Total time taken to generate the page: 0.00424 seconds