[ncl-talk] plotting model output where x/y are not lat/lon

Yuqiang Zhang yuqiangzhang.thu at gmail.com
Thu Aug 27 21:27:28 MDT 2015


Hi Mira,

Check the link here
http://www.ncl.ucar.edu/FAQ/
For Q 27:

When I call one of the gsn_csm_xxxx_map plotting scripts, I get an error
message about a units attribute not being correct.
If you are using one of the gsn_csm_xxx_map functions to overlay data on a
map, and seeing one or both of the following error messages:

    (0)   is_valid_lat_ycoord: Warning: The units attribute of 
    the Y coordinate array is not set to one of the allowable 
    units values (i.e. 'degrees_north'). Your latitude labels 
    may not be correct.

    (0)   is_valid_lat_xcoord: Warning: The units attribute of 
    the X coordinate array is not set to one of the allowable 
    units values (i.e. 'degrees_east'). Your longitude labels 
    may not be correct.
then this means that your data contains coordinate arrays, but the
coordinate arrays either don't have the necessary "units" attribute, or it's
not set to one of the allowable values ("degrees_east" for longitude values
and "degrees_north" for latitude values).
If your coordinate arrays are indeed degrees east and degrees north, then
you can set the units attribute as follows (this code snippet assumes your
data array is called "data" and that the coordinate arrays are called "lat"
and "lon"):

  data&lat at units = "degrees_north"
  data&lon at units = "degrees_east"

Regards,
Yuqiang

-----Original Message-----
From: ncl-talk-bounces at ucar.edu [mailto:ncl-talk-bounces at ucar.edu] On Behalf
Of mberdahl at envsci.rutgers.edu
Sent: Thursday, August 27, 2015 10:21 PM
To: ncl-talk at ucar.edu
Subject: [ncl-talk] plotting model output where x/y are not lat/lon

Hi all,

I'm trying to make a simple plot of cumulative snowfall with data from a
model I did not run.  When I try to make a simple plot, I receive the
following error:

(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' 'degrees east'
'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


When I dump the file it looks like this:



netcdf ICE.1983.01-12.f77 {
dimensions:
        TIME = UNLIMITED ; // (365 currently)
        X10_69 = 60 ;
        Y18_127 = 110 ;
        SECTOR = 2 ;
        SECTOR1_1 = 1 ;
        ATMLAY14_23 = 10 ;
        bnds = 2 ;
        ATMLAY23_23 = 1 ;
        ATM6H3_3 = 1 ;
        OUTLAY = 20 ;
        OUTLAY1_1 = 1 ;

variables:
        double TIME(TIME) ;
                TIME:units = "HOURS since 1901-01-15 00:00:00" ;
                TIME:long_name = "time" ;
                TIME:time_origin = "15-JAN-1901 00:00:00" ;
                TIME:axis = "T" ;
        float DATE(TIME) ;
                DATE:units = "YYYYMMDDHH" ;
                DATE:long_name = "Date(YYYY MM DD HH)" ;
                DATE:history = "From ICE.f77.1983.01.01-15" ;
        double X10_69(X10_69) ;
                X10_69:units = "km" ;
                X10_69:long_name = "x" ;
                X10_69:point_spacing = "even" ;
                X10_69:axis = "X" ;

 double Y18_127(Y18_127) ;
                Y18_127:units = "km" ;
                Y18_127:long_name = "y" ;
                Y18_127:point_spacing = "even" ;
                Y18_127:axis = "Y" ;
        float LON(Y18_127, X10_69) ;
                LON:units = "degrees" ;
                LON:long_name = "Longitude" ;
                LON:history = "From ICE.f77.1983.01.01-15" ;
        float LAT(Y18_127, X10_69) ;
                LAT:units = "degrees" ;
                LAT:long_name = "Latitude" ;
                LAT:history = "From ICE.f77.1983.01.01-15" ;


Clearly there are lats and lons associated with the x and y spacing, but I'm
not sure how to tell NCL how to use those.  Does anyone have advice on this?

Thanks in advance,
Mira


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



More information about the ncl-talk mailing list