Is there a built in function in pyart to create grid for RHI?

Plotting RHI in a 2D grid in python using pyart is currently my problem. Is it possible or not to do so?

What problem are you running into here? Can you copy/paste the code and the output with the error?

Thank you for replying sir. I wanted to plot an RHI(resolution=50m) data to a cartesian grid. I converted the polar coordinates to cartesian in this code but don’t know how to make a grid and interpolate the data to 100X100 and 500X500 grid. Really appreciate your help sir.

import pyart
import matplotlib.pyplot as plt
import netCDF4
import cartopy.crs as ccrs
import numpy as np
import pandas as pd

radarRHI=pyart.io.read(“C:\Users\Mehzooz Nizar\Downloads\MDV-20180609-121830-RHIVol.nc”)
rang=radarRHI.range[‘data’]
ele=radarRHI.elevation[‘data’]
ele=ele.reshape(-1,1)
rang=rang.reshape(1,-1)
x=rangnp.cos(np.deg2rad(ele))
x=(x/1000)
h=rang
np.sin(np.deg2rad(ele))
h=h/1000
u=radarRHI.fields[‘DBZH’][‘data’]
fig=plt.figure(figsize=(20,10))
plt.contourf(x,h,u,cmap=‘pyart_HomeyerRainbow’,levels=(np.arange(0,41)))
plt.ylim([0,7])
plt.yticks(np.arange(0,7,0.5))
plt.xticks(np.arange(0,121,5))
plt.colorbar()

Can you try gridding using this example?

https://arm-doe.github.io/pyart/examples/mapping/plot_map_one_radar_to_grid.html#sphx-glr-examples-mapping-plot-map-one-radar-to-grid-py

You should be able to grid the RHI the same way you would grid a PPI.

The gridding part of the Radar Cookbook would also help

https://projectpythia.org/radar-cookbook/notebooks/foundations/pyart-gridding.html

Please give those options a try, and let me know if you run into any issues.

thank you sir. I have tried plotting but it only gives a plot of longitude and latitude. I dont know how to projects height as the y axis.


This is what i get when I put the y grid shape to be 1.

Converting RHI data to a grid makes no sense because RHI data has only one fixed angle, and there is no need to convert it to a grid. However, if you want to plot it with geographic coordinates, you can use PyART to create a grid, as shown in this notebook.

1 Like

Thank you for your help sir