On Tue, Sep 7, 2010 at 2:46 AM, Doug Hunt <[email protected]> wrote:
> Hi Puneet:  I don't believe that 'info' is a PDL::NetCDF method. PDL::NetCDF
> objects are not PDLs they are a different sort of object.  One gets PDL
> objects back from the $nc->get('variable_name') method.


Thanks Doug. I had a memory lapse there. I had used NetCDF
successfully sometime back, and then just wiped out.

I have added wiki notes on how to install NetCDF and PDL::NetCDF.

https://sourceforge.net/apps/mediawiki/pdl/index.php?title=Installing_PDL_on_Mac_OS_X#PDL::NetCDF


>
> Regards,
>
>  Doug
>
> [email protected]
> Software Engineer
> UCAR - COSMIC, Tel. (303) 497-2611
>
> On Mon, 6 Sep 2010, P Kishor wrote:
>
>> further on this...
>>
>> On Mon, Sep 6, 2010 at 10:48 PM, P Kishor <[email protected]> wrote:
>>>
>>> I have used PDL-NetCDF in the past, but now I am lost. My PDL-NetCDF
>>> installation is not working, possibly because of a host of stuff that
>>> I upgraded. So, I am trying to reinstall, but am running into a few
>>> problems --
>>>
>>> Which NetCDF library is compatible with PDL-NetCDF 4.03? From the
>>> docs, "This is the PDL interface to the Unidata NetCDF library. It
>>> uses the netCDF version 3 library to make a subset of netCDF
>>> functionality available to PDL users in a clean, object-oriented
>>> interface." Yet, the docs go on to say that I can check if compiled
>>> against netcdf4 with
>>>
>>>  if (PDL::NetCDF::isNetcdf4) {
>>>        # open netcdf4 file
>>>  }
>>>
>>
>>
>> Yeah, I figured this out. I need to have HDF5 if I want NetCDF 4
>> format, but I couldn't get HDF5 to install on my computer. Anyway...
>>
>>> The latest stable version of NetCDF is 4.1.1, which installs
>>> successfully for me. After that, I install PDL-NetCDF 4.03, but I
>>> still get the following error
>>>
>>> Can't locate auto/PDL/NetCDF/info.al in @INC (@INC contains:
>>>        /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level
>>> /usr/local/lib/perl5/site_perl/5.12.1
>>> /usr/local/lib/perl5/5.12.1/darwin-2level /usr/local/lib/perl5/5.12.1
>>> .) at latlon.pl line 54 (#1)
>>> Uncaught exception from user code:
>>>        Can't locate auto/PDL/NetCDF/info.al in @INC (@INC contains:
>>> /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level
>>> /usr/local/lib/perl5/site_perl/5.12.1
>>> /usr/local/lib/perl5/5.12.1/darwin-2level /usr/local/lib/perl5/5.12.1
>>> .) at latlon.pl line 54
>>>  at /usr/local/lib/perl5/5.12.1/AutoLoader.pm line 47
>>>        AutoLoader::AUTOLOAD('PDL::NetCDF=HASH(0x100826a00)') called
>>> at latlon.pl line 54
>>>
>>>
>>> I seem to vaguely recall that PDL-NetCDF didn't work with NetCDF
>>> 4.1.1, and required the previous version 4.0.1. Any suggestions?
>>>
>>
>>
>> This is strange. Actually, both NetCDF 4.0.1 and NetCDF 4.1.1 work
>> just fine. In my simple script, I have the following
>>
>> ----
>> my $nc = PDL::NetCDF->new("data.nc", {REVERSE_DIMS => 1});
>>
>> my $varlist = $nc->getvariablenames();
>> foreach my $var (@$varlist) {
>>   print "\nVar: $var\n";
>>
>>   my $dims = $nc->getdimensionnames($var);
>>   foreach my $dim (@$dims) {
>>       my $dimsize = $nc->dimsize($dim);
>>       print "$dim: $dimsize\n";
>>   }
>>
>>   print "\n$var metadata\n";
>>   foreach my $att (@$atts) {
>>       my $attval = $nc->getatt($att, $var);
>>       print "$att: $attval\n";
>>   }
>> }
>>
>> print $nc->info();
>> ----
>>
>> Everything works just fine until `print $nc->info()` when I get the
>> "Can't locate auto/PDL/NetCDF/info.al in @INC" error. Why am I not
>> able to load the NetCDF file as a piddle?
>>
>>
>>
>>
>> --
>> Puneet Kishor
>>

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to