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 #92611 is a reply to message #92610] Fri, 22 January 2016 11:26 Go to previous messageGo to previous message
khyde is currently offline  khyde
Messages: 21
Registered: November 2013
Junior Member
On Friday, January 22, 2016 at 2:20:25 PM UTC-5, kimber...@noaa.gov wrote:
> 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


In the end, I am mainly trying to quickly determine if the netcdf files I downloaded are corrupt or incomplete. That way if they are bad, I can remove them so that they don't crash during subsequent processing. Currently I am opening the file and then using NCDF_INQUIRE to get the basic structure information, but if there is an easier way to check the file, I am open for ideas.

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: Fri Oct 10 14:50:58 PDT 2025

Total time taken to generate the page: 3.84069 seconds