synthesizer.emission_models.utils

A submodule containing utility functions for the emission models.

Functions

synthesizer.emission_models.utils.get_param(param, model, emission, emitter, default=<object object>)[source]

Extract a parameter from a model, emission, and emitter.

The priority of extraction is:
  1. Model (EmissionModel)

  2. Emission (Sed/LineCollection)

  3. Emitter (Stars/Gas/Galaxy)

If we find a string value this should mean the parameter points to another attribute, so we will recursively look for that attribute.

Parameters:
  • param (str) – The parameter to extract.

  • model (EmissionModel) – The model object.

  • emission (Sed/LineCollection) – The emission object.

  • emitter (Stars/Gas/Galaxy) – The emitter object.

  • default (object, optional) – The default value to return if the parameter is not found.

Returns:

value

The value of the parameter extracted from the appropriate object.

Raises:

MissingAttribute – If the parameter is not found in the model, emission, or emitter. This is only raised if no default is passed.

synthesizer.emission_models.utils.get_params(params, model, emission, emitter)[source]

Extract a list of parameters from a model, emission, and emitter.

Missing parameters will return None.

The priority of extraction is:
  1. Model (EmissionModel)

  2. Emission (Sed/LineCollection)

  3. Emitter (Stars/Gas/Galaxy)

Parameters:
  • params (list) – The parameters to extract.

  • model (EmissionModel) – The model object.

  • emission (Sed/LineCollection) – The emission object.

  • emitter (Stars/BlackHoles/Gas/Galaxy) – The emitter object.

Returns:

values (dict)

A dictionary of the values of the parameters extracted from the appropriate object.