[ncl-talk] Polymarker on lon/lat grid
Mary Haley
haley at ucar.edu
Thu Oct 16 09:18:44 MDT 2014
Vandhna,
Your plot looks correct to me. You asked for a dot at
lon1 = 177.26
lat1 = -17.45
and that's what you got. Remember that decimal degrees, which is what you
are specifying, are different than degrees minutes seconds type of
degrees. The above two lines translate to roughly 177 15' and 17 27'',
which is what you are seeing.
--Mary
On Wed, Oct 15, 2014 at 4:16 PM, Vandhna Nair <n.vandhna at gmail.com> wrote:
> Hi,
>
> I have used gsn-coordinates to successfully draw a lon/lat grid over an
> island.
>
> However, when I am trying to mark a station location using gsn_polymarker,
> the marker is placed elsewhere. I get the same result using
> gsn_add_polymarker. There is no error message, script runs well - it's just
> that the resultant image is not what I was trying to get.
> Could you please let me know why this is happening, and how the problem
> can be fixed?
>
> My script is copied below, and the resultant image (plus data file) are
> attached.
>
> (NCL 6.1.0 on Ubuntu 12.0.4)
>
> ;--------------------------------------------------
> ; mapgrid_CCAM.ncl
> ;--------------------------------------------------
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> begin
>
> inFile="pr_Fiji_1980.nc" ; Read netCDF file
>
> a = addfile(inFile,"r")
> prc = a->rnd(0,:,:)
>
> lat = a->lat
> lon = a->lon
>
> lon1 = 177.26
> lat1 = -17.45
>
> ;---Start the graphics.
> wks = gsn_open_wks("eps","Fijigrid") ; open an eps file
>
> res = True ; plot mods desired
>
> res at gsnDraw = False ; don't draw yet
> res at gsnFrame = False ; don't advance frame
> res at tiMainString = "CCAM 8 km grid" ; Title
>
> res at mpMinLonF = 177.1 ; set maximum and
> minimum lon lat values
> res at mpMaxLonF = 178.9
> res at mpMinLatF = -18.4
> res at mpMaxLatF = -17.10
>
> mres = True ; set marker resources
> mres at gsMarkerIndex = 16
> mres at gsMarkerColor = "red"
>
> res at pmTickMarkDisplayMode = "Always" ;add tickmark labels
>
> ;---Create map (don't draw it yet)
> map = gsn_csm_map_ce(wks,res)
>
> ;---Add marker
> gsn_polymarker(wks,map,lon1,lat1,mres)
>
> ;---Call function to attach lat/lon lines.
>
> pres = True
> pres at gsnCoordsAsLines = True ; Default is points
> gsn_coordinates(wks,map,prc,pres)
>
> end
>
>
> Thanks,
> Vandhna K.
>
>
> _______________________________________________
> ncl-talk mailing list
> 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/20141016/9414ecde/attachment.html
More information about the ncl-talk
mailing list