lsst.pipe.tasks  20.0.0-36-g96d5af2b+330d9ff9b7
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pipe.tasks.calibrate.CalibrateTask Class Reference

Calibrate an exposure: measure sources and perform astrometric and photometric calibration. More...

Inheritance diagram for lsst.pipe.tasks.calibrate.CalibrateTask:

Public Member Functions

def __init__ (self, butler=None, astromRefObjLoader=None, photoRefObjLoader=None, icSourceSchema=None, initInputs=None, **kwargs)
 Construct a CalibrateTask. More...
 
def runDataRef (self, dataRef, exposure=None, background=None, icSourceCat=None, doUnpersist=True)
 Calibrate an exposure, optionally unpersisting inputs and persisting outputs. More...
 
def runQuantum (self, butlerQC, inputRefs, outputRefs)
 
def run (self, exposure, exposureIdInfo=None, background=None, icSourceCat=None)
 Calibrate an exposure (science image or coadd) More...
 
def writeOutputs (self, dataRef, exposure, background, sourceCat, astromMatches, matchMeta)
 
def getSchemaCatalogs (self)
 
def setMetadata (self, exposure, photoRes=None)
 Set task and exposure metadata. More...
 
def copyIcSourceFields (self, icSourceCat, sourceCat)
 Match sources in icSourceCat and sourceCat and copy the specified fields. More...
 

Public Attributes

 schemaMapper
 
 calibSourceKey
 
 schema
 
 algMetadata
 
 skySourceKey
 
 pixelMargin
 
 outputSchema
 

Static Public Attributes

 ConfigClass
 
 RunnerClass
 

Detailed Description

Calibrate an exposure: measure sources and perform astrometric and photometric calibration.

Contents

Description

Given an exposure with a good PSF model and aperture correction map (e.g. as provided by LSST_task_documentation), perform the following operations:

Task initialisation

Construct a CalibrateTask.

Parameters
[in]butlerThe butler is passed to the refObjLoader constructor in case it is needed. Ignored if the refObjLoader argument provides a loader directly.
[in]astromRefObjLoaderAn instance of LoadReferenceObjectsTasks that supplies an external reference catalog for astrometric calibration. May be None if the desired loader can be constructed from the butler argument or all steps requiring a reference catalog are disabled.
[in]photoRefObjLoaderAn instance of LoadReferenceObjectsTasks that supplies an external reference catalog for photometric calibration. May be None if the desired loader can be constructed from the butler argument or all steps requiring a reference catalog are disabled.
[in]icSourceSchemaschema for icSource catalog, or None. Schema values specified in config.icSourceFieldsToCopy will be taken from this schema. If set to None, no values will be propagated from the icSourceCatalog
[in,out]kwargsother keyword arguments for lsst.pipe.base.CmdLineTask

Invoking the Task

If you want this task to unpersist inputs or persist outputs, then call the runDataRef method (a wrapper around the run method).

If you already have the inputs unpersisted and do not want to persist the output then it is more direct to call the run method:

Configuration parameters

See CalibrateConfig

Quantities set in exposure Metadata

Exposure metadata

MAGZERO_RMS
MAGZERO's RMS == sigma reported by photoCal task
MAGZERO_NOBJ
Number of stars used == ngood reported by photoCal task
COLORTERM1
?? (always 0.0)
COLORTERM2
?? (always 0.0)
COLORTERM3
?? (always 0.0)

Debug variables

The command line task interface supports a flag --debug to import debug.py from your $PYTHONPATH; see Using lsstDebug to control debugging output for more about debug.py.

CalibrateTask has a debug dictionary containing one key:

calibrate
frame (an int; <= 0 to not display) in which to display the exposure, sources and matches. See lsst::meas::astrom::displayAstrometry for the meaning of the various symbols.

For example, put something like:

import lsstDebug
def DebugInfo(name):
di = lsstDebug.getInfo(name) # N.b. lsstDebug.Info(name) would
# call us recursively
if name == "lsst.pipe.tasks.calibrate":
di.display = dict(
calibrate = 1,
)
return di
lsstDebug.Info = DebugInfo

into your debug.py file and run calibrateTask.py with the --debug flag.

Some subtasks may have their own debug variables; see individual Task documentation.

Definition at line 325 of file calibrate.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.calibrate.CalibrateTask.__init__ (   self,
  butler = None,
  astromRefObjLoader = None,
  photoRefObjLoader = None,
  icSourceSchema = None,
  initInputs = None,
**  kwargs 
)

Construct a CalibrateTask.

Parameters
[in]butlerThe butler is passed to the refObjLoader constructor in case it is needed. Ignored if the refObjLoader argument provides a loader directly.
[in]astromRefObjLoaderAn instance of LoadReferenceObjectsTasks that supplies an external reference catalog for astrometric calibration. May be None if the desired loader can be constructed from the butler argument or all steps requiring a reference catalog are disabled.
[in]photoRefObjLoaderAn instance of LoadReferenceObjectsTasks that supplies an external reference catalog for photometric calibration. May be None if the desired loader can be constructed from the butler argument or all steps requiring a reference catalog are disabled.
[in]icSourceSchemaschema for icSource catalog, or None. Schema values specified in config.icSourceFieldsToCopy will be taken from this schema. If set to None, no values will be propagated from the icSourceCatalog
[in,out]kwargsother keyword arguments for lsst.pipe.base.CmdLineTask

Definition at line 422 of file calibrate.py.

Member Function Documentation

◆ copyIcSourceFields()

def lsst.pipe.tasks.calibrate.CalibrateTask.copyIcSourceFields (   self,
  icSourceCat,
  sourceCat 
)

Match sources in icSourceCat and sourceCat and copy the specified fields.

