LSSTApplications  17.0+10,17.0+52,17.0+91,18.0.0+11,18.0.0+16,18.0.0+38,18.0.0+4,18.0.0-2-ge43143a+8,18.1.0-1-g0001055+4,18.1.0-1-g1349e88+13,18.1.0-1-g2505f39+10,18.1.0-1-g380d4d4+13,18.1.0-1-g5315e5e,18.1.0-1-g5e4b7ea+4,18.1.0-1-g7e8fceb,18.1.0-1-g85f8cd4+10,18.1.0-1-g9a6769a+4,18.1.0-1-ga1a4c1a+9,18.1.0-1-gd55f500+5,18.1.0-1-ge10677a+10,18.1.0-11-gb2589d7b,18.1.0-13-g451e75588+2,18.1.0-13-gbfe7f7f+4,18.1.0-14-g2e73c10+1,18.1.0-2-g31c43f9+10,18.1.0-2-g919ecaf,18.1.0-2-g9c63283+13,18.1.0-2-gdf0b915+13,18.1.0-2-gfefb8b5+2,18.1.0-3-g52aa583+4,18.1.0-3-g8f4a2b1+4,18.1.0-3-g9cb968e+12,18.1.0-3-gab23065,18.1.0-4-g7bbbad0+4,18.1.0-5-g510c42a+12,18.1.0-5-gaeab27e+13,18.1.0-6-gc4bdb98+2,18.1.0-6-gdda7f3e+15,18.1.0-9-g9613d271+1,w.2019.34
LSSTDataManagementBasePackage
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 748 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 873 of file multiBand.py.

873  **kwargs):
874  """!
875  @brief Initialize the task.
876 
877  Keyword arguments (in addition to those forwarded to CmdLineTask.__init__):
878  @param[in] schema: the schema of the merged detection catalog used as input to this one
879  @param[in] peakSchema: the schema of the PeakRecords in the Footprints in the merged detection catalog
880  @param[in] refObjLoader: an instance of LoadReferenceObjectsTasks that supplies an external reference
881  catalog. May be None if the loader can be constructed from the butler argument or all steps
882  requiring a reference catalog are disabled.
883  @param[in] butler: a butler used to read the input schemas from disk or construct the reference
884  catalog loader, if schema or peakSchema or refObjLoader is None
885 
886  The task will set its own self.schema attribute to the schema of the output measurement catalog.
887  This will include all fields from the input schema, as well as additional fields for all the
888  measurements.
889  """
890  super().__init__(**kwargs)
891  self.deblended = self.config.inputCatalog.startswith("deblended")
892  self.inputCatalog = "Coadd_" + self.config.inputCatalog
893  if initInputs is not None:
894  schema = initInputs['inputSchema'].schema
895  if schema is None:
896  assert butler is not None, "Neither butler nor schema is defined"
897  schema = butler.get(self.config.coaddName + self.inputCatalog + "_schema", immediate=True).schema
898  self.schemaMapper = afwTable.SchemaMapper(schema)
899  self.schemaMapper.addMinimalSchema(schema)
900  self.schema = self.schemaMapper.getOutputSchema()
901  self.algMetadata = PropertyList()
902  self.makeSubtask("measurement", schema=self.schema, algMetadata=self.algMetadata)
903  self.makeSubtask("setPrimaryFlags", schema=self.schema)
904  if self.config.doMatchSources:
905  self.makeSubtask("match", butler=butler, refObjLoader=refObjLoader)
906  if self.config.doPropagateFlags:
907  self.makeSubtask("propagateFlags", schema=self.schema)
908  self.schema.checkUnits(parse_strict=self.config.checkUnitsParseStrict)
909  if self.config.doApCorr:
910  self.makeSubtask("applyApCorr", schema=self.schema)
911  if self.config.doRunCatalogCalculation:
912  self.makeSubtask("catalogCalculation", schema=self.schema)
913 
A mapping between the keys of two Schemas, used to copy data between them.
Definition: SchemaMapper.h:21
def __init__(self, minimum, dataRange, Q)

Member Function Documentation

◆ adaptArgsAndRun()

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

Definition at line 937 of file multiBand.py.

