timholy / Grid.jl

Interpolation and related operations on grids
MIT License
47 stars 26 forks source link

CoordInterpGrid: specify location and scale of coordinates #14

Closed simonbyrne closed 10 years ago

simonbyrne commented 10 years ago

This adds the ability to specify location and scale of an interpolation: see discussion on mailing list.

One-dimensional usage simply requires specifying the range as first argument:

x = -1.0:0.1:1.0
z = sin(x)

cg = CoordInterpGrid(x,z,BCnil,InterpQuadratic)

Multi-dimensional the ranges are specified as a tuple

cg = CoordInterpGrid((x,y),z,BCnil,InterpQuadratic)

Gradient calculations are also supported via valgrad.

timholy commented 10 years ago

First-rate work, @simonbyrne. Many thanks!