<div dir="ltr">Here is more information about dat with 2-D coordinates. I was typing this up when I saw Will's reply. Some of the other examples indicate that trGridTrype may not be needed with some data sets.<div><br></div><div><div>Please see section #2 on this documentation page, for a basic description. Notice the several different working examples:</div><div><a href="https://www.ncl.ucar.edu/Document/Graphics/overlays_on_map.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Graphics/overlays_on_map.shtml</a><br></div><div><br></div><div>(Please ignore the link "2D vertical coordinates", that is not about geographic surface maps, and can be confusing.)</div><div><br></div><div>The simplest example for making map plots with 2-D coordinates is example 3 on this page:</div><div><a href="https://www.ncl.ucar.edu/Applications/ice.shtml" target="_blank">https://www.ncl.ucar.edu/Applications/ice.shtml</a><br></div><div><br></div><div>I also like NARR example 4 because it shows how the 2-D coordinate method can be used with different map projections:</div><div><a href="http://www.ncl.ucar.edu/Applications/narr.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/narr.shtml</a></div><div><br></div><div>--Dave</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 27, 2015 at 9:35 PM, Will Hobbs <span dir="ltr"><<a href="mailto:Will.Hobbs@utas.edu.au" target="_blank">Will.Hobbs@utas.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Mira<br>
<br>
It looks like you have 2-d lat and lon arrays associated with your data,<br>
as is often the case with models (especially ocean models).<br>
<br>
This can be plotted by NCL without regridding, see the examples here:<br>
<a href="http://www.ncl.ucar.edu/Applications/ease.shtml" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/Applications/ease.shtml</a><br>
Although you are not using the EASE grid, the principal is exactly the<br>
same:<br>
<br>
1. Set your map plot grid type resource<br>
>res@trGridTrype = "TriangularMesh"<br>
<br>
2. Set the lat and lon arrays as attributes of the array you are plotting,<br>
so if your array is 'x'<br>
> x@lat2d = LAT<br>
> x@lon2d = LON<br>
<br>
The just use one of the gsn_csm contour map plotting functions as normal.<br>
<br>
I hope that's clear.<br>
<br>
Will<br>
<br>
<br>
On 28/08/15 1:27 PM, "Yuqiang Zhang" <<a href="mailto:yuqiangzhang.thu@gmail.com">yuqiangzhang.thu@gmail.com</a>> wrote:<br>
<br>
>Hi Mira,<br>
><br>
>Check the link here<br>
><a href="http://www.ncl.ucar.edu/FAQ/" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/FAQ/</a><br>
>For Q 27:<br>
><br>
>When I call one of the gsn_csm_xxxx_map plotting scripts, I get an error<br>
>message about a units attribute not being correct.<br>
>If you are using one of the gsn_csm_xxx_map functions to overlay data on a<br>
>map, and seeing one or both of the following error messages:<br>
><br>
> (0) is_valid_lat_ycoord: Warning: The units attribute of<br>
> the Y coordinate array is not set to one of the allowable<br>
> units values (i.e. 'degrees_north'). Your latitude labels<br>
> may not be correct.<br>
><br>
> (0) is_valid_lat_xcoord: Warning: The units attribute of<br>
> the X coordinate array is not set to one of the allowable<br>
> units values (i.e. 'degrees_east'). Your longitude labels<br>
> may not be correct.<br>
>then this means that your data contains coordinate arrays, but the<br>
>coordinate arrays either don't have the necessary "units" attribute, or<br>
>it's<br>
>not set to one of the allowable values ("degrees_east" for longitude<br>
>values<br>
>and "degrees_north" for latitude values).<br>
>If your coordinate arrays are indeed degrees east and degrees north, then<br>
>you can set the units attribute as follows (this code snippet assumes your<br>
>data array is called "data" and that the coordinate arrays are called<br>
>"lat"<br>
>and "lon"):<br>
><br>
> data&lat@units = "degrees_north"<br>
> data&lon@units = "degrees_east"<br>
><br>
>Regards,<br>
>Yuqiang<br>
><br>
>-----Original Message-----<br>
>From: <a href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a> [mailto:<a href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a>] On<br>
>Behalf<br>
>Of <a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a><br>
>Sent: Thursday, August 27, 2015 10:21 PM<br>
>To: <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
>Subject: [ncl-talk] plotting model output where x/y are not lat/lon<br>
><br>
>Hi all,<br>
><br>
>I'm trying to make a simple plot of cumulative snowfall with data from a<br>
>model I did not run. When I try to make a simple plot, I receive the<br>
>following error:<br>
><br>
>(0) check_for_y_lat_coord: Warning: Data either does not contain a<br>
>valid latitude coordinate array or doesn't contain one at all.<br>
>(0) A valid latitude coordinate array should have a 'units' attribute<br>
>equal to one of the following values:<br>
>(0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north'<br>
>'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'<br>
>(0) check_for_lon_coord: Warning: Data either does not contain a valid<br>
>longitude coordinate array or doesn't contain one at all.<br>
>(0) A valid longitude coordinate array should have a 'units' attribute<br>
>equal to one of the following values:<br>
>(0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east'<br>
>'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'<br>
><br>
><br>
>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
><br>
>When I dump the file it looks like this:<br>
><br>
>netcdf ICE.1983.01-12.f77 {<br>
>dimensions:<br>
> TIME = UNLIMITED ; // (365 currently)<br>
> X10_69 = 60 ;<br>
> Y18_127 = 110 ;<br>
> SECTOR = 2 ;<br>
> SECTOR1_1 = 1 ;<br>
> ATMLAY14_23 = 10 ;<br>
> bnds = 2 ;<br>
> ATMLAY23_23 = 1 ;<br>
> ATM6H3_3 = 1 ;<br>
> OUTLAY = 20 ;<br>
> OUTLAY1_1 = 1 ;<br>
><br>
>variables:<br>
> double TIME(TIME) ;<br>
> TIME:units = "HOURS since 1901-01-15 00:00:00" ;<br>
> TIME:long_name = "time" ;<br>
> TIME:time_origin = "15-JAN-1901 00:00:00" ;<br>
> TIME:axis = "T" ;<br>
> float DATE(TIME) ;<br>
> DATE:units = "YYYYMMDDHH" ;<br>
> DATE:long_name = "Date(YYYY MM DD HH)" ;<br>
> DATE:history = "From ICE.f77.1983.01.01-15" ;<br>
> double X10_69(X10_69) ;<br>
> X10_69:units = "km" ;<br>
> X10_69:long_name = "x" ;<br>
> X10_69:point_spacing = "even" ;<br>
> X10_69:axis = "X" ;<br>
><br>
> double Y18_127(Y18_127) ;<br>
> Y18_127:units = "km" ;<br>
> Y18_127:long_name = "y" ;<br>
> Y18_127:point_spacing = "even" ;<br>
> Y18_127:axis = "Y" ;<br>
> float LON(Y18_127, X10_69) ;<br>
> LON:units = "degrees" ;<br>
> LON:long_name = "Longitude" ;<br>
> LON:history = "From ICE.f77.1983.01.01-15" ;<br>
> float LAT(Y18_127, X10_69) ;<br>
> LAT:units = "degrees" ;<br>
> LAT:long_name = "Latitude" ;<br>
> LAT:history = "From ICE.f77.1983.01.01-15" ;<br>
><br>
>Clearly there are lats and lons associated with the x and y spacing, but<br>
>I'm<br>
>not sure how to tell NCL how to use those. Does anyone have advice on<br>
>this?<br>
><br>
>Thanks in advance,<br>
>Mira<br></blockquote></div></div></div>