LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pipe.tasks.characterizeImage.CharacterizeImageTask Class Reference

Measure bright sources and use this to estimate background and PSF of an exposure. More...

Inheritance diagram for lsst.pipe.tasks.characterizeImage.CharacterizeImageTask:

Public Member Functions

def runQuantum (self, butlerQC, inputRefs, outputRefs)
 
def __init__ (self, butler=None, refObjLoader=None, schema=None, **kwargs)
 Construct a CharacterizeImageTask. More...
 
def getInitOutputDatasets (self)
 
def runDataRef (self, dataRef, exposure=None, background=None, doUnpersist=True)
 Characterize a science image and, if wanted, persist the results. More...
 
def run (self, exposure, exposureIdInfo=None, background=None)
 Characterize a science image. More...
 
def detectMeasureAndEstimatePsf (self, exposure, exposureIdInfo, background)
 Perform one iteration of detect, measure and estimate PSF. More...
 
def getSchemaCatalogs (self)
 
def display (self, itemName, exposure, sourceCat=None)
 

Public Attributes

 schema
 
 algMetadata
 
 outputSchema
 

Static Public Attributes

 ConfigClass = CharacterizeImageConfig
 
 RunnerClass = pipeBase.ButlerInitializedTaskRunner
 

Detailed Description

Measure bright sources and use this to estimate background and PSF of an exposure.

@anchor CharacterizeImageTask_

@section pipe_tasks_characterizeImage_Contents  Contents

 - @ref pipe_tasks_characterizeImage_Purpose
 - @ref pipe_tasks_characterizeImage_Initialize
 - @ref pipe_tasks_characterizeImage_IO
 - @ref pipe_tasks_characterizeImage_Config
 - @ref pipe_tasks_characterizeImage_Debug


@section pipe_tasks_characterizeImage_Purpose  Description

Given an exposure with defects repaired (masked and interpolated over, e.g. as output by IsrTask):
- detect and measure bright sources
- repair cosmic rays
- measure and subtract background
- measure PSF

@section pipe_tasks_characterizeImage_Initialize  Task initialisation

@copydoc \_\_init\_\_

@section pipe_tasks_characterizeImage_IO  Invoking the Task

