distroi.model.dep.spec_dep module#

A module to define spectral dependencies of model components.

Spectral dependencies can be attached to model components in the calculation of observables.

Notes

Support is provided for spectral dependencies in F_lam, lam x F_lam, F_nu and nu x F_nu flux formats.

class distroi.model.dep.spec_dep.BlackBodySpecDep(temp)#

Bases: SpecDep

Blackbody spectral flux dependency.

Parameters:

temp (float) – The blackbody temperature in Kelvin.

flux_from_ref(x: ndarray | float, x_ref: float, ref_flux: float, flux_form: str = 'flam') ndarray | float#

Retrieve flux at wavelengths/frequencies when given a reference flux value and wavelength/frequency.

Parameters:
  • x (np.ndarray or float) – Wavelengths/frequencies (in micron/Hz) at which to calculate the flux.

  • x_ref (np.ndarray or float) – Reference wavelength/frequency (in micron/Hz) at which to calculate the flux. In case flux_form = 'flam' or ‘lam_flam’, x_ref is assumed to be a wavelength, while in case of ‘fnu’ and ‘nu_fnu’, x_ref is assumed to be a frequency.

  • ref_flux (float) – Reference flux from which to calculate the flux, in the specified flux_form format.

  • flux_form (str, optional) – The format of the flux to be calculated. Options are ‘flam’ (default) and ‘lam_flam’, as well as their frequency analogues ‘fnu’ and ‘nu_fnu’. In case flux_form = 'flam' or ‘lam_flam’, x is assumed to be wavelengths, while in case of ‘fnu’ and ‘nu_fnu’, x is assumed to be frequencies.

Returns:

The flux calculated at x using the reference wavelength/frequency and reference flux value. Note that the units of both input and output will correspond to those of x_ref and ref_flux.

Return type:

np.ndarray or float

class distroi.model.dep.spec_dep.FlatSpecDep(flux_form='flam')#

Bases: SpecDep

Flat spectral dependency.

Parameters:

flux_form (str, optional) – The format of the flux which follows the flat dependency. Options are ‘flam’ (default) and ‘lam_flam’, as well as their frequency analogues ‘fnu’ and ‘nu_fnu’. The formats in wavelength specification (‘flam’ and ‘lam_flam’) assume the power law dependency to be in wavelength (i.e. flux1 / flux2 = (wavelength1 / wavelength2) ^ power), while the ones in frequency specification assume the power law to be in frequency (i.e. flux1 / flux2 = (frequency1 / frequency2) ^ power). Note that a flat law in ‘flam’ in wavelength will result in a power law for ‘fnu’ in frequency of power ‘-2’, i.e. the transformation between ‘fnu’ and ‘flam’ matters.

flux_from_ref(x: ndarray | float, x_ref: float, ref_flux: float, flux_form: str = 'flam') ndarray | float#

Retrieve flux at wavelengths/frequencies when given a reference flux value and wavelength/frequency.

Parameters:
  • x (np.ndarray or float) – Wavelengths/frequencies (in micron/Hz) at which to calculate the flux.

  • x_ref (np.ndarray or float) – Reference wavelength/frequency (in micron/Hz) at which to calculate the flux. In case flux_form = 'flam' or ‘lam_flam’, x_ref is assumed to be a wavelength, while in case of ‘fnu’ and ‘nu_fnu’, x_ref is assumed to be a frequency.

  • ref_flux (float) – Reference flux from which to calculate the flux, in the specified flux_form format.

  • flux_form (str, optional) – The format of the flux to be calculated. Options are ‘flam’ (default) and ‘lam_flam’, as well as their frequency analogues ‘fnu’ and ‘nu_fnu’. In case flux_form = 'flam' or ‘lam_flam’, x is assumed to be wavelengths, while in case of ‘fnu’ and ‘nu_fnu’, x is assumed to be frequencies.

Returns:

The flux calculated at x using the reference wavelength/frequency and reference flux value. Note that the units of both input and output will correspond to those of x_ref and ref_flux.

Return type:

np.ndarray or float

class distroi.model.dep.spec_dep.PowerLawSpecDep(power, flux_form='flam')#

Bases: SpecDep

Power law flux dependency.

Parameters:
  • power (float) – The power of the flux profile.

  • flux_form (str, optional) – The format of the flux to be calculated. This flux will follow the specified power law dependency. Options are ‘flam’ (default) and ‘lam_flam’, as well as their frequency analogues ‘fnu’ and ‘nu_fnu’. The formats in wavelength specification (‘flam’ and ‘lam_flam’) assume the power law dependency to be in wavelength (i.e. flux1 / flux2 = (wavelength1 / wavelength2) ** power), while the ones in frequency specification assume the power law to be in frequency (i.e. flux1 / flux2 = (frequency1 / frequency2)**power). Note that a power law of ‘flam’ of power ‘d’ in wavelength will result in a power law for ‘fnu’ in frequency of power ‘-d-2’, i.e. the transformation between ‘fnu’ and ‘flam’ matters.

flux_from_ref(x: ndarray | float, x_ref: float, ref_flux: float, flux_form: str = 'flam') ndarray | float#

Retrieve flux at wavelengths/frequencies when given a reference flux value and wavelength/frequency.

