如何解决麻烦将曲线插入到直线,WGS84 网格
我得到了一个 ODIM HDF 数据集,其中包含在 0.02 度网格上具有 (2200,1900) 形状的数据,并具有以下“where”组属性:
group: where {
// group attributes:
:projdef = "+proj=laea +lat_0=55.0 +lon_0=10.0 +x_0=1950000.0 +y_0=-2100000.0 +units=m +ellps=WGS84";
:xsize = 1900UL; // ulong
:ysize = 2200UL; // ulong
:xscale = 2000.0; // double
:yscale = 2000.0; // double
:LL_lon = -10.434576838640398; // double
:LL_lat = 31.746215319325056; // double
:UL_lon = -39.5357864125034; // double
:UL_lat = 67.02283275830867; // double
:UR_lon = 57.81196475014995; // double
:UR_lat = 67.62103710275053; // double
:LR_lon = 29.421038635578032; // double
:LR_lat = 31.98765027794496; // double }
从这个数据文件中,我试图在使用 xESMF 重新采样之前使用 pyresample 将其重新投影到直线 EPSG:4326 网格。我已执行以下步骤将数据点插入到纬度/经度网格:
odim_proj = '+proj=laea +lat_0=55.0 +lon_0=10.0 +x_0=1950000.0 +y_0=-2100000.0 +units=m +ellps=WGS84'
odim_def = pyresample.geometry.AreaDefinition.from_extent('odim',odim_proj,[2200,1900],[-39.5357864125034,31.746215319325056,67.62103710275053],'degrees')
target_proj = '+proj=latlong +lat_0=55.0 +lon_0=10.0 +ellps=WGS84 +datum=WGS84 +no_defs'
target_area = pyresample.geometry.AreaDefinition.from_extent('target',target_proj,67.62103710275053])
# Attempt to get the correct lats/lons from the original projection
odim_pts = np.stack([odim_def.get_lonlats()[0].ravel(),odim_def.get_lonlats()[1].ravel()],axis=1)
# Now for the target projection
target_pts = np.stack([target_area.get_lonlats()[0].ravel(),target_area.get_lonlats()[1].ravel()],axis=1)
# Join the lats/lons to the data points by interpolating with Scipy
interp = griddata(target_pts,data1['data'][:].flatten(),target_pts,method='nearest',fill_value=np.nan)
# Stick them and the 2D slices of lats/lons from the target area into a Dataset...
ds_rate = xr.Dataset({'RATE': (('lat','lon'),interp.reshape((2200,1900)))},coords={'lon': (('lon'),target_area.get_lonlats()[0][0,:]),'lat': (('lat'),target_area.get_lonlats()[1][:,0])})
这将绘制纬度/经度,但经度关闭,并且将数据拉伸到范围之外。例如,左上角的两个蓝色圆圈应该是在冰岛上空(image of the plot in LCC).
关于如何正确获得这些经纬度点进行插值的任何想法?我以前做过这个,但我得到了纬度/经度网格。我对自己制作它们不太熟悉。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。