lightcurvelynx.astro_utils.sed_basis_models

Functions for creating fake SED basis functions for each filter.

These functions are primarily used to test and validate bandflux only models by allowing them to compute some SED (that will be accurate when passed through the filter curves). Users should NOT use these functions with transforms such as redshift.

Classes

SEDBasisModel

A simple class to hold SED basis model information.

Module Contents

class SEDBasisModel(wavelengths, sed_values)[source]

A simple class to hold SED basis model information.

wavelengths[source]

A 1-dimensional array of wavelengths (in Angstroms).

Type:

np.ndarray

sed_values[source]

A dictionary mapping filter names to their corresponding SED values in each wavelength (of all_waves).

Type:

dict

wavelengths[source]
sed_values[source]
__len__()[source]

Return the number of filters in the SED basis model.

property filters[source]

Return a list of all the filter names in the SED basis model.

classmethod from_box_approximation(passbands, filters=None)[source]

Create box-shaped SED basis functions. For each passband this creates a box shaped SED that does not overlap with any other passband. The height of the SED is normalized such that the total flux density will be 1.0 after passing through the passband.

Parameters:
  • passbands (PassbandGroup) – The passband group to use for defining the light curve.

  • filters (list, optional) – A list of filters to use for the model. If not provided, use all filters in the passband group.

Returns:

sed_basis_values – The basis model for this set of filters.

Return type:

SEDBasisModel

compute_sed(filter, wavelengths=None)[source]

Compute the SED values for a given filter at a single time.

Parameters:
  • filter (str) – The filter for which to compute the SED.

  • wavelengths (np.ndarray, optional) – A 1-dimensional array of wavelengths (in Angstroms) at which to compute the SED. If None, use the internal wavelengths.

Returns:

A 1-dimensional array of SED values at each wavelength.

Return type:

np.ndarray

compute_sed_from_bandfluxes(filters, bandfluxes, wavelengths=None)[source]

Compute the SED values from given bandfluxes.

Parameters:
  • filters (list of str) – A length T array of filter names for each time.

  • bandfluxes (np.ndarray) – A length T array of bandflux values for each filter (in nJy).

  • wavelengths (np.ndarray, optional) – A length W array of wavelengths (in Angstroms) at which to compute the SED. If None, use the internal wavelengths.

Returns:

flux_density – A length T x N matrix of observer frame SED values (in nJy).

Return type:

numpy.ndarray

plot(ax=None, figure=None)[source]

Plot the basis functions for the SED. This is a debugging function to help the user understand the SEDs produced by this model.

Parameters:
  • ax (matplotlib.pyplot.Axes or None, optional) – Axes, None by default.

  • figure (matplotlib.pyplot.Figure or None) – Figure, None by default.