Parameters:
  • x (np.ndarray or float) – Wavelengths/frequencies (in micron/Hz) at which to calculate the flux.

  • x_ref (np.ndarray or float) – Reference wavelength/frequency (in micron/Hz) at which to calculate the flux. In case flux_form = 'flam' or ‘lam_flam’, x_ref is assumed to be a wavelength, while in case of ‘fnu’ and ‘nu_fnu’, x_ref is assumed to be a frequency.

  • ref_flux (float) – Reference flux from which to calculate the flux, in the specified flux_form format.

  • flux_form (str, optional) – The format of the flux to be calculated. Options are ‘flam’ (default) and ‘lam_flam’, as well as their frequency analogues ‘fnu’ and ‘nu_fnu’. In case flux_form = 'flam' or ‘lam_flam’, x is assumed to be wavelengths, while in case of ‘fnu’ and ‘nu_fnu’, x is assumed to be frequencies.

Returns:

The flux calculated at x using the reference wavelength/frequency and reference flux value. Note that the units of both input and output will correspond to those of x_ref and ref_flux.

Return type:

np.ndarray or float

class distroi.model.dep.spec_dep.SpecDep#

Bases: ABC

Abstract representation of a total flux spectral dependency.

Abstract class representing a spectral dependence to be attached to a geometric model component. Note that these do not represent full-fledged spectra. These are not absolute-flux calibrated, and only represent the dependence of flux on wavelength/frequency. A flux at a reference wavelength/frequency (derived from e.g. geometrical modelling) must be passed along in order to get absolute values.

abstract flux_from_ref(x: ndarray | float, x_ref: float, ref_flux: float, flux_form: str = 'flam') ndarray | float#

Retrieve flux at wavelengths/frequencies when given a reference flux value and wavelength/frequency.

Parameters:
  • x (np.ndarray or float) – Wavelengths/frequencies (in micron/Hz) at which to calculate the flux.

  • x_ref (np.ndarray or float) – Reference wavelength/frequency (in micron/Hz) at which to calculate the flux. In case flux_form = 'flam' or ‘lam_flam’, x_ref is assumed to be a wavelength, while in case of ‘fnu’ and ‘nu_fnu’, x_ref is assumed to be a frequency.

  • ref_flux (float) – Reference flux from which to calculate the flux, in the specified flux_form format.

  • flux_form (str, optional) – The format of the flux to be calculated. Options are ‘flam’ (default) and ‘lam_flam’, as well as their frequency analogues ‘fnu’ and ‘nu_fnu’. In case flux_form = 'flam' or ‘lam_flam’, x is assumed to be wavelengths, while in case of ‘fnu’ and ‘nu_fnu’, x is assumed to be frequencies.

Returns:

The flux calculated at x using the reference wavelength/frequency and reference flux value. Note that the units of both input and output will correspond to those of x_ref and ref_flux.

Return type:

np.ndarray or float

class distroi.model.dep.spec_dep.ThinAccDiskSpecDep(acc_rate: float, star_mass: float, r_in: float, r_out: float, eta_rad: float)#

Bases: SpecDep

Spectral dependency of a thin, multi-blackbody accretion disk.

Spectral dependency of a thin, multi-blackbody accretion disk, as specified in De Prins et al. 2024. The disk has a blackbody temperature gradient derived assuming a certain accretion rate and radiative efficiency, the latter denoting the fraction of released gravitational power which is converted to radiation.

Parameters:
  • acc_rate (float) – Accretion rate at the inner disk rim in units of M_sun yr^-1.

  • star_mass (float) – Mass of the star at the centre of the disk in M_sun.

  • r_in (float) – Inner disk rim radius in Solar radii.

  • r_out (float) – Outer disk rim radius in Solar radii.

  • eta_rad (float) – Radiative efficiency, expressed as a fraction between 0 and 1.

flux_from_ref(x: ndarray | float, x_ref: float, ref_flux: float, flux_form: str = 'flam') ndarray | float#

Retrieve flux at wavelengths/frequencies when given a reference flux value and wavelength/frequency.

Parameters:
  • x (np.ndarray or float) – Wavelengths/frequencies (in micron/Hz) at which to calculate the flux.

  • x_ref (np.ndarray or float) – Reference wavelength/frequency (in micron/Hz) at which to calculate the flux. In case flux_form = 'flam' or ‘lam_flam’, x_ref is assumed to be a wavelength, while in case of ‘fnu’ and ‘nu_fnu’, x_ref is assumed to be a frequency.

  • ref_flux (float) – Reference flux from which to calculate the flux, in the specified flux_form format.

  • flux_form (str, optional) – The format of the flux to be calculated. Options are ‘flam’ (default) and ‘lam_flam’, as well as their frequency analogues ‘fnu’ and ‘nu_fnu’. In case flux_form = 'flam' or ‘lam_flam’, x is assumed to be wavelengths, while in case of ‘fnu’ and ‘nu_fnu’, x is assumed to be frequencies.

Returns:

The flux calculated at x using the reference wavelength/frequency and reference flux value. Note that the units of both input and output will correspond to those of x_ref and ref_flux.

Return type:

np.ndarray or float