[ncl-talk] how to adjust cnMinLevelValF and cnMaxLevelValF when zooming in on a region

Dennis Shea shea at ucar.edu
Thu Sep 28 10:47:54 MDT 2017


Hi Amanda.

Please look at:
https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml
https://www.ncl.ucar.edu/Document/Functions/Contributed/region_ind.shtml

These are, more or less, the same.

Perhaps, they can be used to get the j1:j2,  i1:i1 indices.

---
When you do this [ sst(lat,lon) ]

  res at cnLevelSelectionMode = "ManualLevels"     ; set manual contour levels
  res at cnMinLevelValF       = ....               ; set min contour level
  res at cnMaxLevelValF       = ....               ; set max contour level
  res at cnLevelSpacingF      = ....               ; set contour spacing

  plot = gsn_csm_contour_map(wks,sst, res)  ; create plot

then try,

  plot = gsn_csm_contour_map(wks,sst(j1:j2,i1,i2), res)

 the 'global' cn resources are still in effect.

You have to manually adjust the mon and max values, ossibly the spacing.


 printMinMax(sst(j1:j2,i1:i2),0)

---

You could use the default "AutomaticLevels" and not use the above by

   res at cnLevelSelectionMode = "AutomaticLevels"   ; default

    plot = gsn_csm_contour_map(wks,sst(j1:j2,i1,i2), res)

NCL will figure the min/max/spacing.

---

Hope this helps

D



On Thu, Sep 28, 2017 at 4:05 AM, Amanda Frigola <afrigola at marum.de> wrote:

> Hi all!
>
> I plotted two different global SST datasets in the same panel using a
> common labelbar for both plots.
> I used the function printMinMax to help me setting the cnMinLevelValF and
> cnMaxLevelValF options.
>
> Now I would like to plot a zoom of that panel, for the region defined by
> the interval [lat1,lat2]x[lon1,lon2]
> but i find it difficult to readjust cnMinLevelValF and cnMaxLevelValF so
> they represent this zoomed-in region, ​
> because although the SST function has coordinates LONG and LAT, LONG and
> LAT are curvilinear grids,
> so lat1 for example is not represented by a unique j value, which makes it
> hard to find the right j1, j2, i1, i2 values for the expression:
> printMinMax(SST(j1:j2,i1:i2),0)
>
> Any ideas how to solve that?
> Best,
> Amanda
>
> _______________________________________________
> 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/20170928/b4120fb6/attachment.html>


More information about the ncl-talk mailing list