爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 4654|回复: 2

求助:我这有个提取最大风速的脚本,如何得到其对应的坐标点

[复制链接]

新浪微博达人勋

发表于 2017-12-3 12:26:29 | 显示全部楼层 |阅读模式
NCL
系统平台:
问题截图: -
问题概况: 求助:我这有个提取最大风速的脚本,如何得到其对应的坐标点呢
我看过提问的智慧: 看过
自己思考时长(天): 7

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

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

x
求助:我这有个提取最大风速的脚本,只能输出最大风速值,请问大神们如何添加命令可以得到最大风速对应的坐标呢(经纬度)。
a  = addfile("wrfout_d03_2017-08-22_06:00:00.nc","r")
times = wrf_user_getvar(a,"times",-1) ;    get all times in the file
ntimes = dimsizes(times)              ;number of times in the file
do i=0, ntimes-1
u = wrf_user_getvar(a,"U10",i)
v = wrf_user_getvar(a,"V10",i)
uv2d = sqrt(u*u+v*v)
print( i +" : " + max(uv2d))
end do
end

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-12-3 14:22:54 | 显示全部楼层

回帖奖励 +2 金钱

用maxind可以找到极大值点。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-12-3 17:08:47 | 显示全部楼层
御风者 发表于 2017-12-3 14:22
用maxind可以找到极大值点。

感谢解答,请问例子中X是指一个两维阵列,这个阵列是怎么表示呢
dims = 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
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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