- 积分
- 1322
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-6-27
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 豆得儿 于 2023-9-19 12:32 编辑
请教一下大家,NSIDC数据格式为y*x,有对应的经纬度数据,参考了ncl官网的例子进行画图,但是画出来不对,请问是哪里有问题呢?另外想请教一下大家用什么方法对NSIDC数据进行插值比较合适
作图脚本如下:
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"
begin
;----------------------get coordinate----------------------------
f1 = addfile("/data/NSIDC_0079/NSIDC0771_LatLon_PS_S25km_v1.0.nc","r") ;读取数据对应经纬度
lat2d = f1->latitude
lon2d = f1->longitude
nlat = 316
nlon = 332
minlon = min(lon2d)
maxlon = max(lon2d)
minlat = min(lat2d)
maxlat = max(lat2d)
;---------------------read data----------------------------------
file1 = "/data/NSIDC_0079/NSIDC-0079_nc/bt_198909_f08_v3.1_s.nc" ;读取海冰数据
fName1 = addfile(file1, "r")
ice = fName1->ice_conc
sic = tofloat(ice)
if (any(isnan_ieee(sic))) then
value = -999.
replace_ieeenan (sic, value, 0)
sic@_FillValue = value
end if
sic!0 = "y"
sic!1 = "x"
sic&y = f1->y
sic&x = f1->x
sic@lat2d = lat2d
sic@lon2d = lon2d
printVarSummary(sic)
;===========作图
wksName = "check_siconc"
wks = gsn_open_wks("png",wksName)
gsn_define_colormap(wks,"WhBlGrYeRe")
res = True ; Plot mods desired.
res@gsnDraw = False
res@gsnFrame = False
res@gsnAddCyclic = False
res@mpDataBaseVersion = "MediumRes"
res@mpFillOn = False
res@mpPerimDrawOrder = "PostDraw"
res@mpProjection = "Stereographic"
res@mpCenterLonF = f1->crs@straight_vertical_longitude_from_pole
res@mpCenterLatF = f1->crs@standard_parallel
res@mpLimitMode = "Corners"
res@mpLeftCornerLatF = lat2d(0,0)
res@mpLeftCornerLonF = lon2d(0,0)
res@mpRightCornerLatF = lat2d(nlat-1,nlon-1)
res@mpRightCornerLonF = lon2d(nlat-1,nlon-1)
res@mpRelativeCenterLon = True ; set a center lon
res@mpCenterLonF = 0. ; center lon
res@mpRelativeCenterLat = True ; set a center lat
res@mpCenterLatF = -90.
res@mpMinLatF = minlat
res@mpMaxLatF = maxlat
res@mpMinLonF = minlon
res@mpMaxLonF = maxlon
res@cnFillMode = "RasterFill"
res@cnLineLabelsOn = False
res@cnFillOn = True
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@gsnAddCyclic = False ; don't add cyclic longitude point
res@tiMainFontHeightF = 0.02
res@lbLabelBarOn = True
res@gsnCenterString = "NSIDC"
res@trGridType = "TriangularMesh"
res@tfDoNDCOverlay = True
res@cnExplicitLabelBarLabelsOn = True
res@cnLevelSelectionMode = "ManualLevels"
res@cnMaxLevelValF = 100.
res@cnMinLevelValF = 0.
res@cnLevelSpacingF = 5.
plot = gsn_csm_contour_map(wks,sic,res)
draw(plot)
frame(wks)
end
海冰数据:
作图结果如下:
|
|