lsst.pipe.tasks  20.0.0-29-g26d13349+2d5e4f2fd7
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.tasks.colorterms.Colorterm Class Reference

Colorterm correction for one pair of filters. More...

Inheritance diagram for lsst.pipe.tasks.colorterms.Colorterm:

Public Member Functions

def getCorrectedMagnitudes (self, refCat, filterName)
 
def transformSource (self, source)
 Transform the brightness of a source. More...
 
def transformMags (self, primary, secondary)
 Transform brightness. More...
 
def propagateFluxErrors (self, primaryFluxErr, secondaryFluxErr)
 

Static Public Attributes

 primary
 
 secondary
 
 c0
 
 c1
 
 c2
 

Detailed Description

Colorterm correction for one pair of filters.

The transformed magnitude p' is given by p' = primary + c0 + c1*(primary - secondary) + c2*(primary - secondary)**2

To construct a Colorterm, use keyword arguments: Colorterm(primary=primaryFilterName, secondary=secondaryFilterName, c0=c0value, c1=c1Coeff, c2=c2Coeff) where c0-c2 are optional. For example (omitting c2): Colorterm(primary="g", secondary="r", c0=-0.00816446, c1=-0.08366937)

This is subclass of Config. That is a bit of a hack to make it easy to store the data in an appropriate obs_* package as a config override file. In the long term some other means of persistence will be used, at which point the constructor can be simplified to not require keyword arguments. (Fixing DM-2831 will also allow making a custom constructor).

Definition at line 41 of file colorterms.py.

Member Function Documentation

◆ getCorrectedMagnitudes()

def lsst.pipe.tasks.colorterms.Colorterm.getCorrectedMagnitudes (   self,
  refCat,
  filterName 
)
Return the colorterm corrected magnitudes for a given filter.

Parameters
----------
refCat : `lsst.afw.table.SimpleCatalog`
    The reference catalog to apply color corrections to.
filterName : `str`
    The camera filter to correct the reference catalog into.

Returns
-------
RefMag : `np.ndarray`
    The corrected AB magnitudes.
RefMagErr : `np.ndarray`
    The corrected AB magnitude errors.

Raises
------
KeyError
    Raised if the reference catalog does not have a flux uncertainty
    for that filter.

Notes
-----
WARNING: I do not know that we can trust the propagation of magnitude
errors returned by this method. They need more thorough tests.

Definition at line 63 of file colorterms.py.

◆ propagateFluxErrors()

def lsst.pipe.tasks.colorterms.Colorterm.propagateFluxErrors (   self,
  primaryFluxErr,
  secondaryFluxErr 
)

Definition at line 137 of file colorterms.py.

◆ transformMags()

def lsst.pipe.tasks.colorterms.Colorterm.transformMags (   self,
  primary,
  secondary 
)

Transform brightness.

Parameters
[in]primarybrightness in primary filter (magnitude)
[in]secondarybrightness in secondary filter (magnitude)
Returns
the transformed brightness (as a magnitude)

Definition at line 127 of file colorterms.py.

◆ transformSource()

def lsst.pipe.tasks.colorterms.Colorterm.transformSource (   self,
  source 
)

Transform the brightness of a source.

Parameters
[in]sourcesource whose brightness is to be converted; must support get(filterName) (e.g. source.get("r")) method, as do afw::table::Source and dicts.
Returns
the transformed source magnitude

Definition at line 118 of file colorterms.py.

Member Data Documentation

◆ c0

lsst.pipe.tasks.colorterms.Colorterm.c0
static

Definition at line 59 of file colorterms.py.

◆ c1

lsst.pipe.tasks.colorterms.Colorterm.c1
static

Definition at line 60 of file colorterms.py.

◆ c2

lsst.pipe.tasks.colorterms.Colorterm.c2
static

Definition at line 61 of file colorterms.py.

◆ primary

lsst.pipe.tasks.colorterms.Colorterm.primary
static

Definition at line 57 of file colorterms.py.

◆ secondary

lsst.pipe.tasks.colorterms.Colorterm.secondary
static

Definition at line 58 of file colorterms.py.


The documentation for this class was generated from the following file: