[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDFPerl #BVM-455008]: Validating with Perl NetCDF
- Subject: [netCDFPerl #BVM-455008]: Validating with Perl NetCDF
- Date: Wed, 22 Jul 2009 09:14:21 -0600
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