lightcurvelynx.effects.extinction

A general extinction effect that wraps multiple backend libraries including: * dust_extinction (https://github.com/karllark/dust_extinction) * sncosmo extinction (https://github.com/sncosmo/extinction)

Classes

ExtinctionEffect

A general extinction effect model that supports multiple backend libraries.

Module Contents

class ExtinctionEffect(extinction_model=None, *, ebv=None, frame=None, r_v=None, backend=None, **kwargs)[source]

Bases: lightcurvelynx.effects.effect_model.EffectModel

A general extinction effect model that supports multiple backend libraries.

model_name[source]

The model_name of the extinction model to use.

Type:

str

ebv

The setter (function) for the extinction parameter E(B-V).

Type:

parameter

frame

The frame for extinction. ‘rest’ or ‘observer’.

Type:

str

r_v[source]

The value for the extinction parameter R(V) if needed by the backend model.

Type:

float, optional

backend[source]

The backend extinction library to use. One of ‘dust_extinction’ or ‘extinction’. Default is ‘dust_extinction’.

Type:

str

Parameters:
  • extinction_model (str) – The name of the extinction model to use.

  • ebv (parameter) – The setter (function) for the extinction parameter E(B-V).

  • r_v (float, optional) – The value for the extinction parameter R(V) if needed by the backend model.

  • frame (str) – The frame for extinction. ‘rest’ or ‘observer’.

  • backend (str) – The backend extinction library to use. One of ‘dust_extinction’ or ‘extinction’.

  • **kwargs (dict, optional) – Any additional keyword arguments.

model_name = None[source]
backend = None[source]
r_v = None[source]
__repr__()[source]
__getstate__()[source]

We override the default pickling behavior to handle the extinction model, since it may not be picklable.

__setstate__(state)[source]

We override the default unpickling behavior to handle the extinction model, since it may not be picklable.

apply(flux_density, times=None, wavelengths=None, ebv=None, **kwargs)[source]

Apply the extinction effect to the flux density.

Parameters:
  • flux_density (numpy.ndarray) – A length T X N matrix of flux density values (in nJy).

  • times (numpy.ndarray, optional) – A length T array of times (in MJD). Not used for this effect.

  • wavelengths (numpy.ndarray, optional) – A length N array of wavelengths (in angstroms).

  • ebv (float, optional) – The extinction parameter E(B-V). Raises an error if None is provided.

  • **kwargs (dict, optional) – Any additional keyword arguments, including any additional parameters needed to apply the effect.

Returns:

flux_density – A length T x N matrix of flux densities after the effect is applied (in nJy).

Return type:

numpy.ndarray