微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

需要 OPeNDAP 纬度帮助

如何解决需要 OPeNDAP 纬度帮助

我正在尝试为靠近挪威 sauda 的 lwe_percipitation_rate 创建一个小子集,我目前正在努力处理 OPeNDAP 中的坐标系。

latitude_bounds = [57,61]
longitude_bounds = [3.5,7]

lats = d.variables['lat'][:]
lons = d.variables['lon'][:]

#alt1
# latitude lower and upper index
latli = np.argmin( np.abs( lats - latitude_bounds[0] ) )
latui = np.argmin( np.abs( lats - latitude_bounds[1] ) ) 

# longitude lower and upper index
lonli = np.argmin( np.abs( lons - longitude_bounds[0] ) )
lonui = np.argmin( np.abs( lons - longitude_bounds[1] ) ) 

lwe_subset = d.variables['lwe_precipitation_rate'][ :,latli:latui,lonli:lonui ] 

#alt2

lat_inds = np.where((lats > latitude_bounds[0]) & (lats < latitude_bounds[1]))
lon_inds = np.where((lons > longitude_bounds[0]) & (lons < longitude_bounds[1]))


lwe_subset = d.variables['lwe_precipitation_rate'][:,lat_inds,lon_inds]

这是目前我正在使用的两种替代方案,这是我感兴趣的领域: The red square marks the area of interest,close to the specified coordinates

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。