<div dir="ltr"><div><div><div><div>Hi Amanda.<br><br></div>Please look at:<br><a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml">https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml</a><br><a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/region_ind.shtml">https://www.ncl.ucar.edu/Document/Functions/Contributed/region_ind.shtml</a><br><br></div>These are, more or less, the same.<br><br></div>Perhaps, they can be used to get the j1:j2, i1:i1 indices.<br><br>---<br></div>When you do this [ sst(lat,lon) ]<br><div><pre> res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = .... ; set min contour level
res@cnMaxLevelValF = .... ; set max contour level
res@cnLevelSpacingF = .... ; set contour spacing
plot = gsn_csm_contour_map(wks,sst, res) ; create plot<br></pre><pre>then try,<br><br> plot = gsn_csm_contour_map(wks,sst(j1:j2,i1,i2), res)</pre><pre> the 'global' cn resources are still in effect.<br><br></pre><pre>You have to manually adjust the mon and max values, ossibly the spacing.<br></pre><pre><br> printMinMax(sst(j1:j2,i1:i2),0)<br><br>---<br></pre><pre>You could use the default "AutomaticLevels" and not use the above by <br><br> <code>res@cnLevelSelectionMode = "AutomaticLevels" ; default<br> </code><br> plot = gsn_csm_contour_map(wks,sst(j1:j2,i1,i2), res)<br><br></pre><pre>NCL will figure the min/max/spacing.<br><br>---<br></pre><pre>Hope this helps<br></pre><pre>D<br></pre><pre><br></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 28, 2017 at 4:05 AM, Amanda Frigola <span dir="ltr"><<a href="mailto:afrigola@marum.de" target="_blank">afrigola@marum.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi all!<div><span style="font-size:small"><br></span></div><div><span style="font-size:small">I plotted two different global SST datasets in the same panel using a common labelbar for both plots.</span></div><div><span style="font-size:small">I used the function printMinMax to help me setting the cnMinLevelValF and cnMaxLevelValF options.</span></div><div><span style="font-size:small"><br></span></div><div><span style="font-size:small">Now I would like to plot a zoom of that panel, for the region defined by the interval [lat1,lat2]x[lon1,lon2] </span></div><div><span style="font-size:small">but i find it difficult to readjust cnMinLevelValF and cnMaxLevelValF so they represent this zoomed-in region, </span></div><div><span style="font-size:small">because although the SST function has coordinates LONG and LAT, LONG and LAT are curvilinear grids,</span></div><div><span style="font-size:small">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:</span></div><div><span style="font-size:small">printMinMax(SST(j1:j2,i1:i2),<wbr>0)</span></div><div><span style="font-size:small"><br></span></div><div><span style="font-size:small">Any ideas how to solve that?</span></div><div><span style="font-size:small">Best,</span></div><div><span style="font-size:small">Amanda</span></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>