# Which is the best interpolation technique for plotting RHI into a grid?

**URL:** <https://openradar.discourse.group/t/which-is-the-best-interpolation-technique-for-plotting-rhi-into-a-grid/188>\
**Category:** Python\
**Tags:** py-art\
**Created:** [March 1, 2023, 5:30am UTC](https://openradar.discourse.group/t/which-is-the-best-interpolation-technique-for-plotting-rhi-into-a-grid/188 "2023-03-01T05:30:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehzooz](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mehzooz](https://openradar.discourse.group/u/Mehzooz)\
**Post date:** [March 1, 2023, 5:30am UTC](https://openradar.discourse.group/t/which-is-the-best-interpolation-technique-for-plotting-rhi-into-a-grid/188/1 "2023-03-01T05:30:52Z")

</div>

First one is the RHI plot using pyart.graph.RadarDisplay and the second is what i get when I am trying to grid it using the weighting function ‘NEAREST’.

 ![Untitled](https://global.discourse-cdn.com/free1/uploads/openradar/original/1X/0056623ee0e2deced178a798835c91aa01947b77.png)

The data looks to be shrinked and values are not available after 110 kms. Is this a problem with the interpolation? I have used ‘BARNES2’ too but it merges two cloud systems as one and data extends to higher heights when it is not needed.

This is the code used:  
grid = pyart.map.grid\_from\_radars(radar,(200,300,300),  
((0.,20000.),(-125000,0),(-125000,0)),  
weighting\_function=‘nearest’,  
)  
grid  
xg = grid.to\_xarray()  
xg  
xg.DBZH.mean(‘y’).plot(figsize=[15, 5], vmin=-10,  
vmax=60,  
cmap=“pyart\_HomeyerRainbow”)  
plt.ylim([0,8000])

Thank you

---

<div class="post-metadata">

**Author:** ![mgrover1](https://yyz2.discourse-cdn.com/free1/user_avatar/openradar.discourse.group/mgrover1/32/7_2.png) [@mgrover1](https://openradar.discourse.group/u/mgrover1)\
**Post date:** [March 1, 2023, 1:48pm UTC](https://openradar.discourse.group/t/which-is-the-best-interpolation-technique-for-plotting-rhi-into-a-grid/188/2 "2023-03-01T13:48:52Z")

</div>

@Mehzooz I would also check what you are using for your grid extents - it looks like your grid limits are 0 to 20 km in z, and -125 km to 0 in the x/y directions. You would want to increase your x/y extent to capture your desired distance from the radar. One thing to note is that as you get farther from the radar, the radius of influence (ROI) will grow, leading to more smoothing, which could be causing those other issues you raised.

I encourage you to check out the gridding part of our radar cookbook:

[https://projectpythia.org/radar-cookbook/notebooks/foundations/pyart-gridding.html](https://projectpythia.org/radar-cookbook/notebooks/foundations/pyart-gridding.html)

This will explain more/provide code snippets that will help here.
