create_color_grid

nsb2.core.photometry.create_color_grid(magnitude, color, color_range, spec_library, EBVs=None, extmod=None)[source]

Build a spectral grid indexed by observed photometric colour.

Each template of spec_library is reddened over a range of colour excesses using the [Gordon2023] average extinction law, and renormalised to unit brightness in the magnitude band. The resulting relation between colour excess and synthetic colour is inverted, so that the returned grid can be evaluated directly at an observed colour index.

Parameters:
  • magnitude (nsb2.core.spectral.Bandpass) – Passband the catalogue magnitudes are measured in. The returned spectra are normalised to magnitude zero in this band.

  • color (list of nsb2.core.spectral.Bandpass) – The two passbands whose difference defines the colour index, as [blue_band, red_band].

  • color_range (list of float) – Lower and upper bound of the colour index to tabulate.

  • spec_library (nsb2.core.spectral.SpectralGrid) – Template spectra, e.g. from PicklesTRDSAtlas1998().

  • EBVs (numpy.ndarray, optional) – Colour excesses E(B-V) to redden the templates by. Default is DEFAULT_EBVS.

  • extmod (optional) – Extinction model exposing an extinguish(wvl, Ebv=...) method. Default is dust_extinction.parameter_averages.G23 with Rv = DEFAULT_RV.

Returns:

Grid with a single parameter axis holding the colour index, and spectra in photon flux density per unit magnitude-zeropoint flux.

Return type:

nsb2.core.spectral.SpectralGrid

Notes

Colours outside the range spanned by a given template produce nan, which propagates to nan spectra for stars that no template can reproduce.