pystellibs.interpolator package

Submodules

pystellibs.interpolator.interpolator module

Base interpolator: a dummy class is derived by the different interpolator schemes

class pystellibs.interpolator.interpolator.BaseInterpolator(osl, *args, **kwargs)[source]

Bases: object

Base class for interpolation

It sets what can be expected as methods during the interpolation calls

Methods

interp(aps, *args, **kwargs)

Interpolation over spectra

interp_other(aps, values, *args, **kwargs)

Interpolation over provided values

interp(aps, *args, **kwargs)[source]

Interpolation over spectra

interp_other(aps, values, *args, **kwargs)[source]

Interpolation over provided values

pystellibs.interpolator.lejeune module

Lejeune interpolator is basically a linear interpolator for a Lejeune grid based spectral library.

This is the simplest interpolator but most commonly used.

It takes care of boundary conditions by imposing limits to extrapolation on a given grid.

class pystellibs.interpolator.lejeune.LejeuneInterpolator(osl, dT_max=0.1, eps=1e-06, *args, **kwargs)[source]

Bases: BaseInterpolator

Interpolation for grid based on the Lejeune library definition

The interpolation is N-D linear in log-temperature, log-gravity, and linear in metallicity Z. Preference is always given to the temperature over the gravity when needed.

This version is translated from Pegase

Attributes:
dT_max: float, optional

If, T2 (resp. T1) is too far from T compared to T1 (resp. T2), i2 (resp. i1) is not used. (see below for namings)

eps: float

temperature sensitivity under which points are considered to have the same temperature

Methods

interp(aps[, weights])

Interpolate spectra

interp_other(aps, other[, weights])

Interpolate other grid values

interp(aps, weights=None, **kwargs)[source]

Interpolate spectra

Parameters:
aps: ndarray

(logT, logg, logZ) sequence. Or appropriately defined similarly to self.osl.get_interpolation_data

weights: ndarray

optional weights of each ap vector to apply during the interpolation

Returns:
s0: ndarray (len(aps), len(l0))

interpolated spectra

interp_other(aps, other, weights=None, **kwargs)[source]

Interpolate other grid values

Basically do a weighted sum on the grid using the interpolation weights

Parameters:
aps: ndarray

(logT, logg, logZ) sequence. Or appropriately defined similarly to self.osl.get_interpolation_data

weights: ndarray

optional weights of each ap vector to apply during the interpolation

Returns:
interpolated: ndarray (size(node_weights), )

interpolated values

pystellibs.interpolator.ndlinear module

N-D linear interpolation

class pystellibs.interpolator.ndlinear.NDLinearInterpolator(osl, *args, **kwargs)[source]

Bases: BaseInterpolator

Methods

interp(aps[, weights])

Interpolate spectra

interp_other(aps, values, **kwargs)

Interpolate on other values

interp(aps, weights=1.0, **kwargs)[source]

Interpolate spectra

interp_other(aps, values, **kwargs)[source]

Interpolate on other values

Module contents

pystellibs.interpolator.find_interpolator(name, osl=None, **kwargs)[source]
Find an interpolator from its name and

instanciate it if an osl was provided

Parameters:
name: str

name of the interpolation

osl: Stellib instance, optional

library to work with