API Models#
Models summaries#
- class satlas2.models.models.ExponentialDecay(a: float, tau: float, name: str = 'ExponentialDecay', prefunc: callable | None = None)[source]
Model for an exponential decay
- Parameters:
a (float) – Amplitude of the exponential
tau (float) – Half-life of the exponential
name (str, optional) – Name of the model, by default ‘ExponentialDecay’
prefunc (callable, optional) – Transform function for the input, by default None
- class satlas2.models.models.Polynomial(p: ArrayLike, name: str = 'Polynomial', prefunc: callable | None = None)[source]
Model class for a polynomial response
- Parameters:
p (ArrayLike) – Polynomial coefficients, sorted in increasing order
name (str) – Name of the model
prefunc (callable, optional) – Transform function for the input, by default None
- class satlas2.models.models.SkewedVoigt(A: float, mu: float, FWHMG: float, FWHML: float, skew: float, name: str = 'SkewedVoigt', prefunc: callable | None = None)[source]
Model for a skewed Voigt peak by the error function. Negative skew value is left-skewed, positive skew value is right-skewed.
- Parameters:
A (float) – Amplitude of the peak
mu (float) – Position of the peak
FWHMG (float) – Gaussian FWHM
FWHML (float) – Lorentzian FWHM
skew (float) – Skew of the peak
name (str, optional) – Name of the model, by default ‘SkewedVoigt’
prefunc (callable, optional) – Transform of the input, by default None
- class satlas2.models.models.PiecewiseConstant(values: ArrayLike, bounds: ArrayLike, name: str = 'PiecewiseConstant', prefunc: callable | None = None)[source]
Model class for a PiecewiseConstant response
- Parameters:
values (ArrayLike) – Background values between bounds, starting at -inf
bounds (ArrayLike) – Bounds for background values
name (str, optional) – Name of the model
prefunc (callable, optional) – Transform function for the input, by default None
- class satlas2.models.models.Voigt(A: float, mu: float, FWHMG: float, FWHML: float, name: str = 'Voigt', prefunc: callable | None = None)[source]
Model for a Voigt lineshape
- Parameters:
A (float) – Amplitude of the profile
mu (float) – Position of the peak
FWHMG (float) – Gaussian FWHM of the peak
FWHML (float) – Lorentzian FWHM of the peak
name (str, optional) – Name of the model, by default ‘Voigt’
prefunc (callable, optional) – Transform function of the input, by default None
Methods
Calculate the total FWHM of the profiles, with uncertainty, taking the correlations into account.
- class satlas2.models.hfsModel.HFS(I: float, J: ArrayLike, A: ArrayLike = [0, 0], B: ArrayLike = [0, 0], C: ArrayLike = [0, 0], df: float = 0, fwhmg: float = 50, fwhml: float = 50, name: str = 'HFS', peak: str = 'voigt', peak_kwargs: dict | None = None, N: int | None = None, offset: float = 0, poisson: float = 0, scale: float = 1.0, racah: bool = True, prefunc: callable | None = None)[source]
Initializes a hyperfine spectrum Model with the given hyperfine parameters.
- Parameters:
I (float) – Integer or half-integer value of the nuclear spin
J (ArrayLike) – A sequence of 2 spins, respectively the J value of the lower state and the J value of the higher state
A (ArrayLike, optional) – A sequence of 2 A values, respectively for the lower and the higher state, by default [0, 0]
B (ArrayLike, optional) – A sequence of 2 B values, respectively for the lower and the higher state, by default [0, 0]
C (ArrayLike, optional) – A sequence of 2 C values, respectively for the lower and the higher state, by default [0, 0]
df (float, optional) – The centroid of the spectrum, by default 0
fwhmg (float, optional) – The Gaussian FWHM of the Voigt profile, by default 50
fwhml (float, optional) – The Lorentzian FWHM of the Voigt profile, by default 50
name (str, optional) – Name of the model, by default ‘HFS’
peak (str, optional) – peak function to use, by default ‘voigt’
peak_kwargs (dict, optional) – additional fitting parameters for skew and custom peaks
N (int, optional) – Number of sidepeaks to be generated, by default None
offset (float, optional) – Offset in units of x for the sidepeak, by default 0
poisson (float, optional) – The poisson factor for the sidepeaks, by default 0
scale (float, optional) – The amplitude of the entire spectrum, by default 1.0
racah (bool, optional) – Use individual amplitudes are setting the Racah intensities, by default True
prefunc (callable, optional) – Transformation to be applied on the input before evaluation, by default None
Methods
Calculate the total FWHM of the profiles, with uncertainty, taking the correlations into account.
pos
()Returns the positions of the peaks in MHz in the hyperfine spectrum
Extensive models#
Implementation of the various common Models.
- class satlas2.models.models.ExponentialDecay(a: float, tau: float, name: str = 'ExponentialDecay', prefunc: callable | None = None)[source]#
Bases:
Model
Model for an exponential decay
- Parameters:
a (float) – Amplitude of the exponential
tau (float) – Half-life of the exponential
name (str, optional) – Name of the model, by default ‘ExponentialDecay’
prefunc (callable, optional) – Transform function for the input, by default None
- class satlas2.models.models.PiecewiseConstant(values: ArrayLike, bounds: ArrayLike, name: str = 'PiecewiseConstant', prefunc: callable | None = None)[source]#
Bases:
Model
Model class for a PiecewiseConstant response
- Parameters:
values (ArrayLike) – Background values between bounds, starting at -inf
bounds (ArrayLike) – Bounds for background values
name (str, optional) – Name of the model
prefunc (callable, optional) – Transform function for the input, by default None
- class satlas2.models.models.Polynomial(p: ArrayLike, name: str = 'Polynomial', prefunc: callable | None = None)[source]#
Bases:
Model
Model class for a polynomial response
- Parameters:
p (ArrayLike) – Polynomial coefficients, sorted in increasing order
name (str) – Name of the model
prefunc (callable, optional) – Transform function for the input, by default None
- class satlas2.models.models.SkewedVoigt(A: float, mu: float, FWHMG: float, FWHML: float, skew: float, name: str = 'SkewedVoigt', prefunc: callable | None = None)[source]#
Bases:
Voigt
Model for a skewed Voigt peak by the error function. Negative skew value is left-skewed, positive skew value is right-skewed.
- Parameters:
A (float) – Amplitude of the peak
mu (float) – Position of the peak
FWHMG (float) – Gaussian FWHM
FWHML (float) – Lorentzian FWHM
skew (float) – Skew of the peak
name (str, optional) – Name of the model, by default ‘SkewedVoigt’
prefunc (callable, optional) – Transform of the input, by default None
- class satlas2.models.models.Voigt(A: float, mu: float, FWHMG: float, FWHML: float, name: str = 'Voigt', prefunc: callable | None = None)[source]#
Bases:
Model
Model for a Voigt lineshape
- Parameters:
A (float) – Amplitude of the profile
mu (float) – Position of the peak
FWHMG (float) – Gaussian FWHM of the peak
FWHML (float) – Lorentzian FWHM of the peak
name (str, optional) – Name of the model, by default ‘Voigt’
prefunc (callable, optional) – Transform function of the input, by default None
Implementation of the HFSModel class, currently only supplied with a Voigt profile.
- class satlas2.models.hfsModel.HFS(I: float, J: ArrayLike, A: ArrayLike = [0, 0], B: ArrayLike = [0, 0], C: ArrayLike = [0, 0], df: float = 0, fwhmg: float = 50, fwhml: float = 50, name: str = 'HFS', peak: str = 'voigt', peak_kwargs: dict | None = None, N: int | None = None, offset: float = 0, poisson: float = 0, scale: float = 1.0, racah: bool = True, prefunc: callable | None = None)[source]#
Bases:
Model
Initializes a hyperfine spectrum Model with the given hyperfine parameters.
- Parameters:
I (float) – Integer or half-integer value of the nuclear spin
J (ArrayLike) – A sequence of 2 spins, respectively the J value of the lower state and the J value of the higher state
A (ArrayLike, optional) – A sequence of 2 A values, respectively for the lower and the higher state, by default [0, 0]
B (ArrayLike, optional) – A sequence of 2 B values, respectively for the lower and the higher state, by default [0, 0]
C (ArrayLike, optional) – A sequence of 2 C values, respectively for the lower and the higher state, by default [0, 0]
df (float, optional) – The centroid of the spectrum, by default 0
fwhmg (float, optional) – The Gaussian FWHM of the Voigt profile, by default 50
fwhml (float, optional) – The Lorentzian FWHM of the Voigt profile, by default 50
name (str, optional) – Name of the model, by default ‘HFS’
peak (str, optional) – peak function to use, by default ‘voigt’
peak_kwargs (dict, optional) – additional fitting parameters for skew and custom peaks
N (int, optional) – Number of sidepeaks to be generated, by default None
offset (float, optional) – Offset in units of x for the sidepeak, by default 0
poisson (float, optional) – The poisson factor for the sidepeaks, by default 0
scale (float, optional) – The amplitude of the entire spectrum, by default 1.0
racah (bool, optional) – Use individual amplitudes are setting the Racah intensities, by default True
prefunc (callable, optional) – Transformation to be applied on the input before evaluation, by default None