interpolation

class HistParticle(*args, **kwargs)[source]

Bases: InterpolationParticle

n_points()[source]
class Interp(*args, **kwargs)[source]

Bases: InterpolationParticle

linear interpolation for complex number

interp(m)[source]
model_name = 'interp_c'
class Interp1D3(*args, **kwargs)[source]

Bases: InterpolationParticle

Piecewise third order interpolation

interp(m)[source]
model_name = 'interp1d3'
class Interp1DLang(*args, **kwargs)[source]

Bases: InterpolationParticle

Lagrange interpolation

interp(m)[source]
model_name = 'interp_lagrange'
class Interp1DSpline(*args, **kwargs)[source]

Bases: InterpolationParticle

Spline interpolation function for model independent resonance

init_params()[source]
interp(m)[source]
model_name = 'spline_c'
class Interp1DSplineIdx(*args, **kwargs)[source]

Bases: InterpolationParticle

Spline function in index way.

use

min_m: 0.19
max_m: 0.91
interp_N: 8
with_bound: True

for mass range [0.19, 0.91] and 8 interpolation points

The first and last are fixed to zero unless set with_bound: True.

This is an example of \(k\exp (i k)\) for point k.

(Source code, png, hires.png, pdf)

../_images/tf_pwa-amp-interpolation-1.png
init_params()[source]
interp(m)[source]
model_name = 'spline_c_idx'
class InterpHist(*args, **kwargs)[source]

Bases: InterpolationParticle

Interpolation for each bins as constant

interp(m)[source]
model_name = 'interp_hist'
class InterpHistIdx(*args, **kwargs)[source]

Bases: HistParticle

Interpolation for each bins as constant

use

min_m: 0.19
max_m: 0.91
interp_N: 8
with_bound: True

for mass range [0.19, 0.91] and 7 bins

The first and last are fixed to zero unless set with_bound: True.

This is an example of \(k\exp (i k)\) for point k.

(Source code, png, hires.png, pdf)

../_images/tf_pwa-amp-interpolation-2.png
interp(m)[source]
model_name = 'hist_idx'
class InterpL3(*args, **kwargs)[source]

Bases: InterpolationParticle

interp(m)[source]
model_name = 'interp_l3'
class InterpLinearNpy(*args, **kwargs)[source]

Bases: InterpolationParticle

Linear interpolation model from a npy file with array of [mi, re(ai), im(ai)]. Required file: path_of_file.npy, for the path of npy file.

The example is exp(5 I m).

(Source code, png, hires.png, pdf)

../_images/tf_pwa-amp-interpolation-3.png
get_data(**kwargs)[source]
get_point_values()[source]
init_params()[source]
interp(m)[source]
model_name = 'linear_npy'
class InterpLinearTxt(*args, **kwargs)[source]

Bases: InterpLinearNpy

Linear interpolation model from a txt file with array of [mi, re(ai), im(ai)]. Required file: path_of_file.txt, for the path of txt file.

The example is exp(5 I m).

(Source code, png, hires.png, pdf)

../_images/tf_pwa-amp-interpolation-4.png
get_data(**kwargs)[source]
model_name = 'linear_txt'
class InterpSPPCHIP(*args, **kwargs)[source]

Bases: InterpolationParticle

Shape-Preserving Piecewise Cubic Hermite Interpolation Polynomial. It is monotonic in each interval.

(Source code, png, hires.png, pdf)

../_images/tf_pwa-amp-interpolation-5.png
init_params()[source]
interp(m)[source]
model_name = 'sppchip'
class InterpolationParticle(*args, **kwargs)[source]

Bases: Particle

get_amp(data, *args, **kwargs)[source]
get_bin_index(m)[source]
get_point_values()[source]
init_params()[source]
interp(mass)[source]
n_points()[source]
create_sppchip_matrix(points)[source]

matrix to solve f(xi),f(xi+1),f’(xi),f’(xi+1)

do_spline_hmatrix(h_matrix, y, m, idx)[source]
get_matrix_interp1d3(x, xi)[source]
get_matrix_interp1d3_v2(x, xi)[source]
interp1d3(x, xi, yi)[source]
spline_matrix(x, xi, yi, bc_type='not-a-knot')[source]

calculate spline interpolation

spline_x_matrix(x, xi)[source]

build matrix of x for spline interpolation

spline_xi_matrix(xi, bc_type='not-a-knot')[source]

build matrix of xi for spline interpolation solve equation

\[S_i'(x_i) = S_{i-1}'(x_i)\]

and two bound condition. \(S_0'(x_0) = S_{n-1}'(x_n) = 0\)

sppchip(m, xi, y, idx=None, matrix=None)[source]

Shape-Preserving Piecewise Cubic Hermite Interpolation Polynomial. It is monotonic in each interval.

>>> from scipy.interpolate import pchip_interpolate
>>> x_observed = np.linspace(0.0, 10.0, 11)
>>> y_observed = np.sin(x_observed)
>>> x = np.linspace(min(x_observed), max(x_observed)-1e-12, num=100)
>>> y = pchip_interpolate(x_observed, y_observed, x)
>>> assert np.allclose(y, sppchip(x, x_observed, y_observed).numpy())
sppchip_coeffs(xi, y, matrix=None, eps=1e-12)[source]