time = np.arange(8)
data = np.random.rand(len(lats) * len(lons) * len(alts) * len(time)).reshape((
    len(lats), len(lons), len(alts), len(time)))
axes = lats, lons, alts, time
f = InterpolatingFunction(axes, data)
Python 4D linear interpolation on a rectangular grid