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