sncosmo.CompositeMagSystem¶
- class sncosmo.CompositeMagSystem(bands=None, families=None, name=None)[source]¶
A magnitude system defined in a specific set of bands.
In each band, there is a fundamental standard with a known (generally non-zero) magnitude.
- Parameters:
- bands: dict, optional
Dictionary where keys are
Bandpassinstances or names, thereof and values are 2-tuples of magnitude system and offset. The offset gives the magnitude of standard in the given band. A positive offset means that the composite magsystem zeropoint flux is higher (brighter) than that of the standard.- familiesdict, optional
Similar to the
bandsargument, but keys are strings that apply to any bandpass that has a matchingfamilyattribute. This is useful for generated bandpasses where the transmission differs across focal plane (and hence the bandpass at each position is unique), but all photometry has been calibrated to the same offset.- namestr
The
nameattribute of the magnitude system.
Examples
Create a magnitude system defined in only two SDSS bands where an object with AB magnitude of 0 would have a magnitude of 0.01 and 0.02 in the two bands respectively:
>>> sncosmo.CompositeMagSystem(bands={'sdssg': ('ab', 0.01), ... 'sdssr': ('ab', 0.02)})
Methods
__init__([bands, families, name])band_flux_to_mag(flux, band)Convert flux (photons / s / cm^2) to magnitude.
band_mag_to_flux(mag, band)Convert magnitude to flux in photons / s / cm^2
zpbandflux(band)Flux of an object with magnitude zero in the given bandpass.
Attributes
bandsnameName of magnitude system.