0

Hi stackoverflow community,

I gather hourly temperature data from weather stations and I display them on a map per their latitude (array 1) & longitude (array 2) coordinates. They are displayed as text labels but I also converted the array to float values (array 3). Please refer to "Sparse data point" attachment.

What I would like to do interpolate in between the discrete values to create a contour filled map as per "Interpolated data" attachment.

How would I go about to do this?

Many thanks!

Sparse data point Interpolated data

Stephane
  • 31
  • 7
  • This may help you: https://stackoverflow.com/questions/3242382/interpolation-over-an-irregular-grid Try to search for "interpolation on an irregular grid" – Solvalou May 05 '18 at 16:32
  • The good thing about contour plots is that they would do the interpolation for you. So first thing to try is to use `plt.tricontourf`. If that doesn't work, you may interpolate your data first. Both is shown in [this example](https://matplotlib.org/2.1.2/gallery/images_contours_and_fields/tricontour_vs_griddata.html). – ImportanceOfBeingErnest May 05 '18 at 23:53

1 Answers1

0

Thanks both. I actually managed to do it using scipy Rbf function (rbf.readthedocs.io/en/latest). It offered me the best results. Interpolated temperature values

Stephane
  • 31
  • 7