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 #92610 is a reply to message #92608] Fri, 22 January 2016 11:20 Go to previous messageGo to previous message
khyde is currently offline  khyde
Messages: 21
Registered: November 2013
Junior Member
On Thursday, January 21, 2016 at 10:26:36 PM UTC-5, Michael Galloy wrote:
> 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)

These particular files are netcdf4 so I can use the H5f program, but not all of my files are netcdf4 so I was hoping to find a way to automatically test what type of files they are.
Thanks for your assistance,
Kim
[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:34:42 PDT 2025

Total time taken to generate the page: 0.00466 seconds