Re: Attach lat/lon to variables

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 07 2013 - 08:54:43 MST

On Mar 7, 2013, at 8:28 AM, Tracy Emerson wrote:

> Thanks, Mary
> Actually since I sent the email, I've decided to include national boundaries, which would use a mapping overlay right? Then I would be able to use the lat2d/lon2d?

Yes, that's correct, and you would no longer need the sfX/YArray resources. When you use the special lat2d/lon2d with functions like gsn_csm_contour_map, then internally the sfX/YArray resources are set to these two attributes *and* the code tries to determine if a cyclic point is needed.

Since you have WRF data, you want to be sure to also set:

  res@gsnAddCyclic = False

I've been meaning to create a WRF examples page that uses gsn_csm_xxxx scripts. I'll try to do something soon.

We have some, but they are out-of-date. See:

Note that if you use lat2d/lon2d, you do *not* want to set "res@tfDoNDCOverlay = True".
Just don't set this resource at all, because it defaults to False.


> I've been looking at all the contour overlay example to try and figure this out.
> I used to use the wrf_contour functions, but I didn't like that it set some resources internally that made it difficult to change some things.
> Tracy
> On 3/7/2013 8:01 AM, Mary Haley wrote:
>> Hi Tracy,
>> The special lat2d and lon2d attributes are for when you are plotting over a map. In your case, you are just plotting straight contours.
>> Try setting these additional resources:
>> resTer@sfXArray = lon
>> resTer@sfYArray = lat
>> resQv@sfXArray = lon
>> resQv@sfYArray = lat
>> This provides coordinate information to gsn_csm_contour and will hopefully get rid of that warning.
>> If you have problems with tickmarks, you might also try:
>> resQv@trGridType = "TriangularMesh
>> resTer@trGridType = "TriangularMesh
>> --Mary
>> On Mar 6, 2013, at 1:14 PM, Tracy Emerson wrote:
>>> Hello,
>>> I've been trying to attach lat/lon to variables I'm plotting, but I keep getting "warning:ContourPlotDraw: data boundary is out of range". I am working with an output file from WRF. In my script, lat and lon are 2D arrays with correct unit notation (degree_east,degree_north). They are the same size as the variables I am trying to attach them too. I've used various print statments to make sure of this. Attached is my NCL code.
>>> Thanks,
>>> Tracy
>>> <plot_wrf_cross_sec_d3.ncl>_______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Mar 7 08:54:54 2013

This archive was generated by hypermail 2.1.8 : Thu Mar 07 2013 - 08:55:58 MST