<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Brandi,<br>
      A cyclic point is, in this case, an added longitude line at say
      360E to ensure that the data on the longitude line just west of
      360E gets smoothed correctly. When the documentation says that the
      rightmost dimension is to be treated as cyclic, it means that when
      smoothing the last instance of the rightmost dimension the first
      instance of said dimension is used. (ex. If your longitudes are
      every 2 degrees starting at 0E and ending at 358E, the function
      will use data at 356, 358, and 0E to smooth the data at 358E.)<br>
      <br>
      With regards to what g represents in the example:<br>
      You included it in your email:<br>
      "Define g(ntim, nlvl, nlat, mlon) where ntim = 50, nlvl = 30, nlat
      = 64, mlon = 128."<br>
      <br>
      So g is of size 50(timesteps) x 30(levels) x 64(latitudes) x
      128(longitudes)<br>
      <br>
      The key with using smth9 and smth9_Wrap is that the two rightmost
      dimensions of your input array must be latitude and longitude.<br>
      <br>
      So, applying smth9 to your coding:<br>
      (st is dimensioned time x lat x lon)<br>
      <div>st = smth9_Wrap(st, 0.50, &nbsp;0.25, True) ; heavy local
        smoothing, use smth9_Wrap to keep metadata <br>
        plot = gsn_csm_contour_map_ce(wks,st(0,{15:45},{250:270}), res)</div>
      <br>
      Hope that helps. If not, or if you have further questions please
      respond to ncl-talk only.<br>
      Adam<br>
      <br>
      On 2/27/14, 1:46 PM, Clark, Brandi L wrote:<br>
    </div>
    <blockquote
cite="mid:21fdebcca0d54d52a8364c912525cd34@BN1PR01MB183.prod.exchangelabs.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} .ms-cui-menu {background-color:#ffffff;border:1px rgb(171, 171, 171) solid;font-family:'Segoe UI WPC', 'Segoe UI', Tahoma, 'Microsoft Sans Serif', Verdana, sans-serif;font-size:11pt;color:rgb(51, 51, 51);} .ms-cui-menusection-title {display:none;} .ms-cui-ctl {vertical-align:text-top;text-decoration:none;color:rgb(51, 51, 51);} .ms-cui-ctl-on {background-color:rgb(223, 237, 250);opacity: 0.8;} .ms-cui-img-cont-float {display:inline-block;margin-top:2px} .ms-cui-smenu-inner {padding-top:0px;} .ms-owa-paste-option-icon {margin: 2px 4px 0px 4px;vertical-align:sub;padding-bottom: 2px;display:inline-block;} .ms-rtePasteFlyout-option:hover {background-color:rgb(223, 237, 250) !important;opacity:1 !important;} .ms-rtePasteFlyout-option {padding:8px 4px 8px 4px;outline:none;} .ms-cui-menusection {float:left; width:85px;height:24px;overflow:hidden}--></style>
      <div
style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
        <p>I am trying to smooth the surface temperature&nbsp;contours on a
          cylindrical equidistant map of the CESM RCP 8.5 simulation for
          July 2020. I don't understand the documentation on the NCL
          webpage for the function smth9&nbsp;<a moz-do-not-send="true"
            href="http://www.ncl.ucar.edu/Document/Functions/Built-in/smth9.shtml.">http://www.ncl.ucar.edu/Document/Functions/Built-in/smth9.shtml.</a>
          It looks like I will need to use Example 2:<br>
        </p>
        <p style="margin: 10px 0px 20px; padding: 0px; color: #333333;
          font-family: verdana, sans-serif; font-size: 13px;
          line-height: 16px; background-color: #ffffff;">
          Define g(ntim, nlvl, nlat, mlon) where ntim = 50, nlvl = 30,
          nlat = 64, mlon = 128.</p>
        <p style="margin: 10px 0px 20px; padding: 0px; color: #333333;
          font-family: verdana, sans-serif; font-size: 13px;
          line-height: 16px; background-color: #ffffff;">
          The rightmost dimension is to be treated as "cyclic". The user
          should&nbsp;<em>not</em>&nbsp;add a cyclic point for the rightmost
          dimension; it is accounted for internally. All times and
          levels will be smoothed and returned in a new array<em>gsmth</em>.</p>
        <p style="margin: 10px 0px 20px; padding: 0px; color: #333333;
          font-family: verdana, sans-serif; font-size: 13px;
          line-height: 16px; background-color: #ffffff;">
          Note:&nbsp;<em>gsmth</em>&nbsp;will not have any of the attributes or
          coordinate information of the input&nbsp;<em>g</em>. Note: gsmth
          will not have any of the attributes or coordinate information
          of the input g. If this is desired, use the&nbsp;<a
            moz-do-not-send="true"
href="http://www.ncl.ucar.edu/Document/Functions/Contributed/smth9_Wrap.shtml"
            style="margin: 0px; padding: 0px; text-decoration: none;
            color: #852d85;"><strong style="margin: 0px; padding: 0px;">smth9_Wrap</strong></a>function

          instead.</p>
        <pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-size: 13px; line-height: 16px; font-family: courier; border-style: solid; border-width: 0px 0px 15px; border-color: transparent; background-color: #ffffff;">  gsmth = <strong style="margin: 0px; padding: 0px;">smth9</strong>(g, 0.50,  0.25, True) ; heavy local smoothing


