Re: Help:Is there a bug in function "readAsciiTable" or I use this function wrong?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Sun Apr 25 2010 - 17:43:52 MDT

Hi,

It looks like "readAsciiTable" is ignoring the second argument of (/0,1/) if the first value is 0.

It's a simple fix. Try the attached new version of this function. You can load it right after you load "contributed.ncl":

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "readAsciiTable.ncl"

--Mary

On Apr 25, 2010, at 12:37 PM, lxf wrote:

> + ncol = 13
> + data = readAsciiTable("t.txt", ncol, "float", (/0,1/))
> + printVarSummary(data)
> + print(data(:,0)+" "+data(:,1)+" "+data(:,2)+" "+data(:,3))
> + end
> warning:asciiread: End of file reached and only (26) elements were read from the file, filling remaining elements with the default missing value for the requested type
>
>
> Variable: data
> Type: float
> Total Size: 156 bytes
> 39 values
> Number of Dimensions: 2
> Dimensions and sizes: [3] x [13]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : -999
> (0) 1951 5.3 5.1 7
> (1) 1952 6.7 7.1 8.3
> (2) -999 -999 -999 -999
> lxf@sun04:/home/lxf[1862]cat t.txt
> 1951 5.3 5.1 7.0 9.4 11.9 11.2 13.3 13.2 12.5 11.4 9.5 8.9
> 1952 6.7 7.1 8.3 10.3 10.3 12.5 13.0 12.6 12.1 9.9 7.7 8.4
> YEAR JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
> lxf@sun04:/home/lxf[1863]

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Sun Apr 25 17:44:00 2010

This archive was generated by hypermail 2.1.8 : Thu Apr 29 2010 - 08:05:27 MDT