1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/lai/32.contour_land_class.ncl Mon Jan 26 22:08:20 2009 -0500
1.3 @@ -0,0 +1,54 @@
1.4 +;*************************************************
1.5 +; ce_1.ncl
1.6 +;************************************************
1.7 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
1.8 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
1.9 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
1.10 +;************************************************
1.11 +begin
1.12 +;************************************************
1.13 +; read in observed data
1.14 +;************************************************
1.15 + diri = "/fis/cgd/cseg/people/jeff/clamp_data/lai/"
1.16 +; fili = "land_class_0.25deg.nc"
1.17 + fili = "land_class_T42_new.nc"
1.18 + f = addfile(diri+fili,"r")
1.19 + print (f)
1.20 +
1.21 +; y = f->LAND_CLASS(::10,::10) ; for 0.25deg
1.22 +; y = (/ y(::-1,:) /) ; for 0.25deg
1.23 +
1.24 + y = f->LAND_CLASS
1.25 + printVarSummary(y)
1.26 +
1.27 + y = where(y.eq.0,y@_FillValue,y)
1.28 +
1.29 + printVarSummary(y)
1.30 + print (min(y)+"/"+max(y))
1.31 +;************************************************
1.32 +; create default plot
1.33 +;************************************************
1.34 + wks = gsn_open_wks("ps","xy") ; open a ps file
1.35 + gsn_define_colormap(wks,"gui_default") ; choose colormap
1.36 +
1.37 + res = True ; Use plot options
1.38 + res@cnFillOn = True ; Turn on color fill
1.39 + res@gsnSpreadColors = True ; use full colormap
1.40 +; res@cnFillMode = "RasterFill" ; Turn on raster color
1.41 +; res@lbLabelAutoStride = True
1.42 + res@cnLinesOn = False ; Turn off contourn lines
1.43 + res@mpFillOn = False ; Turn off map fill
1.44 + res@tiMainString = "MODIS LAND CLASS T42"
1.45 +
1.46 + res@gsnSpreadColors = True ; use full colormap
1.47 + res@cnLevelSelectionMode = "ManualLevels" ; Manual contour invtervals
1.48 + res@cnMinLevelValF = 1. ; Min level
1.49 + res@cnMaxLevelValF = 19. ; Max level
1.50 + res@cnLevelSpacingF = 1. ; interval
1.51 + pres = True ; panel plot mods desired
1.52 + pres@gsnMaximize = True ; fill the page
1.53 +
1.54 + plot = gsn_csm_contour_map_ce(wks,y,res) ; for observed
1.55 + gsn_panel(wks,plot,(/1,1/),pres) ; create panel plot
1.56 + system("convert xy.ps xy.png")
1.57 +end
1.58 \ No newline at end of file