爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 22351|回复: 6

[经验总结] NCL获得最大值的经纬度或格点数

[复制链接]
发表于 2014-7-2 17:38:44 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
本帖最后由 黄小仙儿2 于 2014-7-2 17:40 编辑

分享分享:

Find the latitude and longitude location of the maximum value in a two dimensional array.

;---X is a two dimensional array dimensioned lat x londims = dimsizes(X)  
x1d = ndtooned(X)      ; convert 2D array to 1D for use in maxind
inds = ind_resolve(maxind (x1d), dims)    ; convert 1D array back to 2D  
ilat = inds(0,0)        ; select the latitude index where the X array is at its' maximum   
ilon = inds(0,1)        ; select the longitude index where the X array is at its' maximum  
lat_max = X&lat(ilat)   ; insert the latitude index into the lat coordinate variable
lon_max = X&lon(ilon)   ; insert the longitude index into the lon coordinate variable  
print("Maximum value located at "+lat_max+", "+lon_max)


密码修改失败请联系微信:mofangbao
发表于 2014-7-2 19:41:18 | 显示全部楼层
这个已经讨论过了
http://bbs.06climate.com/forum.p ... &extra=page%3D4
呵呵,你和黄小仙嘛关系啊?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-7-3 09:35:53 | 显示全部楼层
longlivehj 发表于 2014-7-2 19:41
这个已经讨论过了
http://bbs.06climate.com/forum.php?mod=viewthread&tid=25354&extra=page%3D4
呵呵, ...

我就是,抢楼抢了特等奖,站长帮我重新弄了个号好久不见啊
密码修改失败请联系微信:mofangbao
发表于 2014-7-11 10:43:55 | 显示全部楼层
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2015-9-17 17:18:41 | 显示全部楼层
mark
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2016-11-21 20:28:49 | 显示全部楼层
{:eb502:}
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2018-9-28 11:56:22 | 显示全部楼层
为什么我用这个求出来不是最大值的位置啊
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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