lsst.pipe.tasks  17.0.1-21-g52d92e20+2
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask Class Reference

Deblend sources from master catalog in each coadd seperately and measure. More...

Inheritance diagram for lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask:
lsst.pipe.tasks.dcrMultiBand.MeasureMergedDcrCoaddSourcesTask

Public Member Functions

def __init__ (self, butler=None, schema=None, peakSchema=None, refObjLoader=None, initInputs=None, kwargs)
 Initialize the task. More...
 
def getInputDatasetTypes (cls, config)
 
def getOutputDatasetTypes (cls, config)
 
def getPrerequisiteDatasetTypes (cls, config)
 
def getInitOutputDatasets (self)
 
def adaptArgsAndRun (self, inputData, inputDataIds, outputDataIds, butler)
 
def runDataRef (self, patchRef, psfCache=100)
 Deblend and measure. More...
 
def run (self, exposure, sources, skyInfo, exposureId, ccdInputs=None, visitCatalogs=None, wcsUpdates=None, butler=None)
 
def readSources (self, dataRef)
 Read input sources. More...
 
def writeMatches (self, dataRef, results)
 Write matches of the sources to the astrometric reference catalog. More...
 
def write (self, dataRef, sources)
 Write the source catalog. More...
 
def getExposureId (self, dataRef)
 

Public Attributes

 deblended
 
 inputCatalog
 
 schemaMapper
 
 schema
 
 algMetadata
 

Static Public Attributes

 ConfigClass = MeasureMergedCoaddSourcesConfig
 
 RunnerClass = MeasureMergedCoaddSourcesRunner
 
 getSchemaCatalogs = _makeGetSchemaCatalogs("meas")
 
 makeIdFactory = _makeMakeIdFactory("MergedCoaddId")
 

Detailed Description

Deblend sources from master catalog in each coadd seperately and measure.

Contents

Description

Command-line task that uses peaks and footprints from a master catalog to perform deblending and measurement in each coadd.

Given a master input catalog of sources (peaks and footprints) or deblender outputs (including a HeavyFootprint in each band), measure each source on the coadd. Repeating this procedure with the same master catalog across multiple coadds will generate a consistent set of child sources.

The deblender retains all peaks and deblends any missing peaks (dropouts in that band) as PSFs. Source properties are measured and the is-primary flag (indicating sources with no children) is set. Visit flags are propagated to the coadd sources.

Optionally, we can match the coadd sources to an external reference catalog.

Inputs:
deepCoadd_mergeDet{tract,patch} or deepCoadd_deblend{tract,patch}: SourceCatalog
deepCoadd_calexp{tract,patch,filter}: ExposureF
Outputs:
deepCoadd_meas{tract,patch,filter}: SourceCatalog
Data Unit:
tract, patch, filter

MeasureMergedCoaddSourcesTask delegates most of its work to a set of sub-tasks:

measurement
Measure source properties of deblended sources.
setPrimaryFlags
Set flag 'is-primary' as well as related flags on sources. 'is-primary' is set for sources that are not at the edge of the field and that have either not been deblended or are the children of deblended sources
propagateFlags
Propagate flags set in individual visits to the coadd.
match
Match input sources to a reference catalog (optional).

These subtasks may be retargeted as required.

Task initialization

Initialize the task. Keyword arguments (in addition to those forwarded to CmdLineTask.__init__):

Parameters
[in]schemathe schema of the merged detection catalog used as input to this one
[in]peakSchemathe schema of the PeakRecords in the Footprints in the merged detection catalog
[in]refObjLoaderan instance of LoadReferenceObjectsTasks that supplies an external reference catalog. May be None if the loader can be constructed from the butler argument or all steps requiring a reference catalog are disabled.
[in]butlera butler used to read the input schemas from disk or construct the reference catalog loader, if schema or peakSchema or refObjLoader is None

The task will set its own self.schema attribute to the schema of the output measurement catalog. This will include all fields from the input schema, as well as additional fields for all the measurements.

Invoking the Task

Run measurement algorithms on the input exposure, and optionally populate the
resulting catalog with extra information.

Parameters
----------
exposure : `lsst.afw.exposure.Exposure`
    The input exposure on which measurements are to be performed
sources :  `lsst.afw.table.SourceCatalog`
    A catalog built from the results of merged detections, or
    deblender outputs.
skyInfo : `lsst.pipe.base.Struct`
    A struct containing information about the position of the input exposure within
    a `SkyMap`, the `SkyMap`, its `Wcs`, and its bounding box