937  def adaptArgsAndRun(self, inputData, inputDataIds, outputDataIds, butler):
938  refObjLoader = ReferenceObjectLoader(inputDataIds['refCat'], butler,
939  config=self.config.refObjLoader, log=self.log)
940  self.match.setRefObjLoader(refObjLoader)
941 
942  # Set psfcache
943  # move this to run after gen2 deprecation
944  inputData['exposure'].getPsf().setCacheCapacity(self.config.psfCache)
945 
946  # Get unique integer ID for IdFactory and RNG seeds
947  packedId, maxBits = butler.registry.packDataId("tract_patch", outputDataIds["outputSources"],
948  returnMaxBits=True)
949  inputData['exposureId'] = packedId
950  idFactory = afwTable.IdFactory.makeSource(packedId, 64 - maxBits)
951  # Transform inputCatalog
952  table = afwTable.SourceTable.make(self.schema, idFactory)
953  sources = afwTable.SourceCatalog(table)
954  sources.extend(inputData.pop('intakeCatalog'), self.schemaMapper)
955  table = sources.getTable()
956  table.setMetadata(self.algMetadata) # Capture algorithm metadata to write out to the source catalog.
957  inputData['sources'] = sources
958 
959  skyMap = inputData.pop('skyMap')
960  tractNumber = inputDataIds['intakeCatalog']['tract']
961  tractInfo = skyMap[tractNumber]
962  patchInfo = tractInfo.getPatchInfo(inputDataIds['intakeCatalog']['patch'])
963  skyInfo = Struct(
964  skyMap=skyMap,
965  tractInfo=tractInfo,
966  patchInfo=patchInfo,
967  wcs=tractInfo.getWcs(),
968  bbox=patchInfo.getOuterBBox()
969  )
970  inputData['skyInfo'] = skyInfo
971 
972  if self.config.doPropagateFlags:
973  # Filter out any visit catalog that is not coadd inputs
974  ccdInputs = inputData['exposure'].getInfo().getCoaddInputs().ccds
975  visitKey = ccdInputs.schema.find("visit").key
976  ccdKey = ccdInputs.schema.find("ccd").key
977  inputVisitIds = set()
978  ccdRecordsWcs = {}
979  for ccdRecord in ccdInputs:
980  visit = ccdRecord.get(visitKey)
981  ccd = ccdRecord.get(ccdKey)
982  inputVisitIds.add((visit, ccd))
983  ccdRecordsWcs[(visit, ccd)] = ccdRecord.getWcs()
984 
985  inputCatalogsToKeep = []
986  inputCatalogWcsUpdate = []
987  for i, dataId in enumerate(inputDataIds['visitCatalogs']):
988  key = (dataId['visit'], dataId['detector'])
989  if key in inputVisitIds:
990  inputCatalogsToKeep.append(inputData['visitCatalogs'][i])
991  inputCatalogWcsUpdate.append(ccdRecordsWcs[key])
992  inputData['visitCatalogs'] = inputCatalogsToKeep
993  inputData['wcsUpdates'] = inputCatalogWcsUpdate
994  inputData['ccdInputs'] = ccdInputs
995 
996  return self.run(**inputData)
997 
daf::base::PropertySet * set
Definition: fits.cc:884

◆ getExposureId()

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

Definition at line 1159 of file multiBand.py.

1159  def getExposureId(self, dataRef):
1160  return int(dataRef.get(self.config.coaddName + "CoaddId"))

◆ getInitOutputDatasets()

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

Definition at line 934 of file multiBand.py.

934  def getInitOutputDatasets(self):
935  return {"outputSchema": afwTable.SourceCatalog(self.schema)}
936 

◆ getInputDatasetTypes()

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

Definition at line 915 of file multiBand.py.

915  def getInputDatasetTypes(cls, config):
916  inputDatasetTypes = super().getInputDatasetTypes(config)
917  if not config.doPropagateFlags:
918  inputDatasetTypes.pop("visitCatalogs")
919  return inputDatasetTypes
920 

◆ getOutputDatasetTypes()

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

Definition at line 922 of file multiBand.py.

922  def getOutputDatasetTypes(cls, config):
923  outputDatasetTypes = super().getOutputDatasetTypes(config)
924  if config.doMatchSources is False:
925  outputDatasetTypes.pop("matchResult")
926  if config.doWriteMatchesDenormalized is False:
927  outputDatasetTypes.pop("denormMatches")
928  return outputDatasetTypes
929 

◆ getPrerequisiteDatasetTypes()

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

Definition at line 931 of file multiBand.py.

931  def getPrerequisiteDatasetTypes(cls, config):
932  return frozenset(["refCat"])
933 

◆ 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 1117 of file multiBand.py.

