pynbody.analysis.luminosity.MultiSSPTable#
- class pynbody.analysis.luminosity.MultiSSPTable(*tables)[source]#
Bases:
SSPTableCombines multiple SSP tables, each of which must offer different bandpasses
- Attributes:
bandsList of bandpasses available in this table
Methods
__call__(snapshot, band)Interpolate the magnitude for a given snapshot and bandpass
get_central_wavelength(band)Get the estimated central wavelength of a bandpass
get_flux_normalization(band)Get the normalization factor for converting relative magnitudes to fluxes
Get the normalization factor for converting absolute magnitudes to spectral density
interpolate(ages, metallicities, band)Interpolate the magnitude for a given age, metallicity and bandpass
get_power_normalization
- __init__(*tables)[source]#
Initialise an SSP table
- Parameters:
ages (array-like) – Array of ages in log10 years, length N
metallicities (array-like) – Array of log10 metal mass fractions, length M
magnitudes (dict[str, array-like]) – Dictionary of bandpass names to 2D arrays of magnitudes, size N x M
case_insensitive (bool, optional) – If True, the bandpass names are treated as case-insensitive.
ignore_bands (list[str], optional) – List of bandpasses to ignore. These bandpasses will not be available in the table.
is_ab_system (bool, optional) – If True, the magnitudes are in the AB system. If False, the magnitudes are in the Vega system.
- property bands#
List of bandpasses available in this table
- get_central_wavelength(band)[source]#
Get the estimated central wavelength of a bandpass
The values are approximate, based on the tabulated central wavelengths from CMD. If you use a different bandpass set, you may wish to override this method. It is used by the
pynbody.plot.stars.render()routine to estimate the central wavelength of a bandpass for the purposes of estimating dust extinction.- Parameters:
band (str) – Bandpass name
- Returns:
Central wavelength in Angstroms
- Return type:
float
- get_flux_normalization(band)[source]#
Get the normalization factor for converting relative magnitudes to fluxes
The normalization factor is the flux of a star with a magnitude of 0 in the given bandpass. Currently, this is only implemented for AB-calibrated systems, where the normalization factor is 3631 Jy.
- get_spectral_density_normalization(band)#
Get the normalization factor for converting absolute magnitudes to spectral density
This uses the flux normalization and then (as per definition of absolute magnitude) considers the source to be at a distance of 10 pc. The output units are power per unit frequency (or, eqivalently, energy).
- interpolate(ages, metallicities, band)[source]#
Interpolate the magnitude for a given age, metallicity and bandpass
- Parameters:
age (float or array-like) – Age in log10 years
metallicities (float or array-like) – Metallicity in log10 mass fraction
band (str) – Bandpass name
- Returns:
Magnitude(s) per solar mass interpolated from the SSP table
- Return type:
float or array-like