Users wishing to adapt CatSim for non-LSST projects will likely need to write getters that can calculate the magnitudes of objects in non-LSST bandpasses. This page explains how to do that. Those wishing to see an example implementation should look to
which implements getters for SDSS bandpasses using CatSim.
Any implementation of photometry getters should occur within a mixin class that inherits from either PhotometryStars or PhotometryGalaxies. These are the mixins defined in
that provide the basic infrastructure for calculating magnitudes in an arbitrary set of bandpasses. Specifically, they define the method _magnitudeGetter which takes a a set of arbitrary bandpasses (stored in an instance of the class BandpassDict) and returns the magnitudes of objects returned by CatSim in those bandpasses. We can see the use of this method demonstrated in the magnitudes getter from the example SDSS catalog above:
loadTotalBandpassesFromFiles() needs to be called the same way whether you are calculating the magnitudes for a star (which just has one component), or a galaxy (which will have separate magnitudes for the bulge, disk, and agn components). It is a class method of the class BandpassDict defined in
Its arguments are
- bandpassNames – a list of the names of the bandpasses; these correspond to the keys for self.bandpassDict. See the example above for SDSS bands.
- bandpassDir – this is the absolute path to the directory in which the bandpass throughput files are kept.
- bandpassRoot – this is the root of the name of each bandpass throughput file
loadTotalBandpassesFromFiles() assumes that the bandpass throughput files are named like
corresponds to the bandpass throughput files
The _magnitudeGetter() method differs depending on whether you are inheriting from PhotometryStars or PhotometryGalaxies. It takes as arguments
- componentName – for galaxies only. This specifies whether the getter is calculating magnitudes for the 'disk', 'bulge', or 'agn'
- bandpassDict – a BandpassDict instantiation containing the bandpasses to be integrated. The bandpasses in this dict must occur in the same order as the magnitudes are declared to the @compound getter.
- columnNameList – a list of the names of the columns to which these magnitudes correspond. This is so that the getter can associate the magnitudes with any variability model that may have been implemented. This list of magnitudes must occur in the same order as declared to the @compound getter.
The PhotometryStars case is very straightforward. In this case, the method reads in the SED file names, normalizations, and dust extinction parameters A(V) associated with each object, converts that data into an instantiation of the SedList class defined in
and integrates the SEDs in that SedList over the bandpasses in the BandpassDict passed to _magnitudeGetter(). Magnitudes are returned in a two dimensional numpy array in which each row corresponds to a different bandpass (in the order they occur in self.bandpassDict) and each column corresponds to a different object (i.e. a row of the database).
Note: because the _magnitudeGetter() returns magnitudes in the order specified by the input BandpassDict (which, in turn, is specified by the order of filters in the bandpassNames argument passed to loadTotalBandpassesFromFiles()), it is very important that the columns declared for the getter by @compound occur in the same order as the bandpasses in the list of bandpassNames passed to loadTotalBandpassesFromFiles().
In the case of galaxies, each component (bulge, disk, AGN) of the galaxy has its own SED and related parameters. This requires a suite of getter methods (including a getter method to combine the components into a total magntiude for the galaxy). In the case of our example SDSS catalog, this looks like
The _magnitudeGetter for galaxies behaves exactly like the _magnitudeGetter for stars, except that it takes the extra argument componentName ('bulge', 'disk', or 'agn') so that it knows which list of SEDs to load and integrate over the BandpassDict.