lsst.meas.base g51c93253c0+9731be2fa5
Loading...
Searching...
No Matches
lsst.meas.base.tests.TransformTestCase Class Reference
Inheritance diagram for lsst.meas.base.tests.TransformTestCase:
lsst.meas.base.tests.CentroidTransformTestCase lsst.meas.base.tests.FluxTransformTestCase

Public Member Functions

 setUp (self)
 
 tearDown (self)
 
 testTransform (self, baseNames=None)
 
 testRegistration (self)
 

Public Attributes

 calexp = TestDataset.makeEmptyExposure(bbox)
 
 inputCat = self.mapper)
 
 outputCat
 

Static Public Attributes

str name = "MeasurementTransformTest"
 
 controlClass = None
 
 algorithmClass = None
 
 transformClass = None
 
tuple flagNames = ("flag",)
 
tuple singleFramePlugins = ()
 
tuple forcedPlugins = ()
 

Protected Member Functions

 _populateCatalog (self, baseNames)
 
 _checkOutput (self, baseNames)
 
 _runTransform (self, doExtend=True)
 
 _checkRegisteredTransform (self, registry, name)
 

Protected Attributes

 _runTransform
 

Detailed Description

Base class for testing measurement transformations.

Notes
-----
We test both that the transform itself operates successfully (fluxes are
converted to magnitudes, flags are propagated properly) and that the
transform is registered as the default for the appropriate measurement
algorithms.

In the simple case of one-measurement-per-transformation, the developer
need not directly write any tests themselves: simply customizing the class
variables is all that is required. More complex measurements (e.g.
multiple aperture fluxes) require extra effort.

Definition at line 789 of file tests.py.

Member Function Documentation

◆ _checkOutput()

lsst.meas.base.tests.TransformTestCase._checkOutput ( self,
baseNames )
protected

Definition at line 851 of file tests.py.

◆ _checkRegisteredTransform()

lsst.meas.base.tests.TransformTestCase._checkRegisteredTransform ( self,
registry,
name )
protected

Definition at line 900 of file tests.py.

◆ _populateCatalog()

lsst.meas.base.tests.TransformTestCase._populateCatalog ( self,
baseNames )
protected

Definition at line 841 of file tests.py.

◆ _runTransform()

lsst.meas.base.tests.TransformTestCase._runTransform ( self,
doExtend = True )
protected

Definition at line 862 of file tests.py.

◆ setUp()

lsst.meas.base.tests.TransformTestCase.setUp ( self)

Definition at line 829 of file tests.py.

◆ tearDown()

lsst.meas.base.tests.TransformTestCase.tearDown ( self)

Definition at line 834 of file tests.py.

◆ testRegistration()

lsst.meas.base.tests.TransformTestCase.testRegistration ( self)
Test that the transformation is appropriately registered.

Definition at line 905 of file tests.py.

◆ testTransform()

lsst.meas.base.tests.TransformTestCase.testTransform ( self,
baseNames = None )
Test the transformation on a catalog containing random data.

Parameters
----------
baseNames : iterable of `str`
    Iterable of the initial parts of measurement field names.

Notes
-----
We check that:

- An appropriate exception is raised on an attempt to transform
  between catalogs with different numbers of rows;
- Otherwise, all appropriate conversions are properly appled and that
  flags have been propagated.

The ``baseNames`` argument requires some explanation. This should be
an iterable of the leading parts of the field names for each
measurement; that is, everything that appears before ``_instFlux``,
``_flag``, etc. In the simple case of a single measurement per plugin,
this is simply equal to ``self.name`` (thus measurements are stored as
``self.name + "_instFlux"``, etc). More generally, the developer may
specify whatever iterable they require. For example, to handle
multiple apertures, we could have ``(self.name + "_0", self.name +
"_1", ...)``.

Definition at line 867 of file tests.py.

Member Data Documentation

◆ _runTransform

lsst.meas.base.tests.TransformTestCase._runTransform
protected

Definition at line 896 of file tests.py.

◆ algorithmClass

lsst.meas.base.tests.TransformTestCase.algorithmClass = None
static

Definition at line 816 of file tests.py.

◆ calexp

lsst.meas.base.tests.TransformTestCase.calexp = TestDataset.makeEmptyExposure(bbox)

Definition at line 831 of file tests.py.

◆ controlClass

lsst.meas.base.tests.TransformTestCase.controlClass = None
static

Definition at line 815 of file tests.py.

◆ flagNames

tuple lsst.meas.base.tests.TransformTestCase.flagNames = ("flag",)
static

Definition at line 819 of file tests.py.

◆ forcedPlugins

tuple lsst.meas.base.tests.TransformTestCase.forcedPlugins = ()
static

Definition at line 827 of file tests.py.

◆ inputCat

lsst.meas.base.tests.TransformTestCase.inputCat = self.mapper)

Definition at line 852 of file tests.py.

◆ name

str lsst.meas.base.tests.TransformTestCase.name = "MeasurementTransformTest"
static

Definition at line 804 of file tests.py.

◆ outputCat

lsst.meas.base.tests.TransformTestCase.outputCat

Definition at line 852 of file tests.py.

◆ singleFramePlugins

tuple lsst.meas.base.tests.TransformTestCase.singleFramePlugins = ()
static

Definition at line 826 of file tests.py.

◆ transformClass

lsst.meas.base.tests.TransformTestCase.transformClass = None
static

Definition at line 817 of file tests.py.


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