[ncl-talk] NCL plot problem with ascii data

Toni Klemm toni-klemm at tamu.edu
Thu Apr 4 10:06:04 MDT 2019


Hi Ali,

I had this problem before. Since you extracted lat and lon data from ASCII, it might be that your data doesn’t have metadata information attached that tells NCL what it is (i.e., latitudes and longitudes). Without that it is just a bunch of numbers for NCL. You can add this metadata by adding this to your code after you extract your latitude and longitude variables:

  latitude!0 = "lat"
  latitude&lat = lat
  latitude at long_name = "latitude"
  latitude at units = "degrees_north"

  longitude!0 = "lon"
  longitude&lon = lon
  longitude at long_name = "longitude"
  longitude at units = "degrees_east"

Hope that helps,
Toni


Toni Klemm, Ph.D.
Postdoctoral Research Associate
Department of Ecosystem Science and Management
College of Agriculture and Life Sciences
Texas A&M University, College Station, TX
Contributor to the Early Career Climate Forum <http://www.eccforum.org/>
www.toni-klemm.de <http://www.toni-klemm.de/> | @toniklemm <http://twitter.com/toniklemm>








> On Apr 4, 2019, at 2:00 AM, MM Ali <mmali110 at gmail.com> wrote:
> 
> Hi,
> 
> I modified the ce_3.ncl code to read the ascii data. Data and the modified ncl code are attached. The variables in the data are dummy, latitude, longitude, variable, dummy2. I get the following errors
> 
> (0)     check_for_y_lat_coord: Warning: Data either does not contain
> (0)     a valid latitude coordinate array or doesn't contain one at all.
> (0)     A valid latitude coordinate array should have a 'units'
> (0)     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
> (0)     a valid longitude coordinate array or doesn't contain one at all.
> (0)     A valid longitude coordinate array should have a 'units'
> (0)     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'
> (0)     Error: scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length.
> warning:create: Bad HLU id passed to create, ignoring it 
> 
> Please help. It would be great if the necessary corrections are made to the code (I am just a few days old for NCL, though 66+ years old!)
> Thanks
> Ali
> Dr. MM Ali
> Formerly:
> Scientist G & Group Director
> NRSC/ISRO
> email: mmali110 at gmail.com <mailto:mmali110 at gmail.com>
>            mmali at coaps.fsu.edu <mailto:mmali at coaps.fsu.edu>
> Mob: +91 9949045110
> <may.txt><ce3.ncl>_______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190404/c6698045/attachment.html>


More information about the ncl-talk mailing list