NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

[netcdfgroup] PDL::NetCDF reading char data

Hello,

I'm having some problems reading character data from a netcdf file using
PDL::NetCDF.  This is my example nc file (from ncdump):

netcdf testnc {
dimensions:
        recNum = UNLIMITED ; // (3 currently)
        char_len = 256 ;
variables:
        char char_data(recNum, char_len) ;
                char_data:long_name = "some char data" ;
data:

 char_data =
  "some char data 0",
  "some char data 1",
  "some char data 2" ;
}

I will call "get" like this:

$recn = $nc->dimsize("recNum");
$tmp = $nc->get("char_data", [0,0], [$recn, 256]);
print $tmp;

And this is the output I see:

[ 'some char data 0' '' '' '' ]

Why is it only getting the first value?  I've verified that $recn is 3.
 Any ideas?

Thanks,
Brice Lambi



  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: