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_libraryis reddened over a range of colour excesses using the [Gordon2023] average extinction law, and renormalised to unit brightness in themagnitudeband. 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 isdust_extinction.parameter_averages.G23withRv=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:
Notes
Colours outside the range spanned by a given template produce
nan, which propagates tonanspectra for stars that no template can reproduce.