synthesizer.emissions.utils

A submodule containing utility functions for working with emission lines.

Functions

synthesizer.emissions.utils.alias_to_line_id(alias)[source]

Convert a line alias to a line id.

Parameters:

alias (str) – The line alias.

Returns:

line_id (str)

The line id.

synthesizer.emissions.utils.combine_list_of_seds(sed_list)[source]

Convert a list of Seds into a single Sed object.

Combines a list of Sed objects (length Ngal) into a single Sed object, with dimensions Ngal x Nlam. Each Sed object in the list should have an identical wavelength range.

Parameters:

sed_list (list) – list of Sed objects

synthesizer.emissions.utils.flatten_linelist(list_to_flatten)[source]

Flatten a mixed list of lists and strings and remove duplicates.

Used when converting a line list which may contain single lines and doublets.

Parameters:

list_to_flatten (list) – list containing lists and/or strings and integers

Returns:

(list)

flattened list

synthesizer.emissions.utils.get_attenuation(intrinsic_sed, attenuated_sed)[source]

Calculate attenuation as a function of wavelength.

Parameters:
  • intrinsic_sed (Sed) – The intrinsic spectra object.

  • attenuated_sed (Sed) – The attenuated spectra object.

Returns:

array-like, float

The attenuation array in magnitudes.

synthesizer.emissions.utils.get_attenuation_at_1500(intrinsic_sed, attenuated_sed)[source]

Calculate rest-frame FUV attenuation at 1500 angstrom.

Parameters:
  • intrinsic_sed (Sed) – The intrinsic spectra object.

  • attenuated_sed (Sed) – The attenuated spectra object.

Returns:

float

The attenuation at rest-frame 1500 angstrom in magnitudes.

synthesizer.emissions.utils.get_attenuation_at_5500(intrinsic_sed, attenuated_sed)[source]

Calculate rest-frame FUV attenuation at 5500 angstrom.

Parameters:
  • intrinsic_sed (Sed) – The intrinsic spectra object.

  • attenuated_sed (Sed) – The attenuated spectra object.

Returns:

float

The attenuation at rest-frame 5500 angstrom in magnitudes.

synthesizer.emissions.utils.get_attenuation_at_lam(lam, intrinsic_sed, attenuated_sed)[source]

Calculate attenuation at a given wavelength.

Parameters:
  • lam (float/array-like, float) – The wavelength/s at which to evaluate the attenuation in the same units as sed.lam (by default angstrom).

  • intrinsic_sed (Sed) – The intrinsic spectra object.

  • attenuated_sed (Sed) – The attenuated spectra object.

Returns:

float/array-like, float

The attenuation at the passed wavelength/s in magnitudes.

synthesizer.emissions.utils.get_composite_line_id_from_list(id)[source]

Convert a list of line ids to a single string describing a composite line.

A composite line is a line that is made up of multiple lines, e.g. a doublet or triplet. This function takes a list of line ids and converts them to a single string.

e.g. [“H 1 4861.32A”, “H 1 6562.80A”] -> “H 1 4861.32A, H 1 6562.80A”

Args
id (list, tuple)

a str, list, or tuple containing the id(s) of the lines

Returns
id (str)

string representation of the id

synthesizer.emissions.utils.get_line_label(line_id)[source]

Get a line label for a given line_id, ratio, or diagram.

Where the line_id is one of several predifined lines in line_labels this label is used, otherwise the label is constructed from the line_id.

Argumnents
line_id (str)

The line_id either as a list of individual lines or a string. If provided as a list this is automatically converted to a single string so it can be used as a key.

Returns
line_label (str)

A nicely formatted line label.

synthesizer.emissions.utils.get_roman_numeral(number)[source]

Convert an integer into a roman numeral str.

Used for renaming emission lines from the cloudy defaults.

Parameters:

number (int) – The number to convert into a roman numeral.

Returns:

number_representation (str)

String reprensentation of the roman numeral.

synthesizer.emissions.utils.get_transmission(intrinsic_sed, attenuated_sed)[source]

Calculate transmission as a function of wavelength.

The transmission is defined as the ratio between an attenuated and an intrinsic sed.

Parameters:
  • intrinsic_sed (Sed) – The intrinsic spectra object.

  • attenuated_sed (Sed) – The attenuated spectra object.

Returns:

array-like, float

The transmission array.