- 积分
- 1017
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-11-28
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
- load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/shapefile_utils.ncl"
- 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/gsn_csm.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
- glon1=fspan(90.25,124.75,70);定义一个浮点型数据,从90-112,分为221个格点
- glat1=fspan(23.75,37.25,28);纬度的设置,注意后面的格点+1
- ; print(glon1)
- ; exit
- glon1!0="lon"
- glon1@long_name="lon"
- glon1@units="degrees_east"
- glon1&lon=glon1
- glat1!0="lat"
- glat1@long_name="lat"
- glat1@units="degrees_north"
- glat1@lat=glat1
- nlat=dimsizes(glat1)
- nlon=dimsizes(glon1)
- data=generate_2d_array(10, 10, 0., 100., 0, (/nlat,nlon/))
- ; printVarSummary(data)
- ; exit
- data!0 = "lat"
- data!1 = "lon"
- data&lat = glat1
- data&lon = glon1
- shp_filename ="D:/GIS/graduation/YangtzeRiverArea/YangtzeRiverArea.shp"
- setfileoption("nc","Format","LargeFile")
- fout =addfile("YZ.nc", "c")
- data_mask = shapefile_mask_data(data,shp_filename,True)
- fout->data_mask=data_mask
- printVarSummary(data_mask)
复制代码 以上内容是根据csdn这位大佬的内容做的改写
https://blog.csdn.net/rqjabc/article/details/111051087?ops_request_misc=&request_id=&biz_id=102&utm_term=NCL%20%E7%BC%96%E5%86%99%E4%B8%AD%E5%9B%BD%E5%8C%BA%E5%9F%9Fnc&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-4-111051087.142^v87^control,239^v2^insert_chatgpt&spm=1018.2226.3001.4187 data=generate_2d_array(10, 10, 0., 100., 0, (/nlat,nlon/)) 代码中的这个部分可以不用改变
要改的地方就是这三个地方
修改完这些就可以得到想要的地形nc文件啦!
|
|