mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Interpolation

Various tools for interpolating data and discrete functions.

Classes

struct  mx::math::gsl_interp_linear< _realT >
 GSL Linear Interpolation. More...
 
struct  mx::math::gsl_interp_steffen< _realT >
 GSL Steffen Interpolation. More...
 
class  mx::math::gslInterpolator< interpT >
 Class to manage interpolation using the GSL interpolation library. More...
 
class  mx::math::logInterpolator< realT >
 Interpolate a function in log space. More...
 

Modules

 Image Transforms
 

Functions

template<typename realT >
int mx::math::gsl_interpolate (const gsl_interp_type *interpT, realT *xin, realT *yin, size_t Nin, realT *xout, realT *yout, size_t Nout)
 Interpolate a 1-D data X vs Y discrete function onto a new X axis. More...
 
template<typename realT >
int mx::math::gsl_interpolate (const gsl_interp_type *interpT, std::vector< realT > &xin, std::vector< realT > &yin, std::vector< realT > &xout, std::vector< realT > &yout)
 Interpolate a 1-D data X vs Y discrete function onto a new X axis (vector version) More...
 

Function Documentation

◆ gsl_interpolate() [1/2]

template<typename realT >
int mx::math::gsl_interpolate ( const gsl_interp_type *  interpT,
realT *  xin,
realT *  yin,
size_t  Nin,
realT *  xout,
realT *  yout,
size_t  Nout 
)

Interpolate a 1-D data X vs Y discrete function onto a new X axis.

Parameters
interpTone of the gsl interpolation types.
[in]xinthe input x-axis
[in]yinthe input y-values
[in]Ninthe size of the input x-y data series
[in]xoutthe desired x-axis
[out]youtthe output interpolated y-values, pre-allocated
[in]Noutthe size of the output x-y axis
Returns
0 on success
-1 on a gsl error.
Todo:
report errors iaw mxlib standard in gsl_interpolate

Definition at line 61 of file gslInterpolation.hpp.

Referenced by mx::astro::astroSpectrum< _spectrumT, freq >::setSpectrum().

◆ gsl_interpolate() [2/2]

template<typename realT >
int mx::math::gsl_interpolate ( const gsl_interp_type *  interpT,
std::vector< realT > &  xin,
std::vector< realT > &  yin,
std::vector< realT > &  xout,
std::vector< realT > &  yout 
)

Interpolate a 1-D data X vs Y discrete function onto a new X axis (vector version)

Parameters
interpTof the gsl interpolation types.
[in]xinthe input x-axis
[in]yinthe input y-values
[in]xoutthe desired x-axis
[out]youtthe output interpolated y-values, does not need to be allocated
Return values

Definition at line 129 of file gslInterpolation.hpp.