1117  def readSources(self, dataRef):
1118  """!
1119  @brief Read input sources.
1120 
1121  @param[in] dataRef: Data reference for catalog of merged detections
1122  @return List of sources in merged catalog
1123 
1124  We also need to add columns to hold the measurements we're about to make
1125  so we can measure in-place.
1126  """
1127  merged = dataRef.get(self.config.coaddName + self.inputCatalog, immediate=True)
1128  self.log.info("Read %d detections: %s" % (len(merged), dataRef.dataId))
1129  idFactory = self.makeIdFactory(dataRef)
1130  for s in merged:
1131  idFactory.notify(s.getId())
1132  table = afwTable.SourceTable.make(self.schema, idFactory)
1133  sources = afwTable.SourceCatalog(table)
1134  sources.extend(merged, self.schemaMapper)
1135  return sources
1136 

◆ 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 1034 of file multiBand.py.

1034  butler=None):
1035  """Run measurement algorithms on the input exposure, and optionally populate the
1036  resulting catalog with extra information.
1037 
1038  Parameters
1039  ----------
1040  exposure : `lsst.afw.exposure.Exposure`
1041  The input exposure on which measurements are to be performed
1042  sources : `lsst.afw.table.SourceCatalog`
1043  A catalog built from the results of merged detections, or
1044  deblender outputs.
1045  skyInfo : `lsst.pipe.base.Struct`
1046  A struct containing information about the position of the input exposure within
1047  a `SkyMap`, the `SkyMap`, its `Wcs`, and its bounding box
1048  exposureId : `int` or `bytes`
1049  packed unique number or bytes unique to the input exposure
1050  ccdInputs : `lsst.afw.table.ExposureCatalog`
1051  Catalog containing information on the individual visits which went into making
1052  the exposure
1053  visitCatalogs : list of `lsst.afw.table.SourceCatalogs` or `None`
1054  A list of source catalogs corresponding to measurements made on the individual
1055  visits which went into the input exposure. If None and butler is `None` then
1056  the task cannot propagate visit flags to the output catalog.
1057  wcsUpdates : list of `lsst.afw.geom.SkyWcs` or `None`
1058  If visitCatalogs is not `None` this should be a list of wcs objects which correspond
1059  to the input visits. Used to put all coordinates to common system. If `None` and
1060  butler is `None` then the task cannot propagate visit flags to the output catalog.
1061  butler : `lsst.daf.butler.Butler` or `lsst.daf.persistence.Butler`
1062  Either a gen2 or gen3 butler used to load visit catalogs
1063 
1064  Returns
1065  -------
1066  results : `lsst.pipe.base.Struct`
1067  Results of running measurement task. Will contain the catalog in the
1068  sources attribute. Optionally will have results of matching to a
1069  reference catalog in the matchResults attribute, and denormalized
1070  matches in the denormMatches attribute.
1071  """
1072  self.measurement.run(sources, exposure, exposureId=exposureId)
1073 
1074  if self.config.doApCorr:
1075  self.applyApCorr.run(
1076  catalog=sources,
1077  apCorrMap=exposure.getInfo().getApCorrMap()
1078  )
1079 
1080  # TODO DM-11568: this contiguous check-and-copy could go away if we
1081  # reserve enough space during SourceDetection and/or SourceDeblend.
1082  # NOTE: sourceSelectors require contiguous catalogs, so ensure
1083  # contiguity now, so views are preserved from here on.
1084  if not sources.isContiguous():
1085  sources = sources.copy(deep=True)
1086 
1087  if self.config.doRunCatalogCalculation:
1088  self.catalogCalculation.run(sources)
1089 
1090  self.setPrimaryFlags.run(sources, skyInfo.skyMap, skyInfo.tractInfo, skyInfo.patchInfo,
1091  includeDeblend=self.deblended)
1092  if self.config.doPropagateFlags:
1093  self.propagateFlags.run(butler, sources, ccdInputs, exposure.getWcs(), visitCatalogs, wcsUpdates)
1094 
1095  results = Struct()
1096 
1097  if self.config.doMatchSources:
1098  matchResult = self.match.run(sources, exposure.getInfo().getFilter().getName())
1099  matches = afwTable.packMatches(matchResult.matches)
1100  matches.table.setMetadata(matchResult.matchMeta)
1101  results.matchResult = matches
1102  if self.config.doWriteMatchesDenormalized:
1103  if matchResult.matches:
1104  denormMatches = denormalizeMatches(matchResult.matches, matchResult.matchMeta)
1105  else:
1106  self.log.warn("No matches, so generating dummy denormalized matches file")
1107  denormMatches = afwTable.BaseCatalog(afwTable.Schema())
1108  denormMatches.setMetadata(PropertyList())
1109  denormMatches.getMetadata().add("COMMENT",
1110  "This catalog is empty because no matches were found.")
1111  results.denormMatches = denormMatches
1112  results.denormMatches = denormMatches
1113 
1114  results.outputSources = sources
1115  return results
1116 
Defines the fields and offsets for a table.
Definition: Schema.h:50
def denormalizeMatches(matches, matchMeta=None)
template BaseCatalog packMatches(SourceMatchVector const &)

