Re: Error about NetCDF

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue, 02 Sep 2008 10:04:00 -0600

Hi Cao,

(Yes, NCL can display this file correctly.)

First, upon reading a short array into NCL you should convert the
variable of type short to float, using the short2flt function:
http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml

With regards to your error message, NCL plotting functions expect the
units attributes to be set for the latitude/longitude coordinate
variable arrays. See the FAQ about this topic here:
http://www.ncl.ucar.edu/FAQ/#err_msgs_010
So you will need to add something like this to your code:
a&x_at_units = "degrees_east"
a&y_at_units = "degress_north"

Let us know if that doesn't fix your problem..
Adam

caoyan_at_cma.gov.cn wrote:
> hello:
>
> I want display NetCDF file, but it occur such error:" 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'"
>
> the unit in My NetCDF file is "Meter"
>
> following is the result of printVarSummary()
>
> Variable: a
> (0)
> filename: province
> path: province.nc
> file global attributes:
> Conventions : CF-1.0
> Source_Software : ESRI ArcGIS
> dimensions:
> ncl_scalar = 1
> x = 1222
> y = 1000
> variables:
> double x ( x )
> long_name : x coordinate of projection
> standard_name : projection_x_coordinate
> units : Meter
>
> double y ( y )
> long_name : y coordinate of projection
> standard_name : projection_y_coordinate
> units : Meter
>
> short Calculation ( y, x )
> long_name : Calculation
> esri_pe_string : PROJCS["Clarke_1866_Albers",GEOGCS["GCS_Clarke_1866",DATUM["D_Clarke_1866",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",110.0],PARAMETER["Standard_Parallel_1",25.0],PARAMETER["Standard_Parallel_2",47.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
> coordinates : x y
> grid_mapping : albers_conical_equal_area
> units : Meter
> missing_value : -128
> _FillValue : -128
>
> integer albers_conical_equal_area ( ncl_scalar )
> grid_mapping_name : albers_conical_equal_area
> longitude_of_central_meridian : 110
> latitude_of_projection_origin : 0
> false_easting : 0
> false_northing : 0
> standard_parallel : ( 25, 47 )
>
> can NCL read and display my file correctly.
>
> Cao Yan
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Sep 02 2008 - 10:04:00 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 03 2008 - 11:24:29 MDT