- 积分
- 18480
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-4-16
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
求助:为什么 mask 以后画不出东西了?(程序没有报错)
MASK_INSIDE = False
filename ="C:/Users/dell/Desktop/JGRresponse/code2/data/tibetan/tibetan.shp"
f5 = addfile(filename, "r")
mrb_lon = f5->x
mrb_lat = f5->y
nmrb = dimsizes(mrb_lon)
min_mrb_lat = min(mrb_lat)
max_mrb_lat = max(mrb_lat)
min_mrb_lon = min(mrb_lon)
max_mrb_lon = max(mrb_lon)
; Create new data to mask. Depending on whether you want to
if(MASK_INSIDE) then
data_mask1 = xann3
else
data_mask1 = new(dimsizes(xann3),typeof(xann3),xann3@_FillValue)
copy_VarCoords(xann3,data_mask1)
end if
lat1d = fspan(24,48,33)
lon1d = fspan(63,105,57)
lat1d@units = "degrees_north"
lon1d@units = "degrees_east"
ilt_mn = ind(min_mrb_lat.gt.lat1d)
ilt_mx = ind(max_mrb_lat.lt.lat1d)
iln_mn = ind(min_mrb_lon.gt.lon1d)
iln_mx = ind(max_mrb_lon.lt.lon1d)
ilt1 = ilt_mn(dimsizes(ilt_mn)-1) ; Start of lat box
iln1 = iln_mn(dimsizes(iln_mn)-1) ; Start of lon box
ilt2 = ilt_mx(0) ; End of lat box
iln2 = iln_mx(0) ; End of lon box
if(MASK_INSIDE) then
do ilt=ilt1,ilt2
do iln=iln1,iln2
if(gc_inout(lat1d(ilt),lon1d(iln),mrb_lat,mrb_lon)) then
data_mask1(ilt,iln) = data_mask1@_FillValue
end if
end do
end do
else
do ilt=ilt1,ilt2
do iln=iln1,iln2
if(gc_inout(lat1d(ilt),lon1d(iln),mrb_lat,mrb_lon)) then
data_mask1(ilt,iln) = xann3(ilt,iln)
end if
end do
end do
end if
printVarSummary(data_mask1)
|
-
mask 前
-
mask 后
|