Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFPerl #BVM-455008]: Validating with Perl NetCDF



Milo,

> I'm interested in using the Perl NetCDF library for a simple task,
> that is to validate a large number of netcdf files. A simple check
> that they're actual netcdf and not junk is all that is required.
> Apparently in C++ there's an is_valid() method that could be used for
> this purpose, but I can't find anything similar with Perl. I've tried
> NetCDF::open("$file",NOWRITE) but this dies if an invalid file is found.
> 
> Do you have any suggestions?

The NetCDF-Perl package doesn't have anything equivalent to the is_valid() 
method.

I think you could modify the "ncopts" variable so that the open() doesn't die 
but, instead, returns an error code.  It would then be a matter of writing a 
Perl subroutine that tested the file for validity by performing the same steps 
as the is_valid() function.

It seems, however, that it would be simpler to write C++ program to do the 
validating rather than a NetCDF-Perl script.

> Thanks,
> Milo Thurston.
> 
> --
> Dr. Milo Thurston
> http://climateprediction.net
> http://www.oerc.ox.ac.uk

Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: BVM-455008
Department: Support netCDF Perl
Priority: Normal
Status: Closed


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690