我正在尝试找到 NCL 函数的等效项(如果存在),该函数返回最接近用户指定的纬度/经度坐标对的二维纬度/经度数组的索引。
这是 NCL 函数的链接,我希望在 python 中有一个等价的函数。我怀疑在这一点上没有,所以任何关于如何从纬度/经度坐标获取索引的提示都值得赞赏
https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml
现在,我将坐标值保存到 .nc 文件中,并由以下人员读取:
coords='coords.nc'
fh = Dataset(coords, mode='r')
lons = fh.variables['g5_lon_1'][:,:]
lats = fh.variables['g5_lat_0'][:,:]
rot = fh.variables['g5_rot_2'][:,:]
fh.close()