fastar.tools.utils#

Functions

compute_ab_magnitudes(wave, spectra, fresp)

Compute AB magnitudes from synthetic spectra using a filter response.

compute_linestrengths(wave, flux, index, dat)

Compute the strength of a spectral feature defined by a Lick-style index.

flux_sum(wave, flux, bend, rend)

Integrate spectral flux within a specified wavelength band, accounting for partial pixel coverage at band edges.

fastar.tools.utils.compute_ab_magnitudes(wave, spectra, fresp)[source]#

Compute AB magnitudes from synthetic spectra using a filter response.

Parameters:
  • wave (array-like) – Wavelength grid (in Angstroms).

  • spectra (array-like) – Spectral fluxes sampled over wave.

  • fresp (array-like) – Filter transmission curve sampled over wave.

Returns:

AB magnitude.

Return type:

float

fastar.tools.utils.compute_linestrengths(wave, flux, index, dat)[source]#

Compute the strength of a spectral feature defined by a Lick-style index.

Parameters:
  • wave (array-like) – Wavelength grid.

  • flux (array-like) – Spectral flux.

  • index (str) – Name of the index to compute (must match dat[‘NAME’]).

  • dat (Table) – Table with index definitions (Blue_1, Blue_2, Red_1, Red_2, Line_1, Line_2, T).

Returns:

Line strength in Angstroms (T=2) or magnitudes (T=1).

Return type:

float

fastar.tools.utils.flux_sum(wave, flux, bend, rend)[source]#

Integrate spectral flux within a specified wavelength band, accounting for partial pixel coverage at band edges.

Parameters:
  • wave (array-like) – Wavelength grid.

  • flux (array-like) – Flux values corresponding to wave.

  • bend (float) – Blue (lower) limit of the band.

  • rend (float) – Red (upper) limit of the band.

Returns:

Total flux within the band.

Return type:

float