Hello.
I am trying to use the wmlabs procedure to plot dot symbols on a
map. I am outputting multiple frames, so gsn_csm_contour_map_ce and
wmlabs are called within a loop. I am following roughly the NCL
sample program weather_sym_4.ncl.
In the first frame, the dots plot at the expected coordinates.
However, in the second frame, the dots plot at completely unexpected
positions. They are still in the same relative positions, but the
scale and origin of the X and Y coordinates have been shifted. In
subsequent frames, the dots remain in the same incorrect positions.
The problem goes away when gsn_csm_map is substituted for
gsn_csm_contour_map_ce. But I need the contour function to show my
data over the base map.
Can anyone tell me what the problem is? Attached is a demo script.
Any input file with gridded data on (lat, lon) coordinates should
work. Thank you.
NCL version = 4.2.0.a034
uname -a output:
Darwin mac56.cdc.noaa.gov 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep
8 17:18:57 PDT 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power
Macintosh powerpc
--Dave A.
CU/CIRES Climate Diagnostics Center (CDC)
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
;-----------------------------------------------------------------------------
;
; Sample program to print dot symbols on top of plots.
;
; 2007-feb-03 By Dave Allured and Brant Liebmann.
; Simplified version to debug problem with dot positions.
;
;-----------------------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
; Parameters.
infile = "/data/bl/rain/grid/na1.daily.2.5.1940-2004.nc"
output = "x11" ; x11=window, ps or eps or epsi=postscript, pdf=PDF
outfile = "dots.example.0203"
; Read input file.
in = addfile (infile, "r")
pgrid = in->precip(1,:,:) ; read a single (lat, lon) array
; Create plot.
print ("Plot setup.")
wks = gsn_open_wks (output, outfile) ; open output file or x11 window
gsn_define_colormap (wks, "testcmap")
res = True ; plot mods desired
res_at_gsnFrame = False ; hold frame to draw dots on top of plot
res_at_cnFillOn = True ; turn on color fill
res_at_cnLinesOn = False ; turn off contour lines
res_at_gsnSpreadColors = True ; choose colors across entire range
res_at_gsnSpreadColorStart = 5
res_at_mpFillOn = False ; turn off gray continents
res_at_gsnMaximize = True ; make figure fit in frame properly
res_at_gsnPaperOrientation = "portrait"
res_at_gsnAddCyclic = False
res_at_mpMinLonF = -120 ; temporary plot boundaries for
res_at_mpMaxLonF = 60 ; diagnosing wmlabs() dot problem
res_at_mpMinLatF = -80
res_at_mpMaxLatF = 80
res_at_mpCenterLonF = (res_at_mpMinLonF + res_at_mpMaxLonF) / 2
res_at_mpOutlineBoundarySets = "geophysicalandusstates"; turn on states
res_at_mpDataBaseVersion = "mediumres" ; select database
res_at_mpDataSetName = "Earth..2"
; Loop for multiple plots for different dates.
do nr = 20, 22
plot = gsn_csm_contour_map_ce (wks, pgrid, res) ; create base plot
wmsetp ("ezf", 1) ; Tell wmap we are using an existing map projection
wmsetp ("DTS", 0.015) ; DoT Size (fraction of screen height)
wmsetp ("DBC", 200) ; Dot Bottom Color index (outer ring)
wmsetp ("DTC", 60) ; Dot Top Color index (main center)
; for solid dot, make DBC = DTC
lats = (/ 18., 28.5, 31. /) ; one or more latitudes
lons = (/ -98., -107.0, -99. /) ; one or more longitudes
wmlabs (wks, lats, lons, "DT") ; draw dot symbols on top of plot
frame (wks) ; print final plot to window or output file
end do
end
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Feb 03 2007 - 21:41:37 MST
This archive was generated by hypermail 2.2.0 : Thu Feb 08 2007 - 14:21:36 MST