If you want this task to unpersist inputs or persist outputs, then call
the `runDataRef` method (a thin 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:

@section pipe_tasks_characterizeImage_Config  Configuration parameters

See @ref CharacterizeImageConfig

@section pipe_tasks_characterizeImage_Debug  Debug variables

The @link lsst.pipe.base.cmdLineTask.CmdLineTask command line task@endlink interface supports a flag
`--debug` to import `debug.py` from your `$PYTHONPATH`; see @ref baseDebug for more about `debug.py`.

CharacterizeImageTask has a debug dictionary with the following keys:
<dl>
<dt>frame
<dd>int: if specified, the frame of first debug image displayed (defaults to 1)
<dt>repair_iter
<dd>bool; if True display image after each repair in the measure PSF loop
<dt>background_iter
<dd>bool; if True display image after each background subtraction in the measure PSF loop
<dt>measure_iter
<dd>bool; if True display image and sources at the end of each iteration of the measure PSF loop
    See @ref lsst.meas.astrom.displayAstrometry for the meaning of the various symbols.
<dt>psf
<dd>bool; if True display image and sources after PSF is measured;
    this will be identical to the final image displayed by measure_iter if measure_iter is true
<dt>repair
<dd>bool; if True display image and sources after final repair
<dt>measure
<dd>bool; if True display image and sources after final measurement
</dl>

For example, put something like:
@code{.py}
    import lsstDebug
    def DebugInfo(name):
        di = lsstDebug.getInfo(name)  # N.b. lsstDebug.Info(name) would call us recursively
        if name == "lsst.pipe.tasks.characterizeImage":
            di.display = dict(
                repair = True,
            )

        return di

    lsstDebug.Info = DebugInfo
@endcode
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 250 of file characterizeImage.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.__init__ (   self,
  butler = None,
  refObjLoader = None,
  schema = None,
**  kwargs 
)

Construct a CharacterizeImageTask.

    @param[in] butler  A butler object is passed to the refObjLoader constructor in case
        it is needed to load catalogs.  May be None if a catalog-based star selector is
        not used, if the reference object loader constructor does not require a butler,
        or if a reference object loader is passed directly via the refObjLoader argument.
    @param[in] refObjLoader  An instance of LoadReferenceObjectsTasks that supplies an
        external reference catalog to a catalog-based star selector.  May be None if a
        catalog star selector is not used or the loader can be constructed from the
        butler argument.
    @param[in,out] schema  initial schema (an lsst.afw.table.SourceTable), or None
    @param[in,out] kwargs  other keyword arguments for lsst.pipe.base.CmdLineTask

Definition at line 345 of file characterizeImage.py.

345  def __init__(self, butler=None, refObjLoader=None, schema=None, **kwargs):
346  """!Construct a CharacterizeImageTask
347 
348  @param[in] butler A butler object is passed to the refObjLoader constructor in case
349  it is needed to load catalogs. May be None if a catalog-based star selector is
350  not used, if the reference object loader constructor does not require a butler,
351  or if a reference object loader is passed directly via the refObjLoader argument.
352  @param[in] refObjLoader An instance of LoadReferenceObjectsTasks that supplies an
353  external reference catalog to a catalog-based star selector. May be None if a
354  catalog star selector is not used or the loader can be constructed from the
355  butler argument.
356  @param[in,out] schema initial schema (an lsst.afw.table.SourceTable), or None
357  @param[in,out] kwargs other keyword arguments for lsst.pipe.base.CmdLineTask
358  """
359  super().__init__(**kwargs)
360 
361  if schema is None:
362  schema = SourceTable.makeMinimalSchema()
363  self.schema = schema
364  self.makeSubtask("background")
365  self.makeSubtask("installSimplePsf")
366  self.makeSubtask("repair")
367  self.makeSubtask("measurePsf", schema=self.schema)
368  if self.config.doMeasurePsf and self.measurePsf.usesMatches:
369  if not refObjLoader:
370  self.makeSubtask('refObjLoader', butler=butler)
371  refObjLoader = self.refObjLoader
372  self.makeSubtask("ref_match", refObjLoader=refObjLoader)
373  self.algMetadata = dafBase.PropertyList()
374  self.makeSubtask('detection', schema=self.schema)
375  if self.config.doDeblend:
376  self.makeSubtask("deblend", schema=self.schema)
377  self.makeSubtask('measurement', schema=self.schema, algMetadata=self.algMetadata)
378  if self.config.doApCorr:
379  self.makeSubtask('measureApCorr', schema=self.schema)
380  self.makeSubtask('applyApCorr', schema=self.schema)
381  self.makeSubtask('catalogCalculation', schema=self.schema)
382  self._initialFrame = getDebugFrame(self._display, "frame") or 1
383  self._frame = self._initialFrame
384  self.schema.checkUnits(parse_strict=self.config.checkUnitsParseStrict)
385  self.outputSchema = afwTable.SourceCatalog(self.schema)
386 
Class for storing ordered metadata with comments.
Definition: PropertyList.h:68
def getDebugFrame(debugDisplay, name)
Definition: lsstDebug.py:95

Member Function Documentation

◆ detectMeasureAndEstimatePsf()

def lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.detectMeasureAndEstimatePsf (   self,
  exposure,
  exposureIdInfo,
  background 
)

Perform one iteration of detect, measure and estimate PSF.

    Performs the following operations:
    - if config.doMeasurePsf or not exposure.hasPsf():
        - install a simple PSF model (replacing the existing one, if need be)
    - interpolate over cosmic rays with keepCRs=True
    - estimate background and subtract it from the exposure
    - detect, deblend and measure sources, and subtract a refined background model;
    - if config.doMeasurePsf:
        - measure PSF

    @param[in,out] exposure  exposure to characterize (an lsst.afw.image.ExposureF or similar)
        The following changes are made:
        - update or set psf
        - update detection and cosmic ray mask planes
        - subtract background
    @param[in] exposureIdInfo  ID info for exposure (an lsst.obs_base.ExposureIdInfo)
    @param[in,out] background  initial model of background already subtracted from exposure
        (an lsst.afw.math.BackgroundList).

    @return pipe_base Struct containing these fields, all from the final iteration
    of detect sources, measure sources and estimate PSF:
    - exposure  characterized exposure; image is repaired by interpolating over cosmic rays,
        mask is updated accordingly, and the PSF model is set
    - sourceCat  detected sources (an lsst.afw.table.SourceCatalog)
    - background  model of background subtracted from exposure (an lsst.afw.math.BackgroundList)
    - psfCellSet  spatial cells of PSF candidates (an lsst.afw.math.SpatialCellSet)

Definition at line 530 of file characterizeImage.py.

530  def detectMeasureAndEstimatePsf(self, exposure, exposureIdInfo, background):
531  """!Perform one iteration of detect, measure and estimate PSF
532 
533  Performs the following operations:
534  - if config.doMeasurePsf or not exposure.hasPsf():
535  - install a simple PSF model (replacing the existing one, if need be)
536  - interpolate over cosmic rays with keepCRs=True
537  - estimate background and subtract it from the exposure
538  - detect, deblend and measure sources, and subtract a refined background model;
539  - if config.doMeasurePsf:
540  - measure PSF
541 
542  @param[in,out] exposure exposure to characterize (an lsst.afw.image.ExposureF or similar)
543  The following changes are made:
544  - update or set psf
545  - update detection and cosmic ray mask planes
546  - subtract background
547  @param[in] exposureIdInfo ID info for exposure (an lsst.obs_base.ExposureIdInfo)
548  @param[in,out] background initial model of background already subtracted from exposure
549  (an lsst.afw.math.BackgroundList).
550 
551  @return pipe_base Struct containing these fields, all from the final iteration
552  of detect sources, measure sources and estimate PSF:
553  - exposure characterized exposure; image is repaired by interpolating over cosmic rays,
554  mask is updated accordingly, and the PSF model is set
555  - sourceCat detected sources (an lsst.afw.table.SourceCatalog)
556  - background model of background subtracted from exposure (an lsst.afw.math.BackgroundList)
557  - psfCellSet spatial cells of PSF candidates (an lsst.afw.math.SpatialCellSet)
558  """
559  # install a simple PSF model, if needed or wanted
560  if not exposure.hasPsf() or (self.config.doMeasurePsf and self.config.useSimplePsf):
561  self.log.info("PSF estimation initialized with 'simple' PSF")
562  self.installSimplePsf.run(exposure=exposure)
563 
564  # run repair, but do not interpolate over cosmic rays (do that elsewhere, with the final PSF model)
565  if self.config.requireCrForPsf:
566  self.repair.run(exposure=exposure, keepCRs=True)
567  else:
568  try:
569  self.repair.run(exposure=exposure, keepCRs=True)
570  except LengthError:
571  self.log.warning("Skipping cosmic ray detection: Too many CR pixels (max %0.f)",
572  self.config.repair.cosmicray.nCrPixelMax)
573 
574  self.display("repair_iter", exposure=exposure)
575 
576  if background is None:
577  background = BackgroundList()
578 
579  sourceIdFactory = exposureIdInfo.makeSourceIdFactory()
580  table = SourceTable.make(self.schema, sourceIdFactory)
581  table.setMetadata(self.algMetadata)
582 
583  detRes = self.detection.run(table=table, exposure=exposure, doSmooth=True)
584  sourceCat = detRes.sources
585  if detRes.fpSets.background:
586  for bg in detRes.fpSets.background:
587  background.append(bg)
588 
589  if self.config.doDeblend:
590  self.deblend.run(exposure=exposure, sources=sourceCat)
591 
592  self.measurement.run(measCat=sourceCat, exposure=exposure, exposureId=exposureIdInfo.expId)
593 
594  measPsfRes = pipeBase.Struct(cellSet=None)
595  if self.config.doMeasurePsf:
596  if self.measurePsf.usesMatches:
597  matches = self.ref_match.loadAndMatch(exposure=exposure, sourceCat=sourceCat).matches
598  else:
599  matches = None
600  measPsfRes = self.measurePsf.run(exposure=exposure, sources=sourceCat, matches=matches,
601  expId=exposureIdInfo.expId)
602  self.display("measure_iter", exposure=exposure, sourceCat=sourceCat)
603 
604  return pipeBase.Struct(
605  exposure=exposure,
606  sourceCat=sourceCat,
607  background=background,
608  psfCellSet=measPsfRes.cellSet,
609  )
610 
def run(self, coaddExposures, bbox, wcs)
Definition: getTemplate.py:603

◆ display()

def lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.display (   self,
  itemName,
  exposure,
  sourceCat = None 
)
Display exposure and sources on next frame, if display of itemName has been requested

@param[in] itemName  name of item in debugInfo
@param[in] exposure  exposure to display
@param[in] sourceCat  source catalog to display

Definition at line 618 of file characterizeImage.py.

618  def display(self, itemName, exposure, sourceCat=None):
619  """Display exposure and sources on next frame, if display of itemName has been requested
620 
621  @param[in] itemName name of item in debugInfo
622  @param[in] exposure exposure to display
623  @param[in] sourceCat source catalog to display
624  """
625  val = getDebugFrame(self._display, itemName)
626  if not val:
627  return
628 
629  displayAstrometry(exposure=exposure, sourceCat=sourceCat, frame=self._frame, pause=False)
630  self._frame += 1
def displayAstrometry(refCat=None, sourceCat=None, distortedCentroidKey=None, bbox=None, exposure=None, matches=None, frame=1, title="", pause=True)
Definition: display.py:34

◆ getInitOutputDatasets()

def lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.getInitOutputDatasets (   self)

Definition at line 387 of file characterizeImage.py.

387  def getInitOutputDatasets(self):
388  outputCatSchema = afwTable.SourceCatalog(self.schema)
389  outputCatSchema.getTable().setMetadata(self.algMetadata)
390  return {'outputSchema': outputCatSchema}
391 

◆ getSchemaCatalogs()

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

Definition at line 611 of file characterizeImage.py.

611  def getSchemaCatalogs(self):
612  """Return a dict of empty catalogs for each catalog dataset produced by this task.
613  """
614  sourceCat = SourceCatalog(self.schema)
615  sourceCat.getTable().setMetadata(self.algMetadata)
616  return {"icSrc": sourceCat}
617 
SortedCatalogT< SourceRecord > SourceCatalog
Definition: fwd.h:85

◆ run()

def lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.run (   self,
  exposure,
  exposureIdInfo = None,
  background = None 
)

Characterize a science image.

    Peforms the following operations:
    - Iterate the following config.psfIterations times, or once if config.doMeasurePsf false:
        - detect and measure sources and estimate PSF (see detectMeasureAndEstimatePsf for details)
    - interpolate over cosmic rays
    - perform final measurement

    @param[in,out] exposure  exposure to characterize (an lsst.afw.image.ExposureF or similar).
        The following changes are made:
        - update or set psf
        - set apCorrMap
        - update detection and cosmic ray mask planes
        - subtract background and interpolate over cosmic rays
    @param[in] exposureIdInfo  ID info for exposure (an lsst.obs.base.ExposureIdInfo).
        If not provided, returned SourceCatalog IDs will not be globally unique.
    @param[in,out] background  initial model of background already subtracted from exposure
        (an lsst.afw.math.BackgroundList). May be None if no background has been subtracted,
        which is typical for image characterization.

    @return pipe_base Struct containing these fields, all from the final iteration
    of detectMeasureAndEstimatePsf:
    - exposure: characterized exposure; image is repaired by interpolating over cosmic rays,
        mask is updated accordingly, and the PSF model is set
    - sourceCat: detected sources (an lsst.afw.table.SourceCatalog)
    - background: model of background subtracted from exposure (an lsst.afw.math.BackgroundList)
    - psfCellSet: spatial cells of PSF candidates (an lsst.afw.math.SpatialCellSet)

Definition at line 445 of file characterizeImage.py.

445  def run(self, exposure, exposureIdInfo=None, background=None):
446  """!Characterize a science image
447 
448  Peforms the following operations:
449  - Iterate the following config.psfIterations times, or once if config.doMeasurePsf false:
450  - detect and measure sources and estimate PSF (see detectMeasureAndEstimatePsf for details)
451  - interpolate over cosmic rays
452  - perform final measurement
453 
454  @param[in,out] exposure exposure to characterize (an lsst.afw.image.ExposureF or similar).
455  The following changes are made:
456  - update or set psf
457  - set apCorrMap
458  - update detection and cosmic ray mask planes
459  - subtract background and interpolate over cosmic rays
460  @param[in] exposureIdInfo ID info for exposure (an lsst.obs.base.ExposureIdInfo).
461  If not provided, returned SourceCatalog IDs will not be globally unique.
462  @param[in,out] background initial model of background already subtracted from exposure
463  (an lsst.afw.math.BackgroundList). May be None if no background has been subtracted,
464  which is typical for image characterization.
465 
466  @return pipe_base Struct containing these fields, all from the final iteration
467  of detectMeasureAndEstimatePsf:
468  - exposure: characterized exposure; image is repaired by interpolating over cosmic rays,
469  mask is updated accordingly, and the PSF model is set
470  - sourceCat: detected sources (an lsst.afw.table.SourceCatalog)
471  - background: model of background subtracted from exposure (an lsst.afw.math.BackgroundList)
472  - psfCellSet: spatial cells of PSF candidates (an lsst.afw.math.SpatialCellSet)
473  """
474  self._frame = self._initialFrame # reset debug display frame
475 
476  if not self.config.doMeasurePsf and not exposure.hasPsf():
477  self.log.info("CharacterizeImageTask initialized with 'simple' PSF.")
478  self.installSimplePsf.run(exposure=exposure)
479 
480  if exposureIdInfo is None:
481  exposureIdInfo = ExposureIdInfo()
482 
483  # subtract an initial estimate of background level
484  background = self.background.run(exposure).background
485 
486  psfIterations = self.config.psfIterations if self.config.doMeasurePsf else 1
487  for i in range(psfIterations):
488  dmeRes = self.detectMeasureAndEstimatePsf(
489  exposure=exposure,
490  exposureIdInfo=exposureIdInfo,
491  background=background,
492  )
493 
494  psf = dmeRes.exposure.getPsf()
495  psfSigma = psf.computeShape().getDeterminantRadius()
496  psfDimensions = psf.computeImage().getDimensions()
497  medBackground = np.median(dmeRes.background.getImage().getArray())
498  self.log.info("iter %s; PSF sigma=%0.2f, dimensions=%s; median background=%0.2f",
499  i + 1, psfSigma, psfDimensions, medBackground)
500 
501  self.display("psf", exposure=dmeRes.exposure, sourceCat=dmeRes.sourceCat)
502 
503  # perform final repair with final PSF
504  self.repair.run(exposure=dmeRes.exposure)
505  self.display("repair", exposure=dmeRes.exposure, sourceCat=dmeRes.sourceCat)
506 
507  # perform final measurement with final PSF, including measuring and applying aperture correction,
508  # if wanted
509  self.measurement.run(measCat=dmeRes.sourceCat, exposure=dmeRes.exposure,
510  exposureId=exposureIdInfo.expId)
511  if self.config.doApCorr:
512  apCorrMap = self.measureApCorr.run(exposure=dmeRes.exposure, catalog=dmeRes.sourceCat).apCorrMap
513  dmeRes.exposure.getInfo().setApCorrMap(apCorrMap)
514  self.applyApCorr.run(catalog=dmeRes.sourceCat, apCorrMap=exposure.getInfo().getApCorrMap())
515  self.catalogCalculation.run(dmeRes.sourceCat)
516 
517  self.display("measure", exposure=dmeRes.exposure, sourceCat=dmeRes.sourceCat)
518 
519  return pipeBase.Struct(
520  exposure=dmeRes.exposure,
521  sourceCat=dmeRes.sourceCat,
522  background=dmeRes.background,
523  psfCellSet=dmeRes.psfCellSet,
524 
525  characterized=dmeRes.exposure,
526  backgroundModel=dmeRes.background
527  )
528 

◆ runDataRef()

def lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.runDataRef (   self,
  dataRef,
  exposure = None,
  background = None,
  doUnpersist = True 
)

Characterize a science image and, if wanted, persist the results.

    This simply unpacks the exposure and passes it to the characterize method to do the work.

    @param[in] dataRef: butler data reference for science exposure
    @param[in,out] exposure  exposure to characterize (an lsst.afw.image.ExposureF or similar).
        If None then unpersist from "postISRCCD".
        The following changes are made, depending on the config:
        - set psf to the measured PSF
        - set apCorrMap to the measured aperture correction
        - subtract background
        - interpolate over cosmic rays
        - update detection and cosmic ray mask planes
    @param[in,out] background  initial model of background already subtracted from exposure
        (an lsst.afw.math.BackgroundList). May be None if no background has been subtracted,
        which is typical for image characterization.
        A refined background model is output.
    @param[in] doUnpersist  if True the exposure is read from the repository
        and the exposure and background arguments must be None;
        if False the exposure must be provided.
        True is intended for running as a command-line task, False for running as a subtask

    @return same data as the characterize method

Definition at line 393 of file characterizeImage.py.

393  def runDataRef(self, dataRef, exposure=None, background=None, doUnpersist=True):
394  """!Characterize a science image and, if wanted, persist the results
395 
396  This simply unpacks the exposure and passes it to the characterize method to do the work.
397 
398  @param[in] dataRef: butler data reference for science exposure
399  @param[in,out] exposure exposure to characterize (an lsst.afw.image.ExposureF or similar).
400  If None then unpersist from "postISRCCD".
401  The following changes are made, depending on the config:
402  - set psf to the measured PSF
403  - set apCorrMap to the measured aperture correction
404  - subtract background
405  - interpolate over cosmic rays
406  - update detection and cosmic ray mask planes
407  @param[in,out] background initial model of background already subtracted from exposure
408  (an lsst.afw.math.BackgroundList). May be None if no background has been subtracted,
409  which is typical for image characterization.
410  A refined background model is output.
411  @param[in] doUnpersist if True the exposure is read from the repository
412  and the exposure and background arguments must be None;
413  if False the exposure must be provided.
414  True is intended for running as a command-line task, False for running as a subtask
415 
416  @return same data as the characterize method
417  """
418  self._frame = self._initialFrame # reset debug display frame
419  self.log.info("Processing %s", dataRef.dataId)
420 
421  if doUnpersist:
422  if exposure is not None or background is not None:
423  raise RuntimeError("doUnpersist true; exposure and background must be None")
424  exposure = dataRef.get("postISRCCD", immediate=True)
425  elif exposure is None:
426  raise RuntimeError("doUnpersist false; exposure must be provided")
427 
428  exposureIdInfo = dataRef.get("expIdInfo")
429 
430  charRes = self.run(
431  exposure=exposure,
432  exposureIdInfo=exposureIdInfo,
433  background=background,
434  )
435 
436  if self.config.doWrite:
437  dataRef.put(charRes.sourceCat, "icSrc")
438  if self.config.doWriteExposure:
439  dataRef.put(charRes.exposure, "icExp")
440  dataRef.put(charRes.background, "icExpBackground")
441 
442  return charRes
443 

◆ runQuantum()

def lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.runQuantum (   self,
  butlerQC,
  inputRefs,
  outputRefs 
)

Definition at line 338 of file characterizeImage.py.

338  def runQuantum(self, butlerQC, inputRefs, outputRefs):
339  inputs = butlerQC.get(inputRefs)
340  if 'exposureIdInfo' not in inputs.keys():
341  inputs['exposureIdInfo'] = ExposureIdInfo.fromDataId(butlerQC.quantum.dataId, "visit_detector")
342  outputs = self.run(**inputs)
343  butlerQC.put(outputs, outputRefs)
344 

Member Data Documentation

◆ algMetadata

lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.algMetadata

Definition at line 373 of file characterizeImage.py.

◆ ConfigClass

lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.ConfigClass = CharacterizeImageConfig
static

Definition at line 334 of file characterizeImage.py.

◆ outputSchema

lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.outputSchema

Definition at line 385 of file characterizeImage.py.

◆ RunnerClass

lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.RunnerClass = pipeBase.ButlerInitializedTaskRunner
static

Definition at line 336 of file characterizeImage.py.

◆ schema

lsst.pipe.tasks.characterizeImage.CharacterizeImageTask.schema

Definition at line 363 of file characterizeImage.py.


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