exposureId : `int` or `bytes`
    packed unique number or bytes unique to the input exposure
ccdInputs : `lsst.afw.table.ExposureCatalog`
    Catalog containing information on the individual visits which went into making
    the exposure
visitCatalogs : list of `lsst.afw.table.SourceCatalogs` or `None`
    A list of source catalogs corresponding to measurements made on the individual
    visits which went into the input exposure. If None and butler is `None` then
    the task cannot propagate visit flags to the output catalog.
wcsUpdates : list of `lsst.afw.geom.SkyWcs` or `None`
    If visitCatalogs is not `None` this should be a list of wcs objects which correspond
    to the input visits. Used to put all coordinates to common system. If `None` and
    butler is `None` then the task cannot propagate visit flags to the output catalog.
butler : `lsst.daf.butler.Butler` or `lsst.daf.persistence.Butler`
    Either a gen2 or gen3 butler used to load visit catalogs

Returns
-------
results : `lsst.pipe.base.Struct`
    Results of running measurement task. Will contain the catalog in the
    sources attribute. Optionally will have results of matching to a
    reference catalog in the matchResults attribute, and denormalized
    matches in the denormMatches attribute.

Configuration parameters

See MeasureMergedCoaddSourcesConfig_

Debug variables

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

MeasureMergedCoaddSourcesTask has no debug variables of its own because it delegates all the work to the various sub-tasks. See the documetation for individual sub-tasks for more information.

A complete example of using

MeasureMergedCoaddSourcesTask

After MeasureMergedCoaddSourcesTask has been run on multiple coadds, we have a set of per-band catalogs. The next stage in the multi-band processing procedure will merge these measurements into a suitable catalog for driving forced photometry.

Command-line usage of MeasureMergedCoaddSourcesTask expects a data reference to the coadds to be processed. A list of the available optional arguments can be obtained by calling measureCoaddSources.py with the --help command line argument:

measureCoaddSources.py --help

To demonstrate usage of the DetectCoaddSourcesTask in the larger context of multi-band processing, we will process HSC data in the ci_hsc package. Assuming one has finished step 6 at pipeTasks_multiBand, one may perform deblending and measure sources in the HSC-I band coadd as follows:

measureCoaddSources.py $CI_HSC_DIR/DATA --id patch=5,4 tract=0 filter=HSC-I

