lightcurvelynx.astro_utils.mag_flux

Flux-magnitude conversion utilities.

Attributes

MAG_AB_ZP_NJY

MAGERR_FACTOR

Classes

Mag2FluxNode

A wrapper class for the mag2flux() function.

Flux2MagNode

A wrapper class for the flux2mag() function.

Functions

mag2flux(→ numpy.typing.ArrayLike)

Convert AB magnitude to bandflux in nJy.

flux2mag(→ numpy.typing.ArrayLike)

Convert bandflux in nJy to AB magnitude

Module Contents

MAG_AB_ZP_NJY = 31.4[source]
MAGERR_FACTOR[source]
mag2flux(mag: numpy.typing.ArrayLike, mag_err: numpy.typing.ArrayLike = None) numpy.typing.ArrayLike[source]

Convert AB magnitude to bandflux in nJy.

Parameters:
  • mag (ndarray of float) – The magnitude to convert to bandflux.

  • mag_err (ndarray of float, optional) – The magnitude error to convert to bandflux error.

Returns:

  • bandflux (ndarray of float) – The bandflux corresponding to the input magnitude.

  • bandflux_err (ndarray of float, optional) – The bandflux error corresponding to the input magnitude error. Only returned if mag_err is provided (not None), making the return value a tuple (bandflux, bandflux_err).

flux2mag(flux_njy: numpy.typing.ArrayLike, flux_err_njy: numpy.typing.ArrayLike = None) numpy.typing.ArrayLike[source]

Convert bandflux in nJy to AB magnitude

Parameters:
  • flux_njy (ndarray of float) – The bandflux to convert to magnitude.

  • flux_err_njy (ndarray of float, optional) – The bandflux error to convert to magnitude error.

Returns:

  • mag (ndarray of float) – The magnitude corresponding to the input bandflux.

  • mag_err (ndarray of float) – The magnitude error corresponding to the input bandflux error. Only returned if flux_err_njy is provided(not None), making the return value a tuple (mag, mag_err).

class Mag2FluxNode(mag, **kwargs)[source]

Bases: lightcurvelynx.base_models.FunctionNode

A wrapper class for the mag2flux() function.

Parameters:
  • mag (ndarray of float) – The magnitude to convert to bandflux.

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

class Flux2MagNode(flux_njy, **kwargs)[source]

Bases: lightcurvelynx.base_models.FunctionNode

A wrapper class for the flux2mag() function.

Parameters:
  • flux_njy (float or array-like) – The flux in nJy to convert to magnitude.

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