0

I have a set of data, U, whose dimension is [ns, ny, nx] in sigma level with units of pressure, and would like to interplate it into another standard pressure level ([nz,ny,nx]) such that I must deal with this issue grid by grid like below:

U2 = np.empty((nz, ny, nx))
for ix in range(NX):
  for iy in range(NY):
    tmp = np.interp(plev_new, plev_old[:,iy,ix] U[:,iy,ix], left=filled_value, right=filled_value)
    U2[:,iy,ix] = tmp

However, I found it very inefficient in dealing with data grid by grid. I think the faster way to do this is parallel in x and y grid. But I always failed to do this in module multiprocessing.

any suggestion for multiprocessing or some other way which is more better or more efficient.

Thank you very much

Jen
  • 339
  • 1
  • 2
  • 12
  • maybe [this](https://stackoverflow.com/questions/21836067/interpolate-3d-volume-with-numpy-and-or-scipy) helps? – Dux Jun 04 '18 at 05:50
  • @dux I am not sure if I totally understand 'RegularGridInterpolator'. In my opinion, I think it's different. What I want is interpolation in one coordinate and than grid by grid but a 3-dimension data. – Jen Jun 04 '18 at 06:24
  • I think I found the solution, https://stackoverflow.com/questions/13488631/fast-interpolation-over-3d-array – Jen Jun 04 '18 at 06:28

0 Answers0