- 积分
- 5576
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-8-12
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
按照2A12资料的介绍,理解了其中水成物应该是两个变量相乘的结果,主要提到的是cluster(nspecies*nfindex*nlayer*ncluster)与clusterScale(nspecies*npixel*nscan)相乘,但是写完脚本运行,总是提示超出的设定的范围,但是反复查过维数和大小没有问题,请教有大神做过这类数据处理吗?
脚本如下: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
; Read file.
file_name = "0720/2A12.20140718.94953.7.HDF"
hdf4_file=addfile(file_name, "r")
; Print metadata information.
print(hdf4_file)
; Read data to plot.
cluster=hdf4_file->cluster
clusterN=hdf4_file->clusterNumber
clusterScale=hdf4_file->clusterScale
freezingHI=hdf4_file->freezingHeightIndex
clusterNumber=byte2flt(clusterN)
freezingHeightIndex=byte2flt(freezingHI)
nlayer=28
nscan=2918
npixel=208
printVarSummary(cluster)
printVarSummary(clusterNumber)
printVarSummary(clusterScale)
printVarSummary(freezingHeightIndex)
; Read lat/lon data.
longitude=hdf4_file->Longitude
latitude=hdf4_file->Latitude
rainwater=new((/nscan,npixel,nlayer/),"float")
printVarSummary(rainwater)
do j=0,nscan-1
do i=0,npixel-1
do z=0,nlayer-1
a=freezingHeightIndex(j,i)
aa=floattoint(a)
b=floattoint(clusterNumber(j,i,2))
bb=floattoint(b)
if((aa.eq.157))
rainwater(z,j,i)=-9999
continue
end if
rainwater(j,i,z)=cluster(bb,z,aa,2)*clusterScale(j,i,2)
delete(a)
delete(b)
end do
end do
end do
;print(max(kk))
; Correct units to follow the CF conventions.
; In the HDF4 file, the attribute values are "degrees".
longitude@units = "degrees_east"
latitude@units = "degrees_north"
xwks=gsn_open_wks("png","rain")
gsn_define_colormap(xwks,"prcp_2")
;plts = new(3,"graphic")
res=True ; plot mods desired
res@gsnDraw = True
res@gsnFrame = True
res@cnFillOn=True ; enable contour fill
res@gsnMaximize=True; make plot large
res@gsnPaperOrientation = "portrait" ; force portrait orientation
res@cnLinesOn=True ; turn off contour lines
res@cnLineLabelsOn = False; turn off contour line labels
res@gsnSpreadColors=True ; use the entire color spectrum
plot=gsn_contour(xwks,rainwater(3,:,:),res)
end
|
-
如何的到2A12水成物垂直分布的数据
-
输出的变量信息,维度反复确认过,但是输出的错误是维数超出?
|