Re: Drawing vector plot with ascii data

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 19 2009 - 11:33:10 MST

The [*][*] syntax is to indicate that this is supposed to be a 2D
array with any dimensions. The syntax [*][*][*] indicates a 3D array
with any dimensions, [*] a 1D array with any length, and so on.

The error messages indicate that either you don't have latitude/
longitude coordinate arrays, which must be 1D and the same length as
the leftmost and rightmost dimensions of your variable respectively,
or that you don't have the correct units of "degrees_north" and
"degrees_east" attached to your coordinate arrays.

If you have 1D data variables, and you are trying to regrid them to
2D arrays and add your own lat/lon coordinate arrays, then see
example "hdf4sds_1.ncl" at:

   http://www.ncl.ucar.edu/Applications/HDF.shtml

Click on the "hdf4sds_1.ncl" script and scroll down to the comments
that say:

;*****************************************************
; Create TRMM coordinate variables. See README
;*****************************************************

The following section shows a way of adding your own lat/lon
coordinate arrays.

If you are well on your way to adding coordinate arrays, but are
still having problems, then the first thing to do to look at your
arrays is call "printVarSummary" on them:

   printVarSummary(u)
   printVarSummary(v)

"u" and "v" should be replaced with whatever the names of your
variables are.

If your u and v have coordinate arrays, your output will look
something like this:

Variable: u
Type: float
Total Size: 304128 bytes
             76032 values
Number of Dimensions: 3
Dimensions and sizes: [time | 64] x [lat | 33] x [lon | 36]
Coordinates:
             time: [0..378]
             lat: [20..60]
             lon: [-140..-52.5]
Number Of Attributes: 1
   _FillValue : -9999

You can further test the "lat" and "lon" arrays to see if they have
the correct units:

printVarSummary(u&lat)
printVarSummary(u&lon)

This should look something like:

Variable: lat (coordinate)
Type: float
Total Size: 132 bytes
             33 values
Number of Dimensions: 1
Dimensions and sizes: [lat | 33]
Coordinates:
Number Of Attributes: 0
units : degrees_north

If you don't see the "degrees_north" for lat and/or "degrees_east"
for lon", and you know that your units *are* degrees_north and
degrees_east, then you can add them yourself, before you do any
plotting:

u&lat@units = "degrees_north"
u&lon@units = "degrees_east"

If you continue to have problems, please email us with more
information, like the "printVarSummary" output of the variables you
are reading off the file, and a "print" of the file itself. For example:

   a = addfile("test.nc","r")
   print(a)

--Mary

On Nov 19, 2009, at 9:03 AM, sinan wrote:

> Thank you very much for all answers. I will try all the solutions
> that you recommend me. But stil one issue remains.
>
> The wind components u and v must be 2 dimensional like below.
>
> u [*][*] : numeric,
>
> v [*][*] : numeric,
>
> But what does (*) symbol mean? The first dimension is latitude and
> the second dimension is the velocity? I tried this but I get the
> following error message
>
> 0) check_for_y_lat_coord: Warning: Data either does not contain
> a valid latitude coordinate array or doesn't contain one at all.
>
> (0) A valid latitude coordinate array should have a 'units'
> attribute equal to one of the following values:
>
> (0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees
> north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN'
> 'deg north'
>
> (0) check_for_lon_coord: Warning: Data either does not contain
> a valid longitude coordinate array or doesn't contain one at all.
>
> (0) A valid longitude coordinate array should have a 'units'
> attribute equal to one of the following values:
>
> (0) 'degrees_east' 'degrees-east' 'degree_east' 'd
>
>
>
> I tried every combinations of latitude cordinate array but it did
> not work. Could you give me and example of valid coordinate array.
> Thank you very much.
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 19 11:33:25 2009

This archive was generated by hypermail 2.1.8 : Mon Nov 23 2009 - 12:24:02 MST