[ncl-talk] Trying to draw circles with different radius in Km around a station
Karin Meier-Fleischer
meier-fleischer at dkrz.de
Thu Feb 8 02:38:51 MST 2018
Hi Soumik,
you can use polymarkers to plot the circles around lat/lon locations.
Have a look at example newcolor_4.ncl at
http://ncl.ucar.edu/Applications/Scripts/newcolor_4.ncl
I've attached an example script using random data for marker size and
lat/lon locations overlayed on filled contour map.
Hope this helps.
-Karin
Am 08.02.18 um 00:55 schrieb Soumik Basu:
> Hello NCL-users,
>
> I am trying to draw circles around a station with different radius.
> For example 50 Km, 100 Km, 150 Km etc.
>
> So, I am wondering if there is any way to do it in NCL.
>
> 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.
>
> Thank you for any help.
>
> Thanks,
> Soumik
>
> --
> --
> “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
>
> **************************************************************************************************
> Dr. Soumik Basu
> Post Doctoral Research Faculty
> International Arctic Research Center, UAF, Fairbanks, AK, USA
> PhD in Atmospheric Sciences
> M.Sc. in Atmospheric Sciences
> Email: suvro05 at gmail.com <mailto:suvro05 at gmail.com>
> website: http://soumikbasu.weebly.com/
>
> ***************************************************************************************************
>
>
> _______________________________________________
> 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/20180208/2ba99d31/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_marker_on_contours.png
Type: image/png
Size: 111815 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180208/2ba99d31/attachment.png>
-------------- next part --------------
begin
f = addfile("$HOME/NCL/NUG/Version_1.0/data/rectilinear_grid_2D.nc","r")
var = f->tsurf(0,:,:)
sizes = ispan(25,65,5)/1000.
colors = (/"gray10","gray20","gray30","gray40","gray50","gray60","gray70","gray80","gray90"/)
nmarker = dimsizes(sizes)
marker_lat = random_uniform( -80, 80,nmarker)
marker_lon = random_uniform(-150,150,nmarker)
wks = gsn_open_wks("png","plot_marker_on_contours")
res = True
res at gsnMaximize = True
res at gsnDraw = False
res at gsnFrame = False
res at cnFillOn = True
res at cnLinesOn = False
res at cnLineLabelsOn = False
res at mpFillOn = False
; res at mpFillDrawOrder = "PreDraw"
; res at mpOutlineDrawOrder = "PostDraw"
plot = gsn_csm_contour_map(wks,var,res)
mkres = True
mkres at gsMarkerThicknessF = 2.0 ; Twice as thick
mkres at gsMarkerIndex = 16 ; Filled dots
mkres at gsMarkerOpacityF = 0.85
do i = 0,nmarker -1
mkres at gsMarkerSizeF = sizes(i)
mkres at gsMarkerColor = colors(i)
; mkres at tfPolyDrawOrder = "PostDraw" ; default is "PostDraw"
mks = unique_string("mks")
plot@$mks$ = gsn_add_polymarker(wks,plot,marker_lon(i),marker_lat(i),mkres)
end do
draw(plot)
frame(wks)
end
More information about the ncl-talk
mailing list