This will process the HSC-I band data. The results are written in `$CI_HSC_DIR/DATA/deepCoadd-results/HSC-I/0/5,4/meas-HSC-I-0-5,4.fits

It is also necessary to run

measureCoaddSources.py $CI_HSC_DIR/DATA --id patch=5,4 tract=0 filter=HSC-R

to generate the sources catalogs for the HSC-R band required by the next step in the multi-band procedure: MergeMeasurementsTask.

Definition at line 721 of file multiBand.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.__init__ (   self,
  butler = None,
  schema = None,
  peakSchema = None,
  refObjLoader = None,
  initInputs = None,
  kwargs 
)

Initialize the task.

Keyword arguments (in addition to those forwarded to CmdLineTask.__init__):

Parameters
[in]schemathe schema of the merged detection catalog used as input to this one
[in]peakSchemathe schema of the PeakRecords in the Footprints in the merged detection catalog
[in]refObjLoaderan instance of LoadReferenceObjectsTasks that supplies an external reference catalog. May be None if the loader can be constructed from the butler argument or all steps requiring a reference catalog are disabled.
[in]butlera butler used to read the input schemas from disk or construct the reference catalog loader, if schema or peakSchema or refObjLoader is None

The task will set its own self.schema attribute to the schema of the output measurement catalog. This will include all fields from the input schema, as well as additional fields for all the measurements.

Definition at line 846 of file multiBand.py.

Member Function Documentation

◆ adaptArgsAndRun()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.adaptArgsAndRun (   self,
  inputData,
  inputDataIds,
  outputDataIds,
  butler 
)

Definition at line 910 of file multiBand.py.

◆ getExposureId()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.getExposureId (   self,
  dataRef 
)

Definition at line 1120 of file multiBand.py.

◆ getInitOutputDatasets()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.getInitOutputDatasets (   self)

Definition at line 907 of file multiBand.py.

◆ getInputDatasetTypes()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.getInputDatasetTypes (   cls,
  config 
)

Definition at line 888 of file multiBand.py.

◆ getOutputDatasetTypes()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.getOutputDatasetTypes (   cls,
  config 
)

Definition at line 895 of file multiBand.py.

◆ getPrerequisiteDatasetTypes()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.getPrerequisiteDatasetTypes (   cls,
  config 
)

Definition at line 904 of file multiBand.py.

◆ readSources()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.readSources (   self,
  dataRef 
)

Read input sources.

Parameters
[in]dataRefData reference for catalog of merged detections
Returns
List of sources in merged catalog

We also need to add columns to hold the measurements we're about to make so we can measure in-place.

Definition at line 1078 of file multiBand.py.

◆ run()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.run (   self,
  exposure,
  sources,
  skyInfo,
  exposureId,
  ccdInputs = None,
  visitCatalogs = None,
  wcsUpdates = None,
  butler = None 
)
Run measurement algorithms on the input exposure, and optionally populate the
resulting catalog with extra information.

Parameters
----------
exposure : `lsst.afw.exposure.Exposure`
    The input exposure on which measurements are to be performed
sources :  `lsst.afw.table.SourceCatalog`
    A catalog built from the results of merged detections, or
    deblender outputs.
skyInfo : `lsst.pipe.base.Struct`
    A struct containing information about the position of the input exposure within
    a `SkyMap`, the `SkyMap`, its `Wcs`, and its bounding box
exposureId : `int` or `bytes`
    packed unique number or bytes unique to the input exposure
ccdInputs : `lsst.afw.table.ExposureCatalog`
    Catalog containing information on the individual visits which went into making
    the exposure
visitCatalogs : list of `lsst.afw.table.SourceCatalogs` or `None`
    A list of source catalogs corresponding to measurements made on the individual
    visits which went into the input exposure. If None and butler is `None` then
    the task cannot propagate visit flags to the output catalog.
wcsUpdates : list of `lsst.afw.geom.SkyWcs` or `None`
    If visitCatalogs is not `None` this should be a list of wcs objects which correspond
    to the input visits. Used to put all coordinates to common system. If `None` and
    butler is `None` then the task cannot propagate visit flags to the output catalog.
butler : `lsst.daf.butler.Butler` or `lsst.daf.persistence.Butler`
    Either a gen2 or gen3 butler used to load visit catalogs

Returns
-------
results : `lsst.pipe.base.Struct`
    Results of running measurement task. Will contain the catalog in the
    sources attribute. Optionally will have results of matching to a
    reference catalog in the matchResults attribute, and denormalized
    matches in the denormMatches attribute.

Definition at line 1003 of file multiBand.py.

◆ runDataRef()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.runDataRef (   self,
  patchRef,
  psfCache = 100 
)

Deblend and measure.

Parameters
[in]patchRefPatch reference.

Set 'is-primary' and related flags. Propagate flags from individual visits. Optionally match the sources to a reference catalog and write the matches. Finally, write the deblended sources and measurements out.

Definition at line 971 of file multiBand.py.

◆ write()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.write (   self,
  dataRef,
  sources 
)

Write the source catalog.

Parameters
[in]dataRefdata reference
[in]sourcessource catalog

Definition at line 1110 of file multiBand.py.

◆ writeMatches()

def lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.writeMatches (   self,
  dataRef,
  results 
)

Write matches of the sources to the astrometric reference catalog.

Parameters
[in]dataRefdata reference
[in]resultsresults struct from run method

Definition at line 1098 of file multiBand.py.

Member Data Documentation

◆ algMetadata

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.algMetadata

Definition at line 874 of file multiBand.py.

◆ ConfigClass

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.ConfigClass = MeasureMergedCoaddSourcesConfig
static

Definition at line 831 of file multiBand.py.

◆ deblended

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.deblended

Definition at line 864 of file multiBand.py.

◆ getSchemaCatalogs

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.getSchemaCatalogs = _makeGetSchemaCatalogs("meas")
static

Definition at line 833 of file multiBand.py.

◆ inputCatalog

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.inputCatalog

Definition at line 865 of file multiBand.py.

◆ makeIdFactory

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.makeIdFactory = _makeMakeIdFactory("MergedCoaddId")
static

Definition at line 834 of file multiBand.py.

◆ RunnerClass

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.RunnerClass = MeasureMergedCoaddSourcesRunner
static

Definition at line 832 of file multiBand.py.

◆ schema

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.schema

Definition at line 873 of file multiBand.py.

◆ schemaMapper

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.schemaMapper

Definition at line 871 of file multiBand.py.


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