So I have some data with around a million (r, phi) coordinates, along with their intensities. I want to sample this data in a grid pattern so I can reduce memory used, and plot faster. However I want to sample the data in X,Y as I will be converting the coordinates to (X,Y) coordinates to plot them.
I was thinking I could use a meshgrid to come up with a template I'd like to sample, but I'm stuck on the next step.
I can't seem to find anything useful searching on google or here, but apologies if this is too simple a question!
I'm using numpy and my data is stored as three seperate arrays right now. I was planning to use np.meshgrid and later scipy.interpolate.griddata for interpolation.
r, phi and intensity are all np.arrays with shape (million,)
e.g.
r = array([1560.8, 1560.8003119, 1560.8006238, ..., 3556.831746,
3558.815873 , 3560.8 ])
I started with this;
r = data[:, 0] # radius
phi = data[:, 1] # altitude angle
h2o = data[:, 2] # intensity
x = r * np.sin(phi) # It's a left handed coordinate system
z = r * np.cos(phi)
And for the sampling grid I have got this;
Xscale = np.linspace(min(x), max(x), 1000)
Zscale = np.linspace(min(z), max(z), 1000)
[X, Z] = np.meshgrid(Xscale, Zscale)



