Dear NCL users,
I am trying to do something like in figure "topo_grey.jpg" which I plotted by GMT (Generic Mapping Tools).
The file "Xcamair_contour" come from GMT. I am trying to used the same file to plot cameroon border. Despite multiple modifications of NCL code I am not able to use it and plot what I want.
Thanks for help
Here the NCL script I am using
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;*****************************************************
begin
nlin = 4401
ncol = 2
xca = asciiread("./xcamair_contour",(/nlin,ncol/),"float")
f1 = addfile("./topo.nc","r")
fsd=f1->HT
lat = fsd&lat
lon = fsd&lon
nlat = dimsizes(lat)
;print(nlat)
nlon = dimsizes(lon)
;print(nlon)
;**************************************
; Create plot
;***************************************
wks = gsn_open_wks("ps", "native")
; gsn_define_colormap(wks,"BlGrYeOrReVi200") ; choose color map
; gsn_define_colormap(wks,"BlGrYeOrReVi200")
; i = NhlNewColor(wks,0.7,0.7,0.7) ; add gray to colormap
gsn_define_colormap (wks,"gsltod") ; choose colormap
setvalues wks
"wkColorMap" : "gsltod"
"wkForegroundColor" : (/0.,0.,0./)
"wkBackgroundColor" : (/1.,1.,1./)
end setvalues
res = True ; plot mods desired
res_at_cnFillOn = True ; turn on color
res_at_cnLinesOn = False ; no contour lines
res_at_gsnSpreadColors = True ; use full color map
res_at_cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res_at_cnMinLevelValF = 0. ; set min contour level
res_at_cnMaxLevelValF = 4200 ; set max contour level
res_at_cnLevelSpacingF = 400 ; contour spacing
res_at_gsnSpreadColors = True ; use full color map
res_at_gsnSpreadColorEnd = -3 ; don't use added gray
res_at_lbOrientation ="vertical" ; vertical label bar
res_at_mpDataBaseVersion = "Ncarg4_1" ; use finer database
res_at_pmTickMarkDisplayMode = "Always" ; turn on tickmarks
res_at_gsnAddCyclic = False ; regional data, don't add pt
res_at_mpProjection = "mercator" ; projection
res_at_mpLimitMode = "Corners" ; method to zoom
res_at_mpLeftCornerLatF = min(lat)
res_at_mpLeftCornerLonF = min(lon)
res_at_mpRightCornerLatF = max(lat)
res_at_mpRightCornerLonF = max(lon)
res_at_tfDoNDCOverlay = True ; do not transform data
; res_at_cnLineLabelsOn = True
res_at_cnLineLabelBackgroundColor = "white" ; white bckgrnd around label
res_at_cnLineLabelDensityF = 1.0
res_at_cnLevelSpacingF = 400
res_at_tiMainString ="TOPOGRAPHY"
plot = gsn_csm_contour_map(wks,fsd(0,:,:),res) ; create plot
end
---------------------------------
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2.2.0 : Tue Nov 27 2007 - 07:07:11 MST