我试图使用 Metpy 和 pyart 绘制来自同一个 nexrad 2 级文件的反射率数据,结果似乎完全不同,特别是,我看到 metapy 和 pyart 计算坐标的方式非常不同:
在 MetPy 中,坐标计算如下:
(from NEXRAD_Level_2_File sample)
xlocs = ref_range * np.sin(np.deg2rad(az[:, np.newaxis]))
ylocs = ref_range * np.cos(np.deg2rad(az[:, np.newaxis]))
在pyart中,计算如下:
(antenna_to_cartesian method called by get_gate_x_y_z in radar.py)
theta_e = elevations * np.pi / 180.0 # elevation angle in radians.
theta_a = azimuths * np.pi / 180.0 # azimuth angle in radians.
R = 6371.0 * 1000.0 * 4.0 / 3.0 # effective radius of earth in meters.
r = ranges * 1000.0 # distances to gates in meters.
z = (r ** 2 + R ** 2 + 2.0 * r * R * np.sin(theta_e)) ** 0.5 - R
s = R * np.arcsin(r * np.cos(theta_e) / (R + z)) # arc length in m.
x = s * np.sin(theta_a)
y = s * np.cos(theta_a)
return x, y, z
你能告诉我这里有什么不同吗?