- 积分
- 284
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-9-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我需要处理calipso卫星数据,目前我的ncl code只能画出纬度和高度的图。但是我期望是能同时能画出calipso的地面轨迹和气溶胶垂直分布
这是我写的code,谢谢大家的帮忙
load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
file_name = "CAL_LID_L2_VFM-ValStage1-V3-01.2011-05-20T19-29-59ZD.hdf"
; Read the file.
hdf4_file = addfile(file_name, "r")
; Print information about the file to know what variables and attributes are
; available for plotting.
print(hdf4_file)
; Here, we'll subset -05km to 8.2km (e.g., 1165:5514)
; over latitude approx. 10N to 40N (e.g., 1700:2450)
; and plot altitude vs. latitude.
fcf = hdf4_file->Feature_Classification_Flags
; Subset dataset that latitude value increases monotonically.
; Monotonicity is required by NCL.
lat = hdf4_file->Latitude(1700:2450,0)
profile = fcf(1700:2450,1165:5514) ; -0.5km to 8.2km
size = dimsizes(profile)
; Select the first 3 bit for the feature type. See [2, 3] for dim_gbits.
data2d = dim_gbits(profile, 4, 3, 13, size(1))
; Reshape 2-D data to 3-D for n profiles * y samples.
data3d = reshape(data2d, (/size(0), 15, 290/))
;printVarSummary(data3d)
; Subset horizontally. Variation along longitude (i.e., profile) is very
; small. We'll just pick the first location from each profile.
data_raw = data3d(:,0,:)
levels = (/0.5,1.5,2.5,3.5,4.5,5.5/)
xwks = gsn_open_wks("png", file_name + ".v.ncl") ; open workstation
colormap= (/"white","blue","yellow","red","green","brown","black"/)
gsn_define_colormap(xwks,colormap)
cmap = gsn_retrieve_colormap(xwks)
res = True ; plot mods desired
res@cnFillOn = True ; enable contour fill
res@gsnMaximize = True; make plot large
res@cnLinesOn = False ; turn off contour lines
res@cnLineLabelsOn = False; turn off contour line labels
res@gsnSpreadColors = True ; use the entire color spectrum
res@cnFillMode = "RasterFill" ; faster
res@cnMissingValFillPattern = 0 ; missing value pattern is set to "SolidFill"
res@cnMissingValFillColor = 0; white color for missing values
res@lbLabelAutoStride = True ; ensure no label overlap
res@cnFillColors = cmap
res@tiMainString = "Level 2 CALIOP vertical feature mask aerosol subtype"
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = levels; (/0.5,1.5,2.5,3.5,4.5,5.5/)
res@lbLabelAlignment = "BoxCenters"
res@lbTitleString = "Aerosol subtype"
res@lbOrientation = "vertical" ; vertical label bar
res@lbLabelStrings = (/"no data","1 clean marine","2 dust","3 polluted continental","4 clean continental","5 polluted dust","6 smoke"/)
; Create altitude dataset manually
hgti = ispan(-500, 8170, 30)
hgt = tofloat(hgti) / 1000.0
hgt = hgt(::-1)
hgt@long_name = "Altitude (km)"
hgt@units = "km"
hgt!0 = "hgt"
lat!0 = "lat"
lat@long_name = "Latitude"
lat@units = "degrees_north"
; Select "Cloud" feature type.
data = todouble(data_raw)
;data@long_name = "Feature Type (Bits 10-12) in Feature Classification Flag"
data!0 = "lat"
data!1 = "hgt"
data&lat = lat
data&hgt = hgt
; Transpose data so that x-axis becomes latitude and y-axis becomes altitude.
plot = gsn_csm_contour(xwks, transpose(data(::-1,::-1)),res)
|
-
期望图
-
我自己的结果图
|