- 积分
- 180
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-2-9
- 最后登录
- 1970-1-1
|
发表于 2020-3-13 13:30:10
|
显示全部楼层
楼主好,我按您的代码运行出现如下错误,求指教
BDQS@DESKTOP-97QP3T6 ~
$ ncl QTPmask.ncl
Copyright (C) 1995-2019 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.6.2
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
warning:_NclOpenFile: Can not open file <./DBATP_Polygon.shp>; file format not supported or file is corrupted
warning:getfilevarnames: f is not a valid file variable
fatal:file (f) isn't defined
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 48 in file ./shapefile_utils.ncl
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 11 in file QTPmask.ncl
以下是我的代码
;load "./gsn_code.ncl"
;load "./gsn_csm.ncl"
;load "./contributed.ncl"
load "./shapefile_utils.ncl"
begin
f = addfile("1979.nc", "r") ;//打开NC文件
prcp_temp = f->temp(0,:,:) ;//读取数据
shpfile = "./DBATP_Polygon.shp"
print_shapefile_info(shpfile)
plot_shapefile(shpfile)
opt = True
opt@return_mask = True
opt@shape_var = "W1102WB0_1"
opt@shape_names = "QTP"
land_mask = shapefile_mask_data(prcp_temp,shpfile,opt)
prcp_land_mask = where(land_mask.eq.1,prcp_temp,prcp_temp@_FillValue)
copy_VarMeta(prcp_temp,prcp_land_mask)
pcp = prcp_land_mask
end
|
|