Re: limiting a polar stereographic plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Nov 30 2012 - 08:49:06 MST

Hi Dave,

Sorry I didn't respond sooner. I was out of the office.

It looks like you have a lambert conformal projection, so you might try setting these resources:

   res@mpProjection = "LambertConformal"
   res@mpLambertParallel1F = TRUELAT1
   res@mpLambertParallel2F = TRUELAT2
   res@mpLambertMeridianF = CEN_LON

This should get your contour into a rectangle area.

--Mary

On Nov 27, 2012, at 11:28 AM, David B. Reusch wrote:

> Hi Mary,
>
> For what it's worth, I do still have the original CEN_LAT, CEN_LON, TRUELAT1 and TRUELAT2 data for the full WRF polar stereographic domain, just not in my netCDF data files anymore (I'm about 3 or 4 processing steps removed from the original files and some key metadata has disappeared along the way...). I'm not familiar enough with the WRF plotting functions to know exactly what metadata they need and have had enough bad experiences trying to use them (and very limited time to get this working) that I don't really want to try that option.
>
> That being said, I've managed to get pretty close to what I want the old-fashioned way: lots and lots of trial & error! I switched from lat2d/lon2d to sfXArray/sfYArray on my plot var. I'm also using mpLimitMode="LatLon" with hardcoded min/max lat/lon values (i.e., I haven't been able to set these programmatically).
>
> <diidchfc.png>
> In a perfect world, there'd be a lot less white space at the bottom. But when I change mpMinLatF to do that, I lose the lower left corner of data and have been unable to get it back by changing mpMaxLonF. In contrast, I've been able to do whatever I want with the lower right with mpMinLonF (e.g., I'm confident I could tighten the right side a bit more if I wanted/needed to).
>
> More generally, I admit to stiil being a bit confused to see a non-rectangular data plot when it's polar stereographic data and I'm telling NCL to use a stereographic projection.
>
> But with AGU around the corner, I think I can live with these plots for now.
>
> Thanks,
> Dave
>
> Mary Haley said the following on 11/27/12 9:05 AM:
>> Hi Dave,
>>
>> If you are just trying to limit the polar stereographic projection, you can set res@mpMaxLatF to some value less than 0, but greater than -90.
>>
>> If you don't have any metadata information, then you likely will not be able to do a native map plot, since you won't have the necessary map parameters.
>>
>> However, since you have the 2D lat/lon, you can use whatever map projection you want, including "CylindricalEqualArea", "Mercator", etc. You need to set:
>>
>> res@sfXArray = lon2d ; or whatever your longitude variable is called
>> res@sfYArray = lat2d ; or whatever your latitude variable is called
>>
>> You will also need:
>>
>> res@gsnAddCyclic = False ; Don't add a longitude cyclic point.
>>
>> To zoom in on the map, depending on what type of projection you use, you can try:
>>
>> res@mpMinLatF = min(lat2d)
>> res@mpMaxLatF = max(lat2d)
>> res@mpMinLonF = min(lon2d)
>> res@mpMaxLonF = max(lon2d)
>>
>> or
>>
>>
>> res@mpLimitMode = "Corners"
>> res@mpLeftCornerLatF = lat2d(0,0)
>> res@mpLeftCornerLonF = lon2d(0,0)
>> res@mpRightCornerLatF = lat2d(nlat-2,nlon-2)
>> res@mpRightCornerLonF = lon2d(nlat-2,nlon-2)
>>
>> Finally, make sure you *don't* have tfDoNDCOverlay set (it defaults to False, and setting it to True means you want to do a native projection).
>>
>> --Mary
>>
>> On Nov 26, 2012, at 5:58 PM, David B. Reusch wrote:
>>
>>
>>> I am trying to create plots of a subset from a WRF grid and am unhappy with my results. The metadata variables normally used with the wrfxx plotting functions (i.e., that are created by WRF) are long gone due to a number of postprocessing steps so those options are probably out. I still have 2-d lat and lon and the data appear to plot correctly with a polar stereographic gsn_csm_map_polar call -- I just need to zoom in (i.e., limit) the plot to where I have data. The plot below shows the default (only?) result with this approach.
>>> <ccceahaa.png>
>>> This is not entirely a new situation/problem (i.e., I've had success in the past with a masked LambertConformal) but my old solutions don't seem to be working and I need some advice. The plot below is based on prior techniques and has a number of drawbacks: (1) too much white space, (2) possible spatial distortion?, (3) I'd like it flipped top-to-bottom, i.e. S Pole at top.
>>> <dbajbghb.png>
>>> In a "perfect" world, I'd be happy with something more like what ncview can produce (this is orography, the other two are temperature-related), i.e., a rectangular, non-distorted, white-space free plot (below). My efforts to do things as a native projection failed spectacularly, though it seemed reasonable to think that was the approach to take to "look like ncview".
>>> <cdeccfbh.png>
>>>
>>> Script and data are theoretically available but the former is not pretty (and it's very long since it's doing lots of other things).
>>>
>>> For completeness, this is a Mac (10.6) and the latest NCL.
>>>
>>> Thanks,
>>> Dave
>>> --
>>> Associate Research Professor of Climatology
>>> Dept of Earth and Environmental Science
>>> MSEC 304; 801 Leroy Place
>>> New Mexico Tech
>>> Socorro, NM 87801
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>>
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> Associate Research Professor of Climatology
> Dept of Earth and Environmental Science
> MSEC 304; 801 Leroy Place
> New Mexico Tech
> Socorro, NM 87801
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Nov 30 08:49:14 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 07 2012 - 13:30:06 MST