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

[netCDFPerl #NGH-715937]: Error with NetCDF::attget



Alex,

> Full Name: THEPAUT Alex
> Email Address: address@hidden
> Organization: Capgemini
> Package Version:
> Operating System: Solaris/Linux
> Hardware:
> Description of problem:
> 
> Hello,
> 
> I use the function NetCDF::attget to retrieve informations about an attribute 
> :
> 
> my $l_var = "";
> NetCDF::attget($p_file, NetCDF::GLOBAL, $p_variable , \$l_var);
> 
> But the attribute doesn't exist and I get the following error:
> 
> ncattinq: ncid 5; varid -1; attname "id": NetCDF: Attribute not found
> 
> I've tried to catch the exception with an eval block, but the result is
> the same. My question is: how can I catch the error ?

To prevent error-messages from being written to the standard error stream, call 
"NetCDF::opts(0)". This will also prevent process termination by the netCDF 
library.

To determine what attributes exist for a variable, call "NetCDF::attinq()".

To determine if an attribute exists, call "NetCDF::attget()" after an initial 
call to "NetCDF::opts(0).

The guide to the netCDF-2 API can be found at 
<http://www.unidata.ucar.edu/netcdf/old_docs/really_old/guide_toc.html>. The 
netCDF-2 API is the basis of the NetCDF-Perl module.

> Best regards
> 
> Alex THEPAUT

Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: NGH-715937
Department: Support netCDF Perl
Priority: Normal
Status: Closed


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.