<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I got the first part working but the circles are not showing up in the plot. I used "gsn_add_polyline" to draw the circle. <br></div><br></div>Is it wrong to use gsn_add_polyline for drawing the circle? <br><br></div><div>Here is the plotting part of the code. <br><br>; *********************************<br>; Draw circle<br>;**********************************<br><br>;---One station<br><br>   slat     = 70.192               ; station lat<br>   slon     = -148.477             ; station lon<br>   srad_km  = (/ 50, 100, 150, 200, 250/)*1.0  ; station radii (km)<br>   km2deg   = 1/110.57             ; conversion factor: deg ==> km<br>                                   ; one degree is approximately 110.57 km.<br>   srad_dg  = srad_km*km2deg       ; km ==> deg; nggcog requires degrees<br><br>   Nrad = dimsizes(srad_dg)        ; # of radii<br>   Npts = 360                      ; # of points at each radii (arbitrary)<br><br>   Rlat = new((/Nrad, Npts/), "float")    ; lat at each radius<br>   Rlon = new((/Nrad, Npts/), "float")<br><br>   do nr=0,Nrad-1<br>      print("nr="+nr+" srad_km="+srad_km(nr)+";   srad_dg="+srad_dg(nr))<br>      print("")<br><br>      nggcog(slat, slon, srad_dg(nr), Rlat(nr,:), Rlon(nr,:))<br><br>      print(Rlat(nr,:)+"   "+ Rlon(nr,:))<br>      print("========")<br>   end do<br><br>;*************************************************<br>; Plot<br>;*************************************************<br>  res                              = True    <br><br>  res@gsnSpreadColors              = True <br>  res@gsnDraw                      = False                          ; don't draw<br>  res@gsnFrame                     = False     <br>;  res@gsnPolar                     = "NH"<br><br>  res@cnFillOn                     = True               <br>  res@cnLinesOn                    = False  <br>  res@cnLevelSelectionMode         = "ManualLevels"           <br>  res@cnMinLevelValF               = 0<br>  res@cnMaxLevelValF               = 30<br>  res@cnLevelSpacingF              = 0.25<br>  res@cnLineLabelsOn               = False<br><br>  res@lbLabelStride                = 0.1   <br>  res@lbOrientation                = "horizontal"       ;vertical label bar<br>  res@lbLabelBarOn                 = False    <br><br>  res@tmLabelAutoStride            = True<br>  res@tmXTOn                       = False<br>  res@tmYROn                       = False<br><br>  res@mpProjection                 = "CylindricalEquidistant" ; choose map projection<br>  res@mpLimitMode                  = "LatLon" <br>  res@mpMinLatF                    = 60.<br>  res@mpMaxLatF                    = 80.<br>  res@mpMinLonF                    = 190.<br>  res@mpMaxLonF                    = 230.<br>  res@mpCenterLonF                 = 210<br>  res@mpGeophysicalLineThicknessF  = 1.5<br><br>  colors  = (/"gray0","gray2","gray10","gray40","gray50"/)<br><br>;*****************************************************<br>;               Plot<br>;*****************************************************<br><br>  wks = gsn_open_wks("x11","extreme_wind_days_spatial")  <br> <br>  plot   = new(12,graphic)   <br>;  plot_c = new(12,graphic) <br>   <br>  gsn_define_colormap(wks,"precip3_16lev")  <br><br>  do ii = 0,nmon-1<br><br>  plot(ii)   = gsn_csm_contour_map(wks,wind_ext_count_1(ii,:,:),res)<br><br>  do cc = 0,Nrad-1<br><br>  plres = True<br><br>  mks = unique_string("mks")<br><br>  plres@gsLineColor = colors(cc)<br><br>  plot@$mks$ = gsn_add_polyline(wks, plot(ii), Rlat(cc,:), Rlon(cc,:), plres)<br><br>  end do<br><br>  end do<br><br>  resPanel                          = True<br>  resPanel@gsnFrame         = False<br>  resPanel@gsnSpreadColors             = True<br>  resPanel@gsnPanelLabelBar         = True                       ; add color bar<br>  resPanel@gsnMaximize                                      = True<br><br><br>  resPanel@gsnPanelFigureStrings     = (/"Jan","Feb","Mar","Apr","May","June","July","Aug","Sep","Oct","Nov","Dec"/)<br>  resPanel@gsnPanelFigureStringsFontHeightF     = 0.012<br>  resPanel@gsnPanelFigureStringsPerimOn     = True<br>  resPanel@gsnPanelFigureStringsBackgroundFillColor = -1<br><br>  resPanel@amJust                             = "BottomRight"<br><br>  resPanel@lbLabelBarOn                       = True<br>  resPanel@lbOrientation                      = "Vertical"<br>  resPanel@lbLabelAutoStride            = False<br>  resPanel@lbLabelStride             = 20<br>  resPanel@lbBoxLineThicknessF                = 0.1<br>  resPanel@lbLabelFontThicknessF              = 1.75<br>  resPanel@lbLabelFontHeightF                 = 0.015<br>  resPanel@lbBoxLinesOn                       = False<br><br>  resPanel@gsnPanelMainString = "Test"<br>  <br>  gsn_panel(wks,plot,(/4,3/),resPanel)<br><br>  frame(wks)<br><br>  end<br></div><div><br></div>Thanks,<br></div>Soumik<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 8, 2018 at 5:45 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">An alternative:<br><br>nggog can be used. Sample code segments follow. For small radii Npts=100 is fine but for large radii and nice circles, Npts=360 might be better.<span class=""><br><br>;=============================<wbr>==============================<wbr>==============<br>; On a sphere with radius 6371 km, one degree is approximately 110.57 km.<br></span>;---<br>; Of course, the earth is an oblate spheroid:<br>;      <a href="http://www.longitudestore.com/how-big-is-one-gps-degree.html" target="_blank">http://www.longitudestore.com/<wbr>how-big-is-one-gps-degree.html</a><br>;=============================<wbr>==============================<wbr>==============<br>; <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/nggcog.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>nggcog.shtml</a><span class=""><br>;=============================<wbr>==============================<wbr>==============<br><br>;---One station<br><br>   slat     = 0.0                  ; station lat<br>   slon     = 0.0                  ;         lon<br></span>   srad_km  = (/ 50, 100, 150, 5*110.57/)*1.0  ; station radii (km)<br>   km2deg   = 1/110.57             ; conversion factor: deg ==> km<span class=""><br>                              <wbr>     ; one degree is approximately 110.57 km.<br>   srad_dg  = srad_km*km2deg       ; km ==> deg; nggcog requires degrees<br><br>   Nrad = dimsizes(srad_dg)        ; # of radii<br>   Npts = 100                      ; # of points at each radii (arbitrary) <br><br>   Rlat = new((/Nrad, Npts/), "float")    ; lat at each radius<br>   Rlon = new((/Nrad, Npts/), "float")<br><br>   do nr=0,Nrad-1<br>      print("nr="+nr+" srad_km="+srad_km(nr)+";   srad_dg="+srad_dg(nr))<br>      print("")<br><br>      nggcog(slat, slon, srad_dg(nr), Rlat(nr,:), Rlon(nr,:))<br><br>      print(Rlat(nr,:)+"   "+ Rlon(nr,:))<br>      print("========")<br>   end do<br><br></span>++++++++++++++++++++++++++++++<wbr>+++++++++++++++++++++++<br>;---Multiple stations<br><br>   slat     = (/ 0.0, 50.0     /)  ; station lat<br>   slon     = (/ 0.0, 30.0     /)  ;         lon<br>   srad_km  = (/ 50, 100, 150, 5*110.57/)*1.0  ; station radii (km)<br>   km2deg   = 1/110.57                ; conversion factor: deg ==> km<span class=""><br>                                                    ; one degree is approximately 110.57 km.<br>   srad_dg  = srad_km*km2deg   ; km ==> deg; nggcog requires degrees<br>   Nrad     = dimsizes(srad_dg)    ; # of radii<br><br></span><span class="">   Nsta     = dimsizes(slat)            ; # stations<br></span>   Nrad     = dimsizes(srad)          ; # of radii<br>   Npts     = 100                            ; # of points at each radii (arbitrary; eg 360) <br><span class=""><br>   Rlat = new((/Nsta, Nrad, Npts/), "float")    ; lat at each radius<br>   Rlon = new((/Nsta, Nrad, Npts/), "float")<br><br>   do ns=0,Nsta-1<br>     do nr=0,Nrad-1<br></span>        nggcog(slat(ns), slon(ns), srad(nr), Rlat(ns,nr,:), Rlon((ns,nr,:))<br>     end do<br>   end do<br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 8, 2018 at 2:38 AM, Karin Meier-Fleischer <span dir="ltr"><<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi Soumik,<br>
    <br>
    you can use polymarkers to plot the circles around lat/lon
    locations. Have a look at example newcolor_4.ncl at <a href="http://ncl.ucar.edu/Applications/Scripts/newcolor_4.ncl" target="_blank">http://ncl.ucar.edu/Applicatio<wbr>ns/Scripts/newcolor_4.ncl</a><br>
    <br>
    I've attached an example script using random data for marker size
    and lat/lon locations overlayed on filled contour map.<br>
    <br>
    Hope this helps.<br>
    <br>
    -Karin<br>
    <br>
    <div class="m_6367329826906475550m_-3527953815923975900moz-cite-prefix">Am 08.02.18 um 00:55 schrieb Soumik
      Basu:<br>
    </div>
    <blockquote type="cite"><div><div class="m_6367329826906475550h5">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>Hello NCL-users,<br>
                <br>
              </div>
              I am trying to draw circles around a station with
              different radius. For example 50 Km, 100 Km, 150 Km etc. <br>
              <br>
              So, I am wondering if there is any way to do it in NCL. <br>
              <br>
              I looked at the "nggcog" function but from the description
              what I understand is that it can draw circles along a
              great circle only not according to a given distance. <br>
              <br>
            </div>
            Thank you for any help. <br>
            <br>
          </div>
          Thanks,<br>
        </div>
        Soumik<br clear="all">
        <div>
          <div>
            <div>
              <div>
                <div><br>
                  -- <br>
                  <div class="m_6367329826906475550m_-3527953815923975900gmail_signature">
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div>-- </div>
                          “We’ve all got both light and dark inside us.
                          What matters is the part we choose to act on.
                          That’s who we really are.” – J.K. Rowling
                          <div><br>
                          </div>
                          <div>******************************<wbr>******************************<wbr>******************************<wbr>********</div>
                          <div>Dr. Soumik Basu</div>
                          <div>Post Doctoral Research Faculty</div>
                          <div><span style="font-size:12.8px">International
                              Arctic Research Center, UAF, Fairbanks,
                              AK, USA</span></div>
                          <div><span style="font-size:12.8px">PhD in
                              Atmospheric Sciences</span><br>
                          </div>
                          <div>M.Sc. in Atmospheric Sciences</div>
                          <div>Email: <a href="mailto:suvro05@gmail.com" target="_blank">suvro05@gmail.com</a></div>
                          <div>website: <a href="http://soumikbasu.weebly.com/" target="_blank">http://soumikbasu.weebly.com/</a></div>
                          <div><br>
                          </div>
                          <div>******************************<wbr>******************************<wbr>******************************<wbr>*********</div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="m_6367329826906475550m_-3527953815923975900mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><span><pre>______________________________<wbr>_________________
ncl-talk mailing list
<a class="m_6367329826906475550m_-3527953815923975900moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="m_6367329826906475550m_-3527953815923975900moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a>
</pre>
    </span></blockquote>
    <br>
  </div>

<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</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><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>-- </div>“We’ve all got both light and dark inside us. What matters is the part we choose to act on. That’s who we really are.” – J.K. Rowling<div><br></div><div>**************************************************************************************************</div><div>Dr. Soumik Basu</div><div>Post Doctoral Research Faculty</div><div><span style="font-size:12.8px">International Arctic Research Center, UAF, Fairbanks, AK, USA</span></div><div><span style="font-size:12.8px">PhD in Atmospheric Sciences</span><br></div><div>M.Sc. in Atmospheric Sciences</div><div>Email: <a href="mailto:suvro05@gmail.com" target="_blank">suvro05@gmail.com</a></div><div>website: <a href="http://soumikbasu.weebly.com/" target="_blank">http://soumikbasu.weebly.com/</a></div><div><br></div><div>***************************************************************************************************</div></div></div></div></div>
</div>