Model Transformations#

Observed Model & Parameters#

Data containers for parameter draws and their corresponding model spectra produced during nested sampling.

class ForMoSA.transform.observed.ObservedParameters(values)[source]#

Bases: object

Parameters drawn from the nested sampling.

Notes

Authors: Allan Denis

Parameters:

values (Mapping[Parameter, float])

values: Mapping[Parameter, float]#
property grid: ObservedParameters#

Grid parameters.

property physics: ObservedParameters#

Non grid parameters.

property global_params: ObservedParameters#

GLobal parameters.

property names: list[str]#

Names of the parameters.

property kinds: list[ParameterKind]#

Parameter kinds of the parameters.

property has_grid: bool#

Whether the parameter has a grid parameter kind.

property has_physics: bool#

Whether the parameter has a physics parameter kind.

property values_by_kind: dict[ParameterKind, float]#

Parameter values by kind.

property values_by_name: dict[str, float]#

Parameter values by name.

property params_by_kind: dict[ParameterKind, float]#

Parameters by kind.

has_name(name)[source]#

Check whether name is present in the parameter names.

Parameters:

name (str) – Name to check

Return type:

bool

Returns:

bool – Whether the name is present in the parameter names

has_kind(kind)[source]#

Check whether kind is present in the parameter kinds.

Parameters:

kind (ParameterKind) – Kind to check

Return type:

bool

Returns:

bool – Whether the name is present in the parameter names

get_name(name)[source]#

Get parameter value according to its name.

Parameters:

name (str) – Name of the parameter

Return type:

float

Returns:

float – Value of the parameter

Notes

Authors: Allan Denis

get_kind(kind)[source]#

Get parameter value according to its kind.

Parameters:

kind (ParameterKind) – Kind of the parameter

Return type:

float

Returns:

float – Value of the parameter

Notes

Authors: Allan Denis

require(*kinds)[source]#

Check that required parameters exist

Parameters:
Return type:

None

Notes

Authors: Allan Denis

class ForMoSA.transform.observed.ObservedModel(wave, flux, res, component=None, scaling='analytic')[source]#

Bases: object

Model drawn from the nested sampling.

Notes

Authors: Allan Denis

Parameters:
wave: ndarray#
flux: ndarray#
res: ndarray | float#
component: ndarray | None = None#
scaling: str = 'analytic'#
property total_flux: ndarray#

Total flux including HC components.

property npts: int#

Number of points.

classmethod from_grid_and_params(grid, params, interp_method='linear')[source]#

Build an instance of ObseredModel from a ModelGrid and an ObservedParameters objects.

Parameters:
  • grid (ModelGrid) – An instance of ModelGrid

  • params (ObservedParameters) – An instance of ObservedParameters

  • interp_method (str) – Interpolation method

Return type:

ObservedModel

Returns:

‘ObservedModel’ – An instance of class ObservedModel

Notes

Authors: Allan Denis

residuals(flux_obs, component_only=False)[source]#

Compute residuals between observation flux and the instance of ObservedModel.

Parameters:
  • flux_obs (ndarray) – Flux of the observations

  • componant_only (bool) – Whether to use only the componant (without the flux) of the instance

  • component_only (bool)

Return type:

ndarray

Returns:

np.ndarray – Residuals

Notes

Authors: Allan Denis

std_residuals(flux_obs)[source]#

Compute the standard deviation of the residuals between observation flux and the instance of ObservedModel.

Parameters:

flux_obs (ndarray) – Flux of the observations

Return type:

float

Returns:

float – Standard deviation of the residuals

Notes

Authors: Allan Denis

copy(**updates)[source]#

Return a modified copy of the ObservedModel.

Parameters:

**updates (Attributes to update)

Return type:

ObservedModel

Returns:

ObservedModel – Copy of ObservedModel

Notes

Authors: Allan Denis

Apply Effects#

Static helpers that apply individual physical and observational effects (radial velocity, v sin i, reddening, scaling, etc.).

class ForMoSA.transform.apply_effects.ApplyPhysicsEffects[source]#

Bases: object

Apply physics effects to a model given parameters.

Notes

Authors: Allan Denis

class ForMoSA.transform.apply_effects.ApplyObservationEffects[source]#

Bases: object

Spectroscopic Effects#

Orchestrates the full chain of physics and observational effects for spectroscopic data.

class ForMoSA.transform.spectroscopic_effects.SpectralEffects[source]#

Bases: object

Physical effects applied to a spectroscopic model.

Notes

Authors: Allan Denis

Photometric Effects#

Orchestrates the full chain of physics and observational effects for photometric data.

class ForMoSA.transform.photometric_effects.PhotometricEffects[source]#

Bases: object

Physical effects applied to a photometric model.

Notes

Authors: Allan Denis