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

Home » Public Forums » archive » NCDF_IS_NCDF
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: NCDF_IS_NCDF [message #92608 is a reply to message #92605] Thu, 21 January 2016 19:26 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 1/21/16 1:21 PM, KH wrote:
> Hello,
>
> Is there a netcdf equivalent to HDF_ISHDF? I am basically looking
> for a way to test if a file is a netcdf file before trying to open
> the file (and the having the program crash because it isn't actually
> a netcdf file).

Yes, I would normally recommend just trying to open the file and
catching the error if it fails, but, as you noted, it actually crashes IDL:

IDL> id = ncdf_open(filename)
Assertion failed: (0), function NC4_open, file nc4file.c, line 2696.
Abort trap: 6

Are your files netCDF 4 files? You can use H5F_IS_HDF5 if you don't want
pre-4 netCDF files:

IDL> help, h5f_is_hdf5(file_which('ncgroup.nc'))
<Expression> LONG = 1
IDL> help, h5f_is_hdf5(file_which('sample.nc'))
<Expression> LONG = 0


Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Absolute value of negative number is negative
Next Topic: Help request - MODIS AOD L2/3K map plot in IDL

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

Current Time: Wed Oct 08 19:25:30 PDT 2025

Total time taken to generate the page: 0.30723 seconds