All-
I am having trouble getting my station data to conform to the projection I
am using. I can use the gsn_add_text function to overlay numbers, but when I
contour the data, the data are shifted relative to the map (looks more like
"triangularmesh" assumes the grid is a rectangle, than actually transforming
the lat-lon locations to match the LambertConformal projection).
Perhaps an alternative is to use rgrid2rcm?
jimmyc
below is the relevant code.
wks = gsn_open_wks("ps" ,"freq") ; ps,pdf,x11,ncgm,eps
gsn_define_colormap(wks ,"BlAqGrYeOrReVi200"); choose colormap
res = True ; plot mods desired
res_at_gsnMaximize = True ; uncomment to maximize size
res_at_gsnSpreadColors = True ; use full range of colormap
res_at_cnFillOn = True ; color plot desired
res_at_cnLinesOn = False ; turn off contour lines
res_at_cnLineLabelsOn = False ; turn off contour labels
res_at_lbLabelAutoStride = True ; let NCL figure lb stride
res_at_cnLevelSelectionMode = "ExplicitLevels" ; explicit [unequal] cn
levels
res_at_cnLevels = (/10,20,30,40,50,60,70,80,90/)
;************************************************
; Use WRF_contributed procedure to set map resources
;************************************************
WRF_map_c(f,res,0) ; set map resources
;************************************************
; set True for native mapping (faster plotting)
; set to False othewise
;************************************************
res_at_tfDoNDCOverlay = True
;************************************************
; associate the 2-dimensional coordinates to variables for plotting
; only if res_at_tfDoNDCOverlay=False
;************************************************
if (.not.res_at_tfDoNDCOverlay) then
lat2d = f->XLAT(0,:,:) ; need for map limits
lon2d = f->XLONG(0,:,:)
end if
;************************************************
; allocate array for 3 plots
;************************************************
plot = new (1,"graphic")
;************************************************
lata = f->XLAT(0,:,:)
lona = f->XLONG(0,:,:)
;x2 = 105
;y2 = 80
;x1 = 43
;y1 = 18
x2 = 100
y2 = 85
x1 = 38
y1 = 22
;x2 = 143
;y2 = 118
;x1 = 10
;y1 = 10
res_at_mpRightCornerLonF = lona(y2,x2)
res_at_mpRightCornerLatF = lata(y2,x2)
res_at_mpLeftCornerLonF = lona(y1,x1)
res_at_mpLeftCornerLatF = lata(y1,x1)
;************************************************
; Tell NCL not to draw or advance frame for individual plots
;************************************************
; res_at_gsnDraw = False ; (a) do not draw
; res_at_gsnFrame = False ; (b) do not advance 'frame'
res_at_trGridType = "TriangularMesh" ; The default if you
; have 1D data
res_at_sfXArray = lon
res_at_sfYArray = lat
print(res)
res_at_gsnLeftString ="CAPE 500 J kg-1"
;plot(0) = gsn_csm_map(wks,res)
print(cp)
plot = gsn_csm_contour_map(wks,cp,res)
-- James Correia Jr. Post Doc Climate Physics Group, PNNL
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 22 2008 - 12:16:32 MDT
This archive was generated by hypermail 2.2.0 : Wed Oct 22 2008 - 13:49:07 MDT