1

After using the scipy.interpolate.ndgriddata, I get stripes in my data which I don't want. I am unsure why these stripes appear.

This is my code:

x = np.linspace(3, 8, 500) # my new longitude
y = np.linspace(50, 54, 500) # my new latitude
X, Y = np.meshgrid(x, y) # defining new mesh grid

NO2_regrid = scipy.interpolate.ndgriddata((lons_NO2[i][:,:].flatten(),lats_NO2[i][:,:].flatten()), NO2_grid[i][:,:].flatten(), (X, Y), method="linear")

'Un-regridded' or orgininal data (doesn't have stripes)

Regridded data which shows stripes

other regridding dataset which doesn't exhibit stripes

1 Answers1

0

You are using linear interpolation method here. In the data plot which shows stripes I think the very left bottom corner looks all right and then the stripes start.

For me this looks like a linear interpolation between too few points. That's why it doesn't look smooth but rather like stripes. Then there is also a large blank area where they are no datapoints.

Are you sure this is a valid dataset? Either something goes wrong with the regridding of this specific dataset, or it didn't have enough data in the beginning as well.

To investigate your dataset further you could use interpolation method nearest which does not interpolate linear between several points, but plots the value of the closest given point.

lidrariel
  • 79
  • 6
  • The blank area is cloud removal or an area which the satellite didn't cover. When I use nearest interpolation I get the same result with stripes. – Esther Roosenbrand May 27 '19 at 10:12
  • This hints very much in the direction of too few points in the striped area. The un-regridded data figure shows the same dataset, right? I can see only dense data recording in the upper left corner, also a triangle shaped area. It looks well fitting to the nicely regridded triangular area in the blue plot (not knowing the scale of that). I guess there are a few single points not nicely visible in the un-regridded dataset which lead to the stripes after interpolation. You could look at the raw un-regridded data if there are a few single points outside of the dense data recording. – lidrariel May 27 '19 at 10:25
  • If there is only so little data because it was cloud removal or not covered by the sattelite, in my opinion it is fine to exclude this striped area from data analysis because you can not conclude anything for this area from too little amount of data. – lidrariel May 27 '19 at 10:28
  • Yeah, I agree, but removing this data is exactly my problem. – Esther Roosenbrand May 27 '19 at 13:13
  • If you want to keep the data you can point out in the analysis description that this stripe effect is coming from less dense data recording in that area. To remove the data you could restrict the data range of the lons and lats. If you are not familiar with how to remove data here is a nice description what the range [:,:] that you use above means and how to modify it. [use slicing on numpy arrays](https://stackoverflow.com/questions/16815928/what-does-mean-on-numpy-arrays/16816142) – lidrariel May 27 '19 at 13:36