oimParam
The oimParam.py module contains the definition of main model parameter class
oimParam
, as well as parameter linkers,
normalizers and interpolators.
Classes:
|
Class of model parameters. |
|
Class to directly link two oimParam. |
|
Class to normalize a list of oimParam |
|
Macro to directly create an oimParamInterpolator |
|
|
|
|
|
Class of model parameters for multiple wavelengths. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Power-law interpolation, i.e. A*(x/x0)**p. |
|
|
|
|
|
|
|
|
|
Interpolates/Calculates a blackbody distribution for different wavelengths for the input temperatures (via Planck's law). |
|
Interpolates/Calculates the stellar flux for distinct wavelengths. |
- class oimodeler.oimParam.oimParam(name=None, value=None, mini=-inf, maxi=inf, description='', unit=Unit(dimensionless), free=True, error=0)
Class of model parameters.
- Parameters:
name (string, optional) – Name of the Parameter. The default is None.
value (float, optional) – Value of the parameter. The default is None.
mini (float, optional) – Mininum value allowed for the parameter. The default is -1*np.inf.
maxi (float, optional) – maximum value allowed for the parameter. The default is np.inf.
description (string, optional) – Description of the parameter. The default is “”.
unit (1 or astropy.unit, optional) – Unit of the parameter. The default is astropy.units.one
- __init__(name=None, value=None, mini=-inf, maxi=inf, description='', unit=Unit(dimensionless), free=True, error=0)
Initialize a new instance of the oimParam class.
- set(**kwargs)
- class oimodeler.oimParam.oimParamLinker(param, operator='add', fact=0)
Class to directly link two oimParam.
- __init__(param, operator='add', fact=0)
- Parameters:
param (oimParam) – the oimParam to link with.
operator (str, optional) – the operator to use Current values available are add or mult. The default is “add”.
fact (float, optional) – the value to add or multiply to tthe linked oimParam. The default is 0.
- Return type:
None.
- property unit
- _setOperator(operator)
- Parameters:
operator (the operator to use for linking the oimParam.) – DESCRIPTION.
- Return type:
None.
- _add(val)
- _mult(val)
- class oimodeler.oimParam.oimParamNorm(params, norm=1)
Class to normalize a list of oimParam
Example : p2 = oimParamNorm([p0,p1)]
The value of p2 will always be 1-p2-p1
- __init__(params, norm=1)
- property unit
- class oimodeler.oimParam.oimInterp(name, **kwargs)
Macro to directly create an oimParamInterpolator
Example :
g = oim.oimGauss(fwhm=oim.oimInterp("wl", wl=[3e-6, 4e-6], values=[2, 8]))
This will create a gaussiand component and remplace the parameter fwhm by an instance of the oimParamInterpolatorWl class (i.e., the wavelength linear interpolator. The custom interpolator the reference to the interpolator need to be added to the
_interpolators
dictionnary.- Parameters:
name (str) – Keyname for the interpolators registered in the _interpolators dictionary.
**kwargs (dict) – Parameters from the create oimParamInterpolator-derived class.
- Variables:
kwargs (dict) – Parameters from the create oimParamInterpolator-derived class.
type (oimParamInterpolator) – A param interpolator contained in the _interpolators dictionary. For the local definition in the oimParam module, strings can be used. To redefine the dictionary elements from outside, use the class variables, otherwise the local definition will be used.
- __init__(name, **kwargs)
- class oimodeler.oimParam.oimParamInterpolator(param, **kwargs)
- __init__(param, **kwargs)
Initialize a new instance of the oimParam class.
- _init(param, **kwargs)
- _interpFunction(wl, t)
- _getParams()
- property params
- class oimodeler.oimParam.oimParamInterpolatorKeyframes(param, **kwargs)
- _init(param, dependence='wl', keyframes=[], keyvalues=[], kind='linear', fixedRef=True, extrapolate=False, **kwargs)
- _interpFunction(wl, t)
- _getParams()
- class oimodeler.oimParam.oimParamMultiWl(param, **kwargs)
Class of model parameters for multiple wavelengths.
Notes
The difference of this class to the interpolators is that there will be no interpolation done, but the parameters will be returned for the different wavelengths, at which they are specified. Will raise an error if there are missing wavelengths.
- _init(param, wl=[], values=[], **kwargs)
- _interpFunction(wl, t)
Returns the parameter’s value for the given wavelength.
- class oimodeler.oimParam.oimParamInterpolatorWl(param, **kwargs)
- _init(param, wl=[], values=[], **kwargs)
- class oimodeler.oimParam.oimParamInterpolatorTime(param, **kwargs)
- _init(param, mjd=[], values=[], **kwargs)
- class oimodeler.oimParam.oimParamCosineTime(param, **kwargs)
- _init(param, T0=0, P=1, values=[0, 1], x0=None, **kwargs)
- _interpFunction(wl, t)
- _getParams()
- class oimodeler.oimParam.oimParamGaussian(param, **kwargs)
- _init(param, dependence='wl', val0=0, value=0, x0=0, fwhm=0, **kwargs)
- _interpFunction(wl, t)
- _getParams()
- class oimodeler.oimParam.oimParamGaussianWl(param, **kwargs)
- _init(param, val0=0, value=0, x0=0, fwhm=0, **kwargs)
- class oimodeler.oimParam.oimParamGaussianTime(param, **kwargs)
- _init(param, val0=0, value=0, x0=0, fwhm=0, **kwargs)
- class oimodeler.oimParam.oimParamMultipleGaussian(param, **kwargs)
- _init(param, dependence='wl', val0=0, values=[], x0=[], fwhm=[], **kwargs)
- _interpFunction(wl, t)
- _getParams()
- class oimodeler.oimParam.oimParamMultipleGaussianWl(param, **kwargs)
- _init(param, val0=0, values=[], x0=[], fwhm=[], **kwargs)
- class oimodeler.oimParam.oimParamMultipleGaussianTime(param, **kwargs)
- _init(param, val0=0, values=[], x0=[], fwhm=[], **kwargs)
- class oimodeler.oimParam.oimParamPolynomial(param, **kwargs)
- _init(param, dependence='wl', order=2, coeffs=None, x0=None, **kwargs)
- _interpFunction(wl, t)
- _getParams()
- class oimodeler.oimParam.oimParamPolynomialWl(param, **kwargs)
- _init(param, order=2, coeffs=None, x0=None, **kwargs)
- class oimodeler.oimParam.oimParamPolynomialTime(param, **kwargs)
- _init(param, order=2, coeffs=None, x0=None)
- class oimodeler.oimParam.oimParamPowerLaw(param, **kwargs)
Power-law interpolation, i.e. A*(x/x0)**p.
- _init(param, dependence, x0, A, p, **kwargs)
- _interpFunction(wl, t)
- _getParams()
- class oimodeler.oimParam.oimParamLinearRangeWl(param, **kwargs)
- _init(param, wlmin=2e-06, wlmax=3e-06, values=[], kind='linear', **kwargs)
- _interpFunction(wl, t)
- _getParams()
- class oimodeler.oimParam.oimParamLinearTemplateWl(param, **kwargs)
- _init(param, wl0=2e-06, dwl=1e-09, f_contrib=1.0, values=[], kind='linear', **kwargs)
- _interpFunction(wl, t)
- _getParams()
- class oimodeler.oimParam.oimParamLinearTemperatureWl(param, **kwargs)
Interpolates/Calculates a blackbody distribution for different wavelengths for the input temperatures (via Planck’s law).
- Parameters:
param (oimParam) – The parameter that is to be calculated/interpolated.
temperature (int or float or numpy.ndarray) – The temperature(s) to be calculated.
- Variables:
temp (oimParam) –
- _init(param: oimParam, temperature: int | float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], **kwargs) None
The subclass’s constructor.
- _getParams()
Gets the parameters of the interpolator.
- _interpFunction(wl: ndarray, t: ndarray)
Calculates a temperature and wavelength dependent blackbody distribution via Planck’s law.
- Parameters:
wl (numpy.ndarray) – Wavelengths [m].
t (numpy.ndarray) – Times.
- Returns:
blackbody_distribution – The star’s flux.
- Return type:
astropy.units.Jy
- class oimodeler.oimParam.oimParamLinearStarWl(param, **kwargs)
Interpolates/Calculates the stellar flux for distinct wavelengths.
- Parameters:
param (oimParam) – The parameter that is to be calculated/interpolated.
temperature (array_like) – The temperature distribution to be calculated at different wavelengths.
distance (int or float) – The distance to the star [pc].
luminostiy (int or float) – The star’s luminosity [Lsun].
**kwargs (dict)
- Variables:
- _init(param: oimParam, temp: int | float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], dist: int | float, lum: int | float, radius: int | float | None = None, **kwargs: Dict) None
The subclass’s constructor.
- property stellar_radius: Unit("m")
Calculates the stellar radius.
- Returns:
stellar_radius – The star’s radius.
- Return type:
astropy.units.m
- property stellar_radius_angular: Unit("mas")
Calculates the parallax from the stellar radius and the distance to the object.
- Returns:
stellar_radius_angular – The parallax of the stellar radius.
- Return type:
astropy.units.mas
Notes
The formula for the angular diameter $ delta = frac{d}{D} $ is used. This produces an output in radians.
- _getParams()
Gets the parameters of the interpolator.
- _calc_spectral_radiance(wl: Unit('m')) ndarray
Calculates a temperature and wavelength dependent blackbody distribution via Planck’s law.
- Parameters:
wl (astropy.units.m) – Wavelengths [m].
- Returns:
blackbody_distribution – The star’s flux.
- Return type:
astropy.units.Jy
- _interpFunction(wl: ndarray, t: ndarray) ndarray
Calculates the stellar flux from its distance and radius and interpolates it to the input wavelengths,
This function is not time dependent.
- Parameters:
wl (numpy.ndarray) – Wavelengths [m].
t (numpy.ndarray) – Times.
- Returns:
stellar_flux – The star’s flux [Jy].
- Return type:
np.ndarray