GLAMERDOC++
Gravitational Lensing Code Library
|
Bilinear interpolation class for interpolating from a 2D uniform grid. More...
#include <Tree.h>
Public Member Functions | |
Interpolator (PosType const *x, int Npixels, PosType my_range, PosType *my_center) | |
Interpolator (PosType const *x, int my_Nx, PosType my_range_x, int my_Ny, PosType my_range_y, PosType *my_center) | |
Interpolator (int Npixels, PosType my_range, PosType *my_center, const T *map) | |
PosType | interpolate (T &map) |
PosType | interpolate (PosType *x, T &map) |
reinitializes to a new position | |
PosType | operator() (PosType *x) |
void | test (void) |
Bilinear interpolation class for interpolating from a 2D uniform grid.
Out of bounds points return 0. map is a i dimensional array representing a 2 dimensional map.
Later calls can use interpolator(map) for the same point in the same coordinate system to save time in calculating the indexes.
|
inline |
x | position of point |
Npixels | Number of pixels in one dimension |
my_range | Range of map in same units as x[] |
my_center | Center of map in same units as x[] |
|
inline |
Constructor for case when region is a rectangle and not a square. Array must be indexed i = ix + iy * Nx
x | position of point |
my_Nx | Number of pixels in x dimension |
my_range_x | Range of map in x in same units as x[] |
my_Ny | Number of pixels in y dimension |
my_range_y | Range of map in y in same units as x[] |
my_center | Center of map in same units as x[] |
|
inline |
This constructor takes the map as a pointer to an array of values and stores it. The resulting object can then be used with the () operator as a function. Warning: Be sure to distroy the object before distroying map.
Npixels | Number of pixels in one dimension |
my_range | Range of map in same units as x[] |
my_center | Center of map in same units as x[] |
map | One dimensional array of fundamental type |
|
inline |
reinitializes to a new position
x | position of point |
map | map that supports the [] operator |
|
inline |
Does interpolation of map at point that object was constructed with or last called with. Can use any map type that has a [] operator that returns a PosType.
map | map that supports the [] operator |
|
inline |
Does interpolation of store map at point x. Only for use with the second constructor.