lsst.pipe.tasks  16.0-25-g9c0e765e+1
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask Class Reference

Detect sources on a coadd. More...

Inheritance diagram for lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask:
lsst.pipe.tasks.dcrMultiBand.DetectDcrCoaddSources

Public Member Functions

def getOutputDatasetTypes (cls, config)
 
def getInitOutputDatasetTypes (cls, config)
 
def __init__ (self, schema=None, kwargs)
 Initialize the task. More...
 
def getInitOutputDatasets (self)
 
def runDataRef (self, patchRef)
 Run detection on a coadd. More...
 
def adaptArgsAndRun (self, inputData, inputDataIds, outputDataIds)
 
def run (self, exposure, idFactory, expId)
 Run detection on an exposure. More...
 
def write (self, results, patchRef)
 Write out results from runDetection. More...
 

Public Attributes

 schema
 

Static Public Attributes

 ConfigClass = DetectCoaddSourcesConfig
 
 getSchemaCatalogs = _makeGetSchemaCatalogs("det")
 
 makeIdFactory = _makeMakeIdFactory("CoaddId")
 

Detailed Description

Detect sources on a coadd.

Contents

Description

Command-line task that detects sources on a coadd of exposures obtained with a single filter.

Coadding individual visits requires each exposure to be warped. This introduces covariance in the noise properties across pixels. Before detection, we correct the coadd variance by scaling the variance plane in the coadd to match the observed variance. This is an approximate approach – strictly, we should propagate the full covariance matrix – but it is simple and works well in practice.

After scaling the variance plane, we detect sources and generate footprints by delegating to the detection subtask.

Inputs:
deepCoadd{tract,patch,filter}: ExposureF
Outputs:
deepCoadd_det{tract,patch,filter}: SourceCatalog (only parent Footprints)
deepCoadd_calexp{tract,patch,filter}: Variance scaled, background-subtracted input exposure (ExposureF)
deepCoadd_calexp_background{tract,patch,filter}: BackgroundList
Data Unit:
tract, patch, filter

DetectCoaddSourcesTask delegates most of its work to the detection subtask. You can retarget this subtask if you wish.

Task initialization

Initialize the task. Create the detection subtask.

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

Parameters
[in]schemainitial schema for the output catalog, modified-in place to include all fields set by this task. If None, the source minimal schema will be used.
[in]**kwargskeyword arguments to be passed to lsst.pipe.base.task.Task.__init__

Invoking the Task

Run detection on an exposure. First scale the variance plane to match the observed variance using ScaleVarianceTask. Then invoke the detection subtask to detect sources.

Parameters
[in,out]exposureExposure on which to detect (may be backround-subtracted and scaled, depending on configuration).
[in]idFactoryIdFactory to set source identifiers
[in]expIdExposure identifier (integer) for RNG seed
Returns
a pipe.base.Struct with fields
  • sources: catalog of detections
  • backgrounds: list of backgrounds

Configuration parameters

See DetectSourcesConfig

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.

DetectCoaddSourcesTask has no debug variables of its own because it relegates all the work to SourceDetectionTask; see the documetation for SourceDetectionTask for further information.

A complete example

of using DetectCoaddSourcesTask

DetectCoaddSourcesTask is meant to be run after assembling a coadded image in a given band. The purpose of the task is to update the background, detect all sources in a single band and generate a set of parent footprints. Subsequent tasks in the multi-band processing procedure will merge sources across bands and, eventually, perform forced photometry. Command-line usage of DetectCoaddSourcesTask expects a data reference to the coadd to be processed. A list of the available optional arguments can be obtained by calling detectCoaddSources.py with the --help command line argument:

detectCoaddSources.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 followed steps 1 - 4 at pipeTasks_multiBand, one may detect all the sources in each coadd as follows:

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

that will process the HSC-I band data. The results are written to $CI_HSC_DIR/DATA/deepCoadd-results/HSC-I.

It is also necessary to run:

detectCoaddSources.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 processing procedure: MergeDetectionsTask.

Definition at line 179 of file multiBand.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.__init__ (   self,
  schema = None,
  kwargs 
)

Initialize the task.

Create the detection subtask.

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

Parameters
[in]schemainitial schema for the output catalog, modified-in place to include all fields set by this task. If None, the source minimal schema will be used.
[in]**kwargskeyword arguments to be passed to lsst.pipe.base.task.Task.__init__

Definition at line 300 of file multiBand.py.

Member Function Documentation

◆ adaptArgsAndRun()

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

Definition at line 340 of file multiBand.py.

◆ getInitOutputDatasets()

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

Definition at line 322 of file multiBand.py.

◆ getInitOutputDatasetTypes()

def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.getInitOutputDatasetTypes (   cls,
  config 
)

Definition at line 292 of file multiBand.py.

◆ getOutputDatasetTypes()

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

Definition at line 283 of file multiBand.py.

◆ run()

def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.run (   self,
  exposure,
  idFactory,
  expId 
)

Run detection on an exposure.

First scale the variance plane to match the observed variance using ScaleVarianceTask. Then invoke the detection subtask to detect sources.

Parameters
[in,out]exposureExposure on which to detect (may be backround-subtracted and scaled, depending on configuration).
[in]idFactoryIdFactory to set source identifiers
[in]expIdExposure identifier (integer) for RNG seed
Returns
a pipe.base.Struct with fields
  • sources: catalog of detections
  • backgrounds: list of backgrounds

Definition at line 346 of file multiBand.py.

◆ runDataRef()

def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.runDataRef (   self,
  patchRef 
)

Run detection on a coadd.

Invokes run and then uses write to output the results.

Parameters
[in]patchRefdata reference for patch

Definition at line 325 of file multiBand.py.

◆ write()

def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.write (   self,
  results,
  patchRef 
)

Write out results from runDetection.

Parameters
[in]exposureExposure to write out
[in]resultsStruct returned from runDetection
[in]patchRefdata reference for patch

Definition at line 378 of file multiBand.py.

Member Data Documentation

◆ ConfigClass

lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.ConfigClass = DetectCoaddSourcesConfig
static

Definition at line 271 of file multiBand.py.

◆ getSchemaCatalogs

lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.getSchemaCatalogs = _makeGetSchemaCatalogs("det")
static

Definition at line 272 of file multiBand.py.

◆ makeIdFactory

lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.makeIdFactory = _makeMakeIdFactory("CoaddId")
static

Definition at line 273 of file multiBand.py.

◆ schema

lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.schema

Definition at line 317 of file multiBand.py.


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