cpelley/iris — pull request #13 by bjlittle (2014-04-02 23:36:23+00:00)
Title: Refactor to remove ndindex.

Okay, this is the re-implementation to remove the use of ndindex and exploit the capability of the SciPy _RegularGridInterpolator to perform N-d interploation.

This requires massaging the data such that the dimensions to be interpolated occupy the lower dimensions e.g. given a 4-d (T, Z, Y, X) cube, and we wish to interpolate linearly over dimensions X and Y (not the order), then the cube must be transpose to (X, Y, T, Z), it is then interpolated over given the sample points, and then transposed back to its original dimensional order.

One small caveat that caused no end of grief, is that the dtype of the sample points can influence the dtype of the interpolated result i.e. given the example above, if the cube data is float32, the X and Y point data is float32, but the sample point data is float64, then the interpolated result will be float64.

There are seven outstanding test failures. I'm assuming related to accuracy issues. I've not had the time to track down the root of the problem.

The LinearInterpolator.points method should be made private, but @cpelley will factor this into his PR.