[ncl-talk] sub: coordinate unit error

Mary Haley haley at ucar.edu
Mon Apr 17 10:33:38 MDT 2017


This error message comes from calling one of the gsn_csm_xxx_map plotting
routines, and passing in data that has no lat/lon coordinate information
provided, either via coordinate arrays, or via the special lat2d/lon2d
attributes.

In the code you provided, I don't see any calls to gsn_csm_xxxx_map, so I'm
not sure how you got that message. Did you include the full script?

The error message is pretty much telling you what the problem is, and the
solution may be simply that you need to add a "units" attribute to your
lat/lon coordinate arrays.

After these two lines:

xSumLon&lat = x4d(0,0,:,0)
xSumLon&lon = x4d(0,0,0,:)

Add these two lines:

xSumLon&lat at unit = "degrees_north"
xSumLon&lon at units = "degrees_east"

If you continue to have problems, please do a "replay all" to this message
and include the new error.  It would also help if you include the full
script, or at least the script up to the point where the error occurs.

Thanks,

--Mary






On Fri, Apr 14, 2017 at 7:05 PM, dale zuri <dalezuri at gmail.com> wrote:

> Hi,
> Please help me to fix this bug? Here is part of my code and the error I get
> x4d  = reshape(precppicktimeAMJJAS,(/183,4,26,76/))
> print(x4d(:,:,0,0))
> ;printVarSummary(precppicktimeAMJJAS)  ;print out structure/basic info of
> the data
> printVarSummary(x4d)  ;print out structure/basic info of the data
>
> xSumLon = dim_sum_n(x4d,1)
> printVarSummary(xSumLon)  ;print out structure/basic info of the data
> xSumLon!0="time" ;added by feng
> xSumLon!1="lat" ;added by feng
> xSumLon!2="lon" ;added by feng
> xSumLon&lat = x4d(0,0,:,0)
> xSumLon&lon = x4d(0,0,0,:)
> xd=xSumLon
> ;;;;;;;;;Areal average;;;;;;;;;;;;;;;;;;;;;;
> printVarSummary(xSumLon)
> zAvgLon = dim_avg_n_Wrap(xSumLon,(0))
> printVarSummary(zAvgLon)
> printMinMax(zAvgLon,0)
> print(zAvgLon)
> (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'
>
> Thank you,
>
>
>
> _______________________________________________
> 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/20170417/5e998bd2/attachment.html 


More information about the ncl-talk mailing list