<div dir="ltr"><div><div><div><div><div>NCL has had several requests for 'circle drawing' over a map'. Often, this would be used in combination with 'gc_inout'.<br><br> <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/gc_inout.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/gc_inout.shtml</a><br><br>Example:<br> <a href="http://www.ncl.ucar.edu/Applications/unique.shtml">http://www.ncl.ucar.edu/Applications/unique.shtml</a><br></div> See: Katrina_circle.ncl<br><br>---<br></div>Also, for tracking a moving storm: multiple times & center locations.<br>------------------------------------------------------------------------------------------------<br><br></div>Attached is a beta version of a function , tentatively named: circle_around_geolocation<br><br></div>There is no documentation ... yet. However, the function has internal documentation.<br><br></div>Hopefully, this will be distributed with 6.5 0<br><div><div><br>---------------------------------------------------------------------------------------------------<br><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 8, 2018 at 1:55 PM, Alan Brammer <span dir="ltr"><<a href="mailto:abrammer@albany.edu" target="_blank">abrammer@albany.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"><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.800000190734863px">Flip the lat and lon arguments in gsn_add_polyline function. Almost all the gsn_add functions take longitude before latitude. </span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.800000190734863px">gsn_add_polyline(wks, plot(ii), Rlon(cc,:), </span><span style="color:rgb(0,0,0);font-size:12.800000190734863px;font-family:arial,sans-serif">Rlat(cc,:), </span><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.800000190734863px"> <wbr>plres)</span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 8, 2018 at 3:41 PM, Soumik Basu <span dir="ltr"><<a href="mailto:sbasu@alaska.edu" target="_blank">sbasu@alaska.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"><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>; ******************************<wbr>***<br>; Draw circle<br>;*****************************<wbr>*****<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)<span><br> km2deg = 1/110.57 ; conversion factor: deg ==> km<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></span> Npts = 360 ; # of points at each radii (arbitrary)<span><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>; Plot<br>;*****************************<wbr>********************<br> res <wbr> = True <br><br> res@gsnSpreadColors <wbr> = True <br> res@gsnDraw <wbr> = False ; don't draw<br> res@gsnFrame <wbr> = False <br>; res@gsnPolar <wbr> = "NH"<br><br> res@cnFillOn <wbr> = True <br> res@cnLinesOn <wbr> = False <br> res@cnLevelSelectionMode <wbr> = "ManualLevels" <br> res@cnMinLevelValF <wbr> = 0<br> res@cnMaxLevelValF <wbr> = 30<br> res@cnLevelSpacingF <wbr> = 0.25<br> res@cnLineLabelsOn <wbr> = False<br><br> res@lbLabelStride <wbr> = 0.1 <br> res@lbOrientation <wbr> = "horizontal" ;vertical label bar<br> res@lbLabelBarOn <wbr> = False <br><br> res@tmLabelAutoStride <wbr> = True<br> res@tmXTOn <wbr> = False<br> res@tmYROn <wbr> = False<br><br> res@mpProjection <wbr> = "CylindricalEquidistant" ; choose map projection<br> res@mpLimitMode <wbr> = "LatLon" <br> res@mpMinLatF <wbr> = 60.<br> res@mpMaxLatF <wbr> = 80.<br> res@mpMinLonF <wbr> = 190.<br> res@mpMaxLonF <wbr> = 230.<br> res@mpCenterLonF <wbr> = 210<br> res@mpGeophysicalLineThickness<wbr>F = 1.5<br><br> colors = (/"gray0","gray2","gray10","gr<wbr>ay40","gray50"/)<br><br>;*****************************<wbr>************************<br>; Plot<br>;*****************************<wbr>************************<br><br> wks = gsn_open_wks("x11","extreme_wi<wbr>nd_days_spatial") <br> <br> plot = new(12,graphic) <br>; plot_c = new(12,graphic) <br> <br> gsn_define_colormap(wks,"preci<wbr>p3_16lev") <br><br> do ii = 0,nmon-1<br><br> plot(ii) = gsn_csm_contour_map(wks,wind_e<wbr>xt_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 <wbr> = True<br><br><br> resPanel@gsnPanelFigureStrings = (/"Jan","Feb","Mar","Apr","May<wbr>","June","July","Aug","Sep","<wbr>Oct","Nov","Dec"/)<br> resPanel@gsnPanelFigureStrings<wbr>FontHeightF = 0.012<br> resPanel@gsnPanelFigureStrings<wbr>PerimOn = True<br> resPanel@gsnPanelFigureStrings<wbr>BackgroundFillColor = -1<br><br> resPanel@amJust <wbr> = "BottomRight"<br><br> resPanel@lbLabelBarOn <wbr> = True<br> resPanel@lbOrientation <wbr> = "Vertical"<br> resPanel@lbLabelAutoStride = False<br> resPanel@lbLabelStride = 20<br> resPanel@lbBoxLineThicknessF <wbr> = 0.1<br> resPanel@lbLabelFontThicknessF<wbr> = 1.75<br> resPanel@lbLabelFontHeightF <wbr> = 0.015<br> resPanel@lbBoxLinesOn <wbr> = False<br><br> resPanel@gsnPanelMainString = "Test"<br> <br> gsn_panel(wks,plot,(/4,3/),res<wbr>Panel)<br><br> frame(wks)<br><br> end<br></div><div><br></div>Thanks,<br></div>Soumik<br></div><div class="m_7714606255511475750HOEnZb"><div class="m_7714606255511475750h5"><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><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/Docum<wbr>ent/Functions/Built-in/nggcog.<wbr>shtml</a><span><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><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><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> Nsta = dimsizes(slat) ; # stations<br></span> Nrad = dimsizes(srad) ; # of radii<br> Npts = 100 ; # of points at each radii (arbitrary; eg 360) <br><span><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="m_7714606255511475750m_6951343087976389368HOEnZb"><div class="m_7714606255511475750m_6951343087976389368h5"><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_7714606255511475750m_6951343087976389368m_6367329826906475550m_-3527953815923975900moz-cite-prefix">Am 08.02.18 um 00:55 schrieb Soumik
Basu:<br>
</div>
<blockquote type="cite"><div><div class="m_7714606255511475750m_6951343087976389368m_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_7714606255511475750m_6951343087976389368m_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_7714606255511475750m_6951343087976389368m_6367329826906475550m_-3527953815923975900mimeAttachmentHeader"></fieldset>
<br>
</div></div><span><pre>______________________________<wbr>_________________
ncl-talk mailing list
<a class="m_7714606255511475750m_6951343087976389368m_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_7714606255511475750m_6951343087976389368m_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" 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><br clear="all"><br>-- <br><div class="m_7714606255511475750m_6951343087976389368gmail_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>******************************<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><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></blockquote></div><br></div>