I am not sure what the parameters of g represent (<span style="color: #333333; font-family: verdana, sans-serif; font-size: 13px; line-height: 16px; background-color: #ffffff;">ntim, nlvl, nlat, mlon</span>), and I'm not sure what a cyclic point is. 

This is the code for my map, and I realize that the smoothing code is wrong. I just don't know what values to use.

<div>; RCP 8.5 Surface Temperature Plot for year 2020</div><div>; July Monthly Average</div><div>; Cylindrical Equidistant Map</div><div>
</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div><span class="Apple-tab-span" style="white-space: pre;">        </span></div><div>begin</div><div>
</div><div>&nbsp;fname = addfile ("b40.rcp8_5.1deg.007.cam2.h0.2020-07.nc", "r")<span class="Apple-tab-span" style="white-space: pre;">        </span>; read in file from path&nbsp;</div><div>&nbsp; st = fname -&gt;TS</div><div>
</div><div>&nbsp; wks = gsn_open_wks("ps","RCP8.5_ST_2020_Map")</div><div>
</div><div>&nbsp; gsn_define_colormap(wks,"BlAqGrYeOrRe") &nbsp; &nbsp; &nbsp; &nbsp;; choose colormap</div><div>
</div><div>&nbsp; res &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = True &nbsp; &nbsp; ; plot mods desired</div><div>&nbsp;&nbsp;</div><div>&nbsp; res@mpFillOn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;">        </span>= False &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;">                </span> &nbsp; &nbsp; &nbsp; &nbsp;; turn off gray fill</div><div>&nbsp; res@mpOutlineBoundarySets &nbsp; &nbsp; = "geophysicalandusstates"<span class="Apple-tab-span" style="white-space: pre;">        </span>; turn on countries and US states</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; res@cnFillOn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;">        </span> &nbsp;= True &nbsp; &nbsp; <span class="Apple-tab-span" style="white-space: pre;">                        </span>; turn on color fill</div><div>&nbsp; res@cnLinesOn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
 <span cla
ss="Apple-tab-span" style="white-space: pre;">        </span> &nbsp;= False &nbsp; <span class="Apple-tab-span" style="white-space: pre;">                        </span>; turn off contour lines</div><div>&nbsp; res@cnLevelSelectionMode &nbsp; &nbsp; &nbsp; &nbsp;= "ManualLevels"<span class="Apple-tab-span" style="white-space: pre;">                </span>; set label bar manually</div><div>&nbsp; res@cnMinLevelValF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 290 <span class="Apple-tab-span" style="white-space: pre;">                                </span>; sets min temp on label bar &nbsp; &nbsp;&nbsp;</div><div>&nbsp; res@cnMaxLevelValF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 310<span class="Apple-tab-span" style="white-space: pre;">                                        </span>; sets max temp on label bar</div><div>&nbsp; res@cnLevelSpacingF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 0.5<span class="Apple-tab-span" style="white-space: pre;">                                </span> &nbsp; &nbsp;; label bar interval</div><div>&nbsp; res@lbLabelStride <span class="Apple-tab-span" style="whit
 e-space: 
pre;">                        </span> &nbsp;= 10</div><div>&nbsp; res@lbBoxLinesOn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= True<span class="Apple-tab-span" style="white-space: pre;">                                </span>; draw outline around individual colors</div><div>&nbsp; res@gsnSpreadColors<span class="Apple-tab-span" style="white-space: pre;">                        </span> &nbsp;= True<span class="Apple-tab-span" style="white-space: pre;">                                </span>; use full range of colormap</div><div>
</div><div>&nbsp; res@pmTickMarkDisplayMode = "Always"; use NCL default lat/lon labels</div><div>
</div><div>&nbsp; res@gsnAddCyclic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= False &nbsp; &nbsp;; data already has cyclic point</div><div><span class="Apple-tab-span" style="white-space: pre;">                                </span> &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;">                                </span> &nbsp; ; this must also be set for any zoom</div><div>
</div><div>; note that the gsn_csm_*map_ce templates automatically set&nbsp;</div><div>; res@mpLimitMode="LatLon" for you. If you are plotting a different projection,</div><div>; you may have to set this resource.</div><div>
</div><div>&nbsp; res@mpMinLatF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;20 &nbsp; &nbsp; ; range to zoom in on</div><div>&nbsp; res@mpMaxLatF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;40</div><div>&nbsp; res@mpMinLonF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;250</div><div>&nbsp; res@mpMaxLonF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;270</div><div>&nbsp; res@mpCenterLonF <span class="Apple-tab-span" style="white-space: pre;">                </span> &nbsp; = &nbsp;260</div><div>&nbsp;&nbsp;</div><div>&nbsp; g(ntim, nlvl, nlat, mlon)</div><div>&nbsp; gsmth = smth9(g, 0.50, &nbsp;0.25, True) ; heavy local smoothing</div><div>
</div><div>&nbsp; plot = gsn_csm_contour_map_ce(wks,st(0,{15:45},{250:270}), res)</div><div>
</div><div>end&nbsp;</div><div>
</div><div>
</div><div>-Brandi
&#8203;
</div>
</pre>
        <p><br>
        </p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>