python 白化_基于Python等语言的Kriging、IDW空间插值对比分析

气象水文科研猫公众号交流邮箱:leolovehydrometeor@hotmail.com欢迎投稿&批评指正如有侵权且本公众号未能正确引用原文,请联系删除,谢谢理解、谢谢配合。
犹记得研三那年,中山大学某博士建议我弃用Matlab,转战R语言和Python。故本文将对Matlab的地图白化绝口不提,毕竟当年我真的没搞明白如何利用m_map工具箱。

1 我的m_map学习成果:

注:我未能学到精髓,不敢班门弄斧耍大刀。

34baf14f2778c782c97bf74bc9e30af0.png


2 MeteoInfo的idw插值:

注:MeteoInfo的Kriging模块尚未添加。

fn = 'F:/RMeteoInfo/data/AQI3.txt'ncol = numasciicol(fn)nrow = numasciirow(fn)a = asciiread(fn,shape=(nrow,ncol))lon = a[:,0]lat = a[:,1]pm= a[:,2]x = arange(113, 120, 0.05)y = arange(36, 43, 0.05)gtemp,gx,gy = griddata((lon, lat), pm, xi=(x, y), method='idw', radius=1.6)#Plotaxesm()bou1_layer = shaperead('F:/Rpeng/31/data3/bound/bound.shp')mlayer = shaperead('F:/Rpeng/31/data3/bound/bound.shp')geoshow(bou1_layer, edgecolor='lightgray')geoshow(mlayer, visible=False)levs = [0, 25, 35, 50, 75, 95, 115, 130, 150,200]cols = [(255,255,255),(0,255,0),(127,255,0),(255,255,0),(255,215,0),(255,128,0),(255,97,0),(255,0,0),(176,23,31),(135,38,87),(255,0,255)]layer = contourfm(x, y, gtemp,levs,colors=cols)slayer = scatterm(lon, lat,pm,levs,colors=cols, size=8)masklayer(mlayer, [layer])xlim(113, 120)ylim(36, 43) colorbar(layer, orientation='horizontal',ticklen=0,extendrect=False, shrink=1, aspect=30)yaxis(tickvisible=False,location='right')xaxis(tickvisible=False,location='top') savefig('F:/RMeteoInfo/plot34.png', dpi=600)
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值