1

I was trying to plot reflectivity data from a same nexrad level 2 file using both Metpy and pyart, and the result seems to be quite different, especially, I see that metpy and pyart calculate the coordinates very differently:

In MetPy, the coordinates are calculated as:

(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]))

In pyart, it's calculated as:

(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

Can you please tell me what's the difference here?

Dmitriy
  • 3,305
  • 7
  • 44
  • 55
Y Tao
  • 11
  • 1

1 Answers1

3

In MetPy, it's calculating x and y using only what's called "slant range"--that is, range along the path that the radar beam is propagating. In PyART, it's calculating x and y using ground range and accounting for earth curvature and typical beam propagation affects. The two calculations will be very similar for low elevation angles (like the typical 0.5 degree lowest scan for NEXRAD data). For higher elevations, these will lead to vastly different results.

PyART's method is the more accurate approach, and is indeed necessary if you are trying to properly geolocate radar gates on e.g. a map.

DopplerShift
  • 5,472
  • 1
  • 21
  • 20