- 积分
- 11831
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-4-26
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本人新手,运用ncl绘制风云卫星2E的AWX格式的数据,这是二进制数据,运用fbindirread读取,另外在国家卫星网上下载到了经纬度对照表,数据的像素大小是512*512的,分辨率是13公里/度。但是绘制出来的图非常不正常,如下图,看上去像是四张重复的,不知道哪里出了问题,希望有接触过的大神们帮我指点迷经,以下是我的代码:
load "$WORKDIR/include/library.ncl"
begin
system("date")
configPath="$WORKDIR/config"
configName="awx.config"
inputfileName = getArgsPara(params,"inputfileName") ;读取AWX数据路径
datafileName = getArgsPara(params,"datafileName") ;读取经纬度对照表数据路径
;*************************************读取数据****************************
fl = getArgsPara(params,"inputfileName")
f = fbindirread(fl,-1,(/512,512/),"integer") ;读取AWX数据
tbb = int2flt(f(:,:)) ; [512] x [512]
f2 = getArgsPara(params,"datafileName") ;读取经纬度对照表数据
latlon2d = fbindirread(f2,-1,(/512,512,2/),"float")
dimlonlat=dimsizes(latlon2d) ;XLONG第一维时间,第二位纬度,第三维精度
nlat=dimlonlat(0)
mlon=dimlonlat(1)
lon2d = latlon2d(:,:,0)
lat2d = latlon2d(:,:,1)
wks = gsn_open_wks("png","/home/suzhou/AWX")
lat2d@units = "degrees_north"
lon2d@units = "degrees_east"
;***********************************设置数据属性****************************
tbb@lat2d = lat2d
tbb@lon2d = lon2d
tbb@units = ""
tbb@long_name = ""
tbb@coordinates = "lat2d lon2d"
tbb@_FillValue = -999.
; ************************************设置配置文件****************************
configFile= configPath+"/"+configName
;等经纬投影经纬度配置
truelat1 = stringtofloat(readParamInfo(configFile,"TRUELAT1"))
truelat2 = stringtofloat(readParamInfo(configFile,"TRUELAT2"))
stdlon = stringtofloat(readParamInfo(configFile,"STDLON"))
;图片大小
imgWidth=stringtofloat(readParamInfo(configFile,"IMGWIDTH"))
imgHeight=stringtofloat(readParamInfo(configFile,"IMGHEIGHT"))
; ;*************************************设置工作台****************************
wks_type = "png"
wks_type@wkWidth = imgWidth ;工作台宽度
wks_type@wkHeight = imgHeight ;工作台高度
res = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnMaximize = True
res@gsnPaperOrientation = "portrait"
res@gsnAddCyclic = False ; regional data
;tfDoNDCOverlay should be set False (default) when lat2d and lon2d are used.
;res@tfDoNDCOverlay = True
res@pmTickMarkDisplayMode = "Always"
;*************************************网格设置****************************
setMapProject(res,truelat1,truelat2,stdlon,lat2d,lon2d,mlon,nlat)
res@mpGridAndLimbOn = False
res@trGridType = "TriangularMesh"
res@cnFillOn = True
res@cnFillMode = "RasterFill"
res@cnLinesOn = False
res@cnLineLabelsOn = False
; 坐标轴属性
res@tmXBOn = False ;坐标刻度隐藏
res@tmXTOn = False
res@tmYLOn = False
res@tmYROn = False
res@tmXBBorderOn = False ;四周边框
res@tmXTBorderOn = False
res@tmYLBorderOn = False
res@tmYRBorderOn = False
;*************************************绘制设置****************************
;图片输出目录
outputPath="/home/suzhou/AWX"
checkOrCreateDir(outputPath)
;产品文件名
outputfileName="FY2E_SEC_IR1_LCN_20160830_0430_AWX"
;创建工作台
wks = gsn_open_wks(wks_type,outputPath+"/"+outputfileName)
plot = gsn_csm_contour_map(wks,tbb,res)
; gsn_define_colormap(wks,cmap)
;叠加shp底图
mapres=True
addEastChinaShpMap(mapres)
chinamap = add_china_map(wks,plot,mapres)
draw(plot)
frame(wks)
myPrint("Save images:"+outputPath+"/"+outputfileName+"."+wks_type+" successfully!")
system("date")
end
|
|