LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Static Public Attributes | List of all members
lsst.meas.base.tests.AlgorithmTestCase Class Reference
Inheritance diagram for lsst.meas.base.tests.AlgorithmTestCase:
lsst.utils.tests.TestCase

Public Member Functions

def setUpClass
 
def makeSingleFrameMeasurementConfig
 
def makeSingleFrameMeasurementTask
 
def makeForcedMeasurementConfig
 
def makeForcedMeasurementTask
 

Static Public Attributes

int randomSeed = 1234
 

Detailed Description

Definition at line 462 of file tests.py.

Member Function Documentation

def lsst.meas.base.tests.AlgorithmTestCase.makeForcedMeasurementConfig (   self,
  plugin = None,
  dependencies = () 
)
Convenience function to create a Config instance for ForcedMeasurementTask

In addition to the plugins specified in the plugin and dependencies arguments,
the TransformedCentroid and TransformedShape plugins will be run and used as the
Centroid and Shape slots; these simply transform the reference catalog centroid
and shape to the measurement coordinate system.

Definition at line 512 of file tests.py.

513  def makeForcedMeasurementConfig(self, plugin=None, dependencies=()):
514  """Convenience function to create a Config instance for ForcedMeasurementTask
515 
516  In addition to the plugins specified in the plugin and dependencies arguments,
517  the TransformedCentroid and TransformedShape plugins will be run and used as the
518  Centroid and Shape slots; these simply transform the reference catalog centroid
519  and shape to the measurement coordinate system.
520  """
521  config = ForcedMeasurementTask.ConfigClass()
522  config.slots.centroid = "base_TransformedCentroid"
523  config.slots.shape = "base_TransformedShape"
524  config.slots.modelFlux = None
525  config.slots.apFlux = None
526  config.slots.psfFlux = None
527  config.slots.instFlux = None
528  config.plugins.names = (plugin,) + tuple(dependencies) + ("base_TransformedCentroid",
529  "base_TransformedShape")
530  return config
def lsst.meas.base.tests.AlgorithmTestCase.makeForcedMeasurementTask (   self,
  plugin = None,
  dependencies = (),
  config = None,
  refSchema = None,
  algMetadata = None 
)
Convenience function to create a ForcedMeasurementTask with a simple configuration.

Definition at line 532 of file tests.py.

533  algMetadata=None):
534  """Convenience function to create a ForcedMeasurementTask with a simple configuration.
535  """
536  if config is None:
537  if plugin is None:
538  raise ValueError("Either plugin or config argument must not be None")
539  config = self.makeForcedMeasurementConfig(plugin=plugin, dependencies=dependencies)
540  if refSchema is None:
541  refSchema = TestDataset.makeMinimalSchema()
542  if algMetadata is None:
543  algMetadata = lsst.daf.base.PropertyList()
544  return ForcedMeasurementTask(refSchema=refSchema, algMetadata=algMetadata, config=config)
545 
Class for storing ordered metadata with comments.
Definition: PropertyList.h:81
def lsst.meas.base.tests.AlgorithmTestCase.makeSingleFrameMeasurementConfig (   self,
  plugin = None,
  dependencies = () 
)
Convenience function to create a Config instance for SingleFrameMeasurementTask

The plugin and its dependencies will be the only plugins run, while the Centroid, Shape,
and ModelFlux slots will be set to the truth fields generated by the TestDataset class.

Definition at line 478 of file tests.py.

479  def makeSingleFrameMeasurementConfig(self, plugin=None, dependencies=()):
480  """Convenience function to create a Config instance for SingleFrameMeasurementTask
481 
482  The plugin and its dependencies will be the only plugins run, while the Centroid, Shape,
483  and ModelFlux slots will be set to the truth fields generated by the TestDataset class.
484  """
485  config = SingleFrameMeasurementTask.ConfigClass()
486  config.slots.centroid = "truth"
487  config.slots.shape = "truth"
488  config.slots.modelFlux = None
489  config.slots.apFlux = None
490  config.slots.psfFlux = None
491  config.slots.instFlux = None
492  config.slots.calibFlux = None
493  config.plugins.names = (plugin,) + tuple(dependencies)
494  return config
def lsst.meas.base.tests.AlgorithmTestCase.makeSingleFrameMeasurementTask (   self,
  plugin = None,
  dependencies = (),
  config = None,
  schema = None,
  algMetadata = None 
)
Convenience function to create a SingleFrameMeasurementTask with a simple configuration.

Definition at line 496 of file tests.py.

497  algMetadata=None):
498  """Convenience function to create a SingleFrameMeasurementTask with a simple configuration.
499  """
500  if config is None:
501  if plugin is None:
502  raise ValueError("Either plugin or config argument must not be None")
503  config = self.makeSingleFrameMeasurementConfig(plugin=plugin, dependencies=dependencies)
504  if schema is None:
505  schema = TestDataset.makeMinimalSchema()
506  # Clear all aliases so only those defined by config are set.
507  schema.setAliasMap(None)
508  if algMetadata is None:
509  algMetadata = lsst.daf.base.PropertyList()
510  return SingleFrameMeasurementTask(schema=schema, algMetadata=algMetadata, config=config)
511 
Class for storing ordered metadata with comments.
Definition: PropertyList.h:81
def lsst.meas.base.tests.AlgorithmTestCase.setUpClass (   cls)

Definition at line 475 of file tests.py.

476  def setUpClass(cls):
477  numpy.random.seed(cls.randomSeed)

Member Data Documentation

int lsst.meas.base.tests.AlgorithmTestCase.randomSeed = 1234
static

Definition at line 472 of file tests.py.


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