爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 12029|回复: 0

ncl 站点插值为格点是遇到的问题

[复制链接]

新浪微博达人勋

发表于 2020-10-5 12:18:48 | 显示全部楼层 |阅读模式
3金钱
全国1767个站点的spei插值,插值程序、数据、结果如下。
在插值过程中遇到一写问题。
插值出来的数据出现缺测以及-nan,请问这种情况如何解决。
程序:
begin
dirout = "/home/earth/Lism/program/SPEI/myself_1.0/5_spei/"

f_latlon = addfile("/home/earth/Lism/program/SPEI/myself_1.0/1_LatLon/" + "LatLon.nc", "r")
lat_av = f_latlon->lat
lon_av = f_latlon->lon


f = addfile(dirout + "SPEI_3.nc", "r")
spei = f->spei       ;  [ncl0 | 154] x [ncl1 | 1767]
spei!0 = "month"
spei!1 = "lat"
spei&lat = lat_av
print(spei)
; print(max(spei))
; print(min(spei))
  




;-------------------------插值用的经纬度---------------------------------
nlon              = 140
olon              = new(nlon, "float")    ;中国经度范围73°33′E-135°05′E,这里我设置经度70°-140°
olon!0            = "lon"
olon@long_name    = "lon"
olon@units        = "degrees-east"
olon@_FillValue   = -1000000
olon&lon          = olon
do j = 0, nlon - 1
  olon(j) = 70 + j*0.5
end do

nlat              = 120
olat              = new(nlat, "float")    ;中国纬度范围3°51′N-53°33′N,这里我设置纬度0°-60°
olat!0            = "lat"
olat@long_name    = "lat"
olat@units        = "degrees_north"
olat@_FillValue   = -1000000
olat&lat          = olat
do j = 0, nlat - 1
  olat(j) = 0 + j*0.5
end do

SPEI = new((/154, nlat, nlon/), "float")
do i = 0, 153
  rscan               = (/10, 7, 4, 1/)
  opt                 = False
   
  SPEI(i, : , : )          = obj_anal_ic_Wrap(lon_av ,lat_av, spei(i, : ), olon, olat, rscan, opt)
print(i)
end do

SPEI!0 = "month"
SPEI!1 = "lat"
SPEI&lat = olat
SPEI!2 = "lon"
SPEI&lon = olon

printVarSummary(SPEI)
print(max(SPEI))
print(min(SPEI))
end

数据形式:
Variable: spei
Type: float
Total Size: 1088472 bytes
            272118 values
Number of Dimensions: 2
Dimensions and sizes:   [month | 154] x [lat | 1767]
Coordinates:
            lat: [51.71667..16.16667]
Number Of Attributes: 1
  _FillValue :  9.96921e+36
(0,0)   -0.103644
(0,1)   0.2626499
(0,2)   -0.3318069
(0,3)   -0.2066187
(0,4)   -0.4311405
(0,5)   -0.5097452
(0,6)   0.0303055
(0,7)   0.810435
(0,8)   0.5471534
(0,9)   0.3686806
(0,10)  0.06521988
(0,11)  0.8846506






插值后结果1

插值后结果1

插值后结果2

插值后结果2
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表