◆ 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 998 of file multiBand.py.

998  def runDataRef(self, patchRef, psfCache=100):
999  """!
1000  @brief Deblend and measure.
1001 
1002  @param[in] patchRef: Patch reference.
1003 
1004  Set 'is-primary' and related flags. Propagate flags
1005  from individual visits. Optionally match the sources to a reference catalog and write the matches.
1006  Finally, write the deblended sources and measurements out.
1007  """
1008  if self.config.hasFakes:
1009  coaddType = "fakes_" + self.config.coaddName
1010  else:
1011  coaddType = self.config.coaddName
1012  exposure = patchRef.get(coaddType + "Coadd_calexp", immediate=True)
1013  exposure.getPsf().setCacheCapacity(psfCache)
1014  sources = self.readSources(patchRef)
1015  table = sources.getTable()
1016  table.setMetadata(self.algMetadata) # Capture algorithm metadata to write out to the source catalog.
1017  skyInfo = getSkyInfo(coaddName=self.config.coaddName, patchRef=patchRef)
1018 
1019  if self.config.doPropagateFlags:
1020  ccdInputs = self.propagateFlags.getCcdInputs(exposure)
1021  else:
1022  ccdInputs = None
1023 
1024  results = self.run(exposure=exposure, sources=sources,
1025  ccdInputs=ccdInputs,
1026  skyInfo=skyInfo, butler=patchRef.getButler(),
1027  exposureId=self.getExposureId(patchRef))
1028 
1029  if self.config.doMatchSources:
1030  self.writeMatches(patchRef, results)
1031  self.write(patchRef, results.outputSources)
1032 
def getSkyInfo(coaddName, patchRef)
Return the SkyMap, tract and patch information, wcs, and outer bbox of the patch to be coadded...
Definition: coaddBase.py:232

◆ 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 1149 of file multiBand.py.

1149  def write(self, dataRef, sources):
1150  """!
1151  @brief Write the source catalog.
1152 
1153  @param[in] dataRef: data reference
1154  @param[in] sources: source catalog
1155  """
1156  dataRef.put(sources, self.config.coaddName + "Coadd_meas")
1157  self.log.info("Wrote %d sources: %s" % (len(sources), dataRef.dataId))
1158 

◆ 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 1137 of file multiBand.py.

1137  def writeMatches(self, dataRef, results):
1138  """!
1139  @brief Write matches of the sources to the astrometric reference catalog.
1140 
1141  @param[in] dataRef: data reference
1142  @param[in] results: results struct from run method
1143  """
1144  if hasattr(results, "matchResult"):
1145  dataRef.put(results.matchResult, self.config.coaddName + "Coadd_measMatch")
1146  if hasattr(results, "denormMatches"):
1147  dataRef.put(results.denormMatches, self.config.coaddName + "Coadd_measMatchFull")
1148 

Member Data Documentation

◆ algMetadata

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.algMetadata

Definition at line 901 of file multiBand.py.

◆ ConfigClass

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

Definition at line 858 of file multiBand.py.

◆ deblended

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.deblended

Definition at line 891 of file multiBand.py.

◆ getSchemaCatalogs

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

Definition at line 860 of file multiBand.py.

◆ inputCatalog

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.inputCatalog

Definition at line 892 of file multiBand.py.

◆ makeIdFactory

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

Definition at line 861 of file multiBand.py.

◆ RunnerClass

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

Definition at line 859 of file multiBand.py.

◆ schema

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.schema

Definition at line 900 of file multiBand.py.

◆ schemaMapper

lsst.pipe.tasks.multiBand.MeasureMergedCoaddSourcesTask.schemaMapper

Definition at line 898 of file multiBand.py.


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