我正在使用pyproj.Proj将模型和卫星数据转换为公共网格,以便我可以升级模型数据并将其与卫星观测结果进行比较。卫星观测在EASE v2网格中给出,而模型输出在Lambert圆锥形共形投影网格中给出。 (数据集可在此链接中找到:Dataset)。
这是我的尝试:
import numpy as np
import matplotlib.pylab as plt
import netCDF4
import mpl_toolkits.basemap.pyproj as pyproj
# Reading the EASE grid (over Nordic region), given in lon/lat
ease_lon = np.genfromtxt('ease36km_metcoop_lon.txt')
ease_lat = np.genfromtxt('ease36km_metcoop_lat.txt')
# Read model grid, projected x and y values in Cartesian format [m]
test = 'arome_metcoop_test2_5km_20170215_18.nc'
OFF = netCDF4.Dataset(test, mode='r')
xx = OFF.variables['x'][:]
yy = OFF.variables['y'][:]
OFF.close()
xv, yv = np.meshgrid(xx,yy)
EASE = pyproj.Proj("+proj=cea +lat_0=0.0 +lon_0=0.0 +lat_ts=30 +ellps=WGS84 +datum=WGS84")
lcc = pyproj.Proj("+proj=lcc +lat_0=63 +lon_0=15 +lat_1=63 +lat_2=63 +no_defs +R=6.371e+06")
nlon, nlat = pyproj.transform(lcc,EASE, xv, yv)
elon, elat = EASE(ease_lon, ease_lat)
plt.figure()
plt.scatter(nlon, nlat)
plt.hold('on')
plt.scatter(elon,elat)
plt.title('Model grid converted to EASE v2 projection?')
plt.show()
结果图可在此处找到:Scatter plot。 据我了解pyproj.transform函数,它应该将模型lcc网格转换为EASE网格格式?然而,散点图看起来不太合理。