[ncl-talk] Trying to zoom in on Texas from WRF data, but am having issues with data scaling to map projection

Mary Haley haley at ucar.edu
Mon Mar 13 21:52:48 MDT 2017


​Hi Andrew,

Whenever you have data in native projection, which is data that has already
been projected into a particular area on a map, AND you have set
tfDoNDCOverlay to True, you have to be careful about zooming in on it. The
"res at tfDoNDCOverlay = True", tells NCL that the data has already been
projected, so assumes that you've already done the work of setting the map
projection parameters.

This works for the original data, of course. However, when you zoom in on
the map, you also have to zoom in on the data itself, because NCL has no
way of knowing how to correctly subset your data in order to have it line
up with your new map projection parameters.

There are two things you can do to get the zoom to be correct:

1) If you want to stay in the native map projection that's defined on the
file, you will need to subset your data to match the area of interest.

2) If you don't care about staying in the native map projection, then you
can read the 2D lat/lon arrays off the file and pass these to the plotting
procedure so NCL will know how to correctly zoom in on your data.

Please see the "dataonmap_zoom_10.ncl" example that I just added to the
"Plotting data on a map" page, which shows both methods:

http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex10zoom

You can compare this to the example above it, which plots the original data:

http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex10

--Mary




On Mon, Mar 13, 2017 at 2:16 PM, Andrew Schwartz <aschwa at ucar.edu> wrote:

> I am working on zooming in on Texas/ New Mexico for a case study that I'm
> performing with the WRF. I have the actual map zoomed in to the region that
> I want, but the plotting of the qnifa variable doesn't scale and stays as
> if the map projected is that of the CONUS. Can anyone tell me what I'm
> doing wrong? I have attached two plots to illustrate the issue. The plot of
> the CONUS is correct in its placement and areas of qnifa, the zoomed plot
> is not.
>
> Thanks in advance for the help!
>
> -Andrew
>
> load "$CSM/gsn_code.ncl"
> load "$CSM/gsn_csm.ncl"
> load "$CSM/contributed.ncl"
>
> begin
>   res = True
>   res at cnLinesOn          = False
>   res at cnFillOn           = True               ; color plot desired
>   res at cnLineLabelsOn     = False              ; turn off contour lines
>   res at cnInfoLabelOn       = False           ; turn off cn info label
>
>   res at mpGeophysicalLineColor= "black" ; color of continental outlines
>   res at mpPerimOn             = True ; draw box around map
>   res at mpPerimDrawOrder      = "PostDraw"
>   res at mpGridLineDashPattern = 2 ; lat/lon lines as dashed
>   res at mpOutlineBoundarySets = "GeophysicalAndUSStates"
>   res at mpUSStateLineColor    = "black"
>
>   cmap = read_colormap_file("CBR_drywet")
>
>   ff = addfile("wrfout.nc","r")
>   if (ff at MAP_PROJ .eq. 1) then
>     res at mpProjection        = "LambertConformal"
>   end if
>   res at mpLambertMeridianF    = ff at CEN_LON
>   res at mpLambertParallel1F   = ff at TRUELAT1
>   res at mpLambertParallel2F   = ff at TRUELAT2
>   res at gsnAddCyclic          = False
>   res at tfDoNDCOverlay        = True
>   res at mpLimitMode           = "Corners"
>   xlats = ff->XLAT
>   xlons = ff->XLONG
>   ijdim = dimsizes(xlats)
>   imax = ijdim(1)
>   jmax = ijdim(2)
>   res at mpLeftCornerLatF      = 37
>   res at mpLeftCornerLonF      = -110
>   res at mpRightCornerLatF     = 28
>   res at mpRightCornerLonF     = -96
>   res at mpFillOn                    = True
>
>   res at cnLevelSelectionMode = "ExplicitLevels"
>   res at cnLevels  = (/4E6,8E6,16E6,32E6,64E6/)
>   res at cnFillColors = (/7,6,5,4,3,2/)
>   res at cnMissingValFillColor = 13
>
>   hgt = ff->QNIFA(0,0,:,:)
>
>   res at tiMainString = "Ice-Friendly Aerosol Concentration at Lowest Model
> Level  ~C~   W/ IC_BC and -30% SMOIS 19:00Z February 24, 2007"
>   res at tiMainFontHeightF = 0.015
>   res at gsnRightString = " "
>   res at gsnLeftString = " "
>   res at gsnMaximize      = True
>   res at gsnFrame     = False            ; Don't advance the frame
>
>     wks = gsn_open_wks("png","qnifa_plot")
>     gsn_define_colormap(wks, "CBR_drywet")
>
>     map = gsn_csm_contour_map(wks,hgt,res)
>
>   frame(wks)
>
> end
>
> _______________________________________________
> 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/20170313/c0cdea58/attachment.html 


More information about the ncl-talk mailing list