- 积分
- 344
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-7-5
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
从官网下载的读取hd5文件的程序,但是出现核心转存问题,不知道是不是内存原因:读取的是OMI数据
详情见下图
;******************************************************************
; hdf5eos_2.ncl
;
; Concepts illustrated:
; - Reading HDF-EOS5 ['he5'] data
; - Looping over variables and selecting 2D variables for panel plot
; - Checking the variable type on the file prior to reading
; - Plotting HE5 data
; - Drawing raster contours
;************************************************
; Basic User input
;************************************************
diri = "E:/study/big sha/create/BC/"
fili = "OMI-Aura_L2-OMAERUV_2013m1129t0614-o49862_v003-2017m0722t040904.SUB.he5"
pltType = "ps"
pltName = "hdf5eos"
; The following were obtained from "ncl_filedump"
varPlt = (/ "AerosolAbsOpticalDepthVsHeight" \
, "AerosolOpticalDepthVsHeight" \
, "AerosolType" \
, "FinalAerosolAbsOpticalDepth"\
, "FinalAerosolOpticalDepth" \
, "UVAerosolIndex" /)
;************************************************
; Import Libraries
;************************************************
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"
;************************************************
; MAIN
;************************************************
begin
;************************************************
; plotting parameters
;************************************************
wks = gsn_open_wks (pltType,pltName) ; open workstation
gsn_define_colormap(wks,"amwg") ; choose colormap
;****************************************************
; Standard contour with a few simple options
;****************************************************
res = True ; plot mods desired
res@gsnDraw = False ; don't draw
res@gsnFrame = False ; don't advance frame
;---This resource not needed in V6.1.0
res@gsnSpreadColors = True
res@cnFillOn = True
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@cnFillMode = "RasterFill" ; faster
res@cnRasterSmoothingOn = True
res@lbLabelAutoStride= True
; following not necessary
res@pmLabelBarHeightF= 0.10 ; slightly smaller than default
res@pmLabelBarOrthogonalPosF = 0.075
res@tiXAxisOffsetYF = 0.15
nPlt = dimsizes(varPlt)
plot = new (nPlt, "graphic")
resP = True
resP@gsnMaximize = True
resP@txString = fili
;****************************************************
; Open file; plot user specified variables
;****************************************************
f = addfile(diri + fili, "r")
vNam = getfilevarnames(f) ; all variables names on the file
;print(vNam)
nVar = dimsizes(vNam)
np = -1
do nv=0,nVar-1 ; loop over all variables
if (any(varPlt.eq.vNam(nv))) then
vType = getfilevartypes(f,vNam(nv))
; 'blind' handle data types
if (vType.eq."float") then
x = f->$vNam(nv)$
else
if (vType.eq."short") then
x = short2flt( f->$vNam(nv)$ )
else
x = byte2flt ( f->$vNam(nv)$ )
end if
end if
printVarSummary(x)
printMinMax(x, True)
np = np+1
plot(np) = gsn_csm_contour_map(wks, x, res)
delete(x) ; size may change next oteration
end if
end do
gsn_panel(wks,plot,(/3,2/),resP) ; now draw as one plot
end
|
|