Parameters
[in]icSourceCatcatalog from which to copy fields
[in,out]sourceCatcatalog to which to copy fields

The fields copied are those specified by config.icSourceFieldsToCopy that actually exist in the schema. This was set up by the constructor using self.schemaMapper.

Definition at line 875 of file calibrate.py.

◆ getSchemaCatalogs()

def lsst.pipe.tasks.calibrate.CalibrateTask.getSchemaCatalogs (   self)
Return a dict of empty catalogs for each catalog dataset produced
by this task.

Definition at line 834 of file calibrate.py.

◆ run()

def lsst.pipe.tasks.calibrate.CalibrateTask.run (   self,
  exposure,
  exposureIdInfo = None,
  background = None,
  icSourceCat = None 
)

Calibrate an exposure (science image or coadd)

Parameters
[in,out]exposureexposure to calibrate (an lsst.afw.image.ExposureF or similar); in:
  • MaskedImage
  • Psf out:
  • MaskedImage has background subtracted
  • Wcs is replaced
  • PhotoCalib is replaced
[in]exposureIdInfoID info for exposure (an lsst.obs.base.ExposureIdInfo) If not provided, returned SourceCatalog IDs will not be globally unique.
[in,out]backgroundbackground model already subtracted from exposure (an lsst.afw.math.BackgroundList). May be None if no background has been subtracted, though that is unusual for calibration. A refined background model is output.
[in]icSourceCatA SourceCatalog from CharacterizeImageTask from which we can copy some fields.
Returns
pipe_base Struct containing these fields:
  • exposure calibrate science exposure with refined WCS and PhotoCalib
  • background model of background subtracted from exposure (an lsst.afw.math.BackgroundList)
  • sourceCat catalog of measured sources
  • astromMatches list of source/refObj matches from the astrometry solver

Definition at line 640 of file calibrate.py.

◆ runDataRef()

def lsst.pipe.tasks.calibrate.CalibrateTask.runDataRef (   self,
  dataRef,
  exposure = None,
  background = None,
  icSourceCat = None,
  doUnpersist = True 
)

Calibrate an exposure, optionally unpersisting inputs and persisting outputs.

This is a wrapper around the run method that unpersists inputs (if doUnpersist true) and persists outputs (if config.doWrite true)

Parameters
[in]dataRefbutler data reference corresponding to a science image
[in,out]exposurecharacterized exposure (an lsst.afw.image.ExposureF or similar), or None to unpersist existing icExp and icBackground. See run method for details of what is read and written.
[in,out]backgroundinitial model of background already subtracted from exposure (an lsst.afw.math.BackgroundList). May be None if no background has been subtracted, though that is unusual for calibration. A refined background model is output. Ignored if exposure is None.
[in]icSourceCatcatalog from which to copy the fields specified by icSourceKeys, or None;
[in]doUnpersistunpersist data:
  • if True, exposure, background and icSourceCat are read from dataRef and those three arguments must all be None;
  • if False the exposure must be provided; background and icSourceCat are optional. True is intended for running as a command-line task, False for running as a subtask
Returns
same data as the calibrate method

Definition at line 542 of file calibrate.py.

◆ runQuantum()

def lsst.pipe.tasks.calibrate.CalibrateTask.runQuantum (   self,
  butlerQC,
  inputRefs,
  outputRefs 
)

Definition at line 605 of file calibrate.py.

◆ setMetadata()

def lsst.pipe.tasks.calibrate.CalibrateTask.setMetadata (   self,
  exposure,
  photoRes = None 
)

Set task and exposure metadata.

Logs a warning and continues if needed data is missing.

Parameters
[in,out]exposureexposure whose metadata is to be set
[in]photoResresults of running photoCal; if None then it was not run

Definition at line 842 of file calibrate.py.

◆ writeOutputs()

def lsst.pipe.tasks.calibrate.CalibrateTask.writeOutputs (   self,
  dataRef,
  exposure,
  background,
  sourceCat,
  astromMatches,
  matchMeta 
)
Write output data to the output repository

@param[in] dataRef  butler data reference corresponding to a science
    image
@param[in] exposure  exposure to write
@param[in] background  background model for exposure
@param[in] sourceCat  catalog of measured sources
@param[in] astromMatches  list of source/refObj matches from the
    astrometry solver

Definition at line 810 of file calibrate.py.

Member Data Documentation

◆ algMetadata

lsst.pipe.tasks.calibrate.CalibrateTask.algMetadata

Definition at line 491 of file calibrate.py.

◆ calibSourceKey

lsst.pipe.tasks.calibrate.CalibrateTask.calibSourceKey

Definition at line 465 of file calibrate.py.

◆ ConfigClass

lsst.pipe.tasks.calibrate.CalibrateTask.ConfigClass
static

Definition at line 418 of file calibrate.py.

◆ outputSchema

lsst.pipe.tasks.calibrate.CalibrateTask.outputSchema

Definition at line 537 of file calibrate.py.

◆ pixelMargin

lsst.pipe.tasks.calibrate.CalibrateTask.pixelMargin

Definition at line 515 of file calibrate.py.

◆ RunnerClass

lsst.pipe.tasks.calibrate.CalibrateTask.RunnerClass
static

Definition at line 420 of file calibrate.py.

◆ schema

lsst.pipe.tasks.calibrate.CalibrateTask.schema

Definition at line 485 of file calibrate.py.

◆ schemaMapper

lsst.pipe.tasks.calibrate.CalibrateTask.schemaMapper

Definition at line 456 of file calibrate.py.

◆ skySourceKey

lsst.pipe.tasks.calibrate.CalibrateTask.skySourceKey

Definition at line 503 of file calibrate.py.


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