lsst.meas.base gdd9490a0bf+839504dd15
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 = baseNames or [self.name]
 

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 775 of file tests.py.

Member Function Documentation

◆ _checkOutput()

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

Definition at line 837 of file tests.py.

◆ _checkRegisteredTransform()

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

Definition at line 886 of file tests.py.

◆ _populateCatalog()

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

Definition at line 827 of file tests.py.

◆ _runTransform()

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

Definition at line 848 of file tests.py.

◆ setUp()

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

Definition at line 815 of file tests.py.

◆ tearDown()

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

Definition at line 820 of file tests.py.

◆ testRegistration()

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

Definition at line 891 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 853 of file tests.py.

Member Data Documentation

◆ _runTransform

lsst.meas.base.tests.TransformTestCase._runTransform = baseNames or [self.name]
protected

Definition at line 882 of file tests.py.

◆ algorithmClass

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

Definition at line 802 of file tests.py.

◆ calexp

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

Definition at line 817 of file tests.py.

◆ controlClass

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

Definition at line 801 of file tests.py.

◆ flagNames

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

Definition at line 805 of file tests.py.

◆ forcedPlugins

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

Definition at line 813 of file tests.py.

◆ inputCat

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

Definition at line 838 of file tests.py.

◆ name

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

Definition at line 790 of file tests.py.

◆ outputCat

lsst.meas.base.tests.TransformTestCase.outputCat

Definition at line 838 of file tests.py.

◆ singleFramePlugins

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

Definition at line 812 of file tests.py.

◆ transformClass

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

Definition at line 803 of file tests.py.


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