Skip to content

Interpolation API #2

@joleroi

Description

@joleroi

@TarekHC

I added an interpolator to the ND data scratch class. Let's us this to discuss/improve it. At the moment you have to add an interpolator manually to the array by calling

nddata.add_linear_interpolator()

this creates a scipy RegularGridInterpolator

http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.RegularGridInterpolator.html

then you can evaluate it using the evaluate method, which has a keyword for the interpolation method. At the moment 'linear' and 'nearest' (these 2 are covered by the scipy RegularGridInterpolator).
The idea was to add more methods to this evaluate function, that call into other interpolators (if we want other methods at all). So you would for example have

hist.add_spline_interpolator()
hist.evaluate(..., method=spline)

An example how the interpolation works is also in https://github.com/joleroi/nddata/blob/master/NDData_demo.ipynb

Do you think that's a good idea?
Do you think we should add the regular grid interpolator by default?

cc @cdeil

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions