Colorterm#

class lsst.pipe.tasks.colorterms.Colorterm(*args, **kw)#

Bases: Config

Colorterm correction for one pair of filters

Notes#

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).

Attributes Summary

c0

Constant parameter (float, default 0.0)

c1

First-order parameter (float, default 0.0)

c2

Second-order parameter (float, default 0.0)

primary

name of primary filter (str)

secondary

name of secondary filter (str)

Methods Summary

getCorrectedMagnitudes(refCat[, filterName])

Return the colorterm corrected magnitudes for a given filter.

propagateFluxErrors(primaryFluxErr, ...)

transformMags(primary, secondary)

Transform brightness

transformSource(source)

Transform the brightness of a source

Attributes Documentation

c0#

Constant parameter (float, default 0.0)

c1#

First-order parameter (float, default 0.0)

c2#

Second-order parameter (float, default 0.0)

primary#

name of primary filter (str)

secondary#

name of secondary filter (str)

Methods Documentation

getCorrectedMagnitudes(refCat, filterName='deprecatedArgument')#

Return the colorterm corrected magnitudes for a given filter.

Parameters#

refCatlsst.afw.table.SimpleCatalog

The reference catalog to apply color corrections to.

filterNamestr, deprecated

The camera filter to correct the reference catalog into. The filterName argument is unused and will be removed in v23.

Returns#

refMagnp.ndarray

The corrected AB magnitudes.

refMagErrnp.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.

propagateFluxErrors(primaryFluxErr, secondaryFluxErr)#
transformMags(primary, secondary)#

Transform brightness

Parameters#

primaryfloat

Brightness in primary filter (magnitude).

secondaryfloat

Brightness in secondary filter (magnitude).

Returns#

transformedfloat

The transformed brightness (as a magnitude).

transformSource(source)#

Transform the brightness of a source

Parameters#

sourceUnknown

Source whose brightness is to be converted; must support get(filterName) (e.g. source.get(“r”)) method, as do afw::table::Source and dicts.

Returns#

transformedfloat

The transformed source magnitude.