代码如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl"
load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/wind_rose.ncl"
begin
dir=("./DATA/")
fi=addfile(dir+"./CAL_LID_L2_VFM-ValStage1-V3-01.2007-02-06T16-29-28ZN.hdf","r")
lat
= fi->Latitude(:,:)
lon = fi->Longitude(:,:)
time =
fi->Profile_UTC_Time(:,:)
aerosol =
fi->Feature_Classification_Flags(:,:)
aerosol@units
="categroy"
wks = gsn_open_wks("png","gsn_contour") ; open a ps
file
gsn_define_colormap(wks,"rainbow")
res =
True
res@gsnMaximize = True
res@gsnLeftString =
"Vertical Feature Mask"
res@tiYAxisString = " Altitude
(km)"
res@tiYAxisFontHeightF = 0.02
res@cnLinesOn =
False
res@cnFillOn = True
res@cnFillMode =
"RasterFill" ; Much faster!
res@gsnAddCyclic =
False
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels
= (/0,1,2,3,4,5,6/)
res@gsnSpreadColors =
True
res@gsnSpreadColorStart = 1
res@gsnSpreadColorEnd = -3 ; don't
include gray or white at end
;---Tickmark resources
latstep
= 10
res@tmXBMode = "Explicit"
res@tmXBValues
= lat(::latstep)
res@tmXBLabels =
sprintf("%5.2f",lat(::latstep)) + "~C~" + \
sprintf("%5.2f",lon(::latstep))
;---Tickmark
resources
res@lbOrientation = "Vertical"
res@lbLabelAlignment =
"BoxCenters" ; Default is "InteriorEdges"
res@lbLabelAutoStride =
True
res@lbLabelFontHeightF = 0.015
res@lbLabelStrings = (/"Not
Determined","Clean Marine","Dust","Polluted Continental",\
"Clean Continental","Polluted Dust","Smoke","Other"/)
plot =
gsn_csm_contour(wks,aerosol(:,:),res) ; Draw a contour plot.
end