LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Static Public Attributes | List of all members
lsst.ip.diffim.getTemplate.GetCalexpAsTemplateTask Class Reference
Inheritance diagram for lsst.ip.diffim.getTemplate.GetCalexpAsTemplateTask:

Public Member Functions

def run (self, exposure, sensorRef, templateIdList)
 
def runDataRef (self, *args, **kwargs)
 
def runQuantum (self, **kwargs)
 

Static Public Attributes

 ConfigClass = GetCalexpAsTemplateConfig
 

Detailed Description

Subtask to retrieve calexp of the same ccd number as the science image SensorRef
for use as an image difference template. Only gen2 supported.

To be run as a subtask by pipe.tasks.ImageDifferenceTask.
Intended for use with simulations and surveys that repeatedly visit the same pointing.
This code was originally part of Winter2013ImageDifferenceTask.

Definition at line 415 of file getTemplate.py.

Member Function Documentation

◆ run()

def lsst.ip.diffim.getTemplate.GetCalexpAsTemplateTask.run (   self,
  exposure,
  sensorRef,
  templateIdList 
)
Return a calexp exposure with based on input sensorRef.

Construct a dataId based on the sensorRef.dataId combined
with the specifications from the first dataId in templateIdList

Parameters
----------
exposure :  `lsst.afw.image.Exposure`
    exposure (unused)
sensorRef : `list` of `lsst.daf.persistence.ButlerDataRef`
    Data reference of the calexp(s) to subtract from.
templateIdList : `list` of `lsst.daf.persistence.ButlerDataRef`
    Data reference of the template calexp to be subtraced.
    Can be incomplete, fields are initialized from `sensorRef`.
    If there are multiple items, only the first one is used.

Returns
-------
result : `struct`

    return a pipeBase.Struct:

        - ``exposure`` : a template calexp
        - ``sources`` : source catalog measured on the template

Definition at line 427 of file getTemplate.py.

427  def run(self, exposure, sensorRef, templateIdList):
428  """Return a calexp exposure with based on input sensorRef.
429 
430  Construct a dataId based on the sensorRef.dataId combined
431  with the specifications from the first dataId in templateIdList
432 
433  Parameters
434  ----------
435  exposure : `lsst.afw.image.Exposure`
436  exposure (unused)
437  sensorRef : `list` of `lsst.daf.persistence.ButlerDataRef`
438  Data reference of the calexp(s) to subtract from.
439  templateIdList : `list` of `lsst.daf.persistence.ButlerDataRef`
440  Data reference of the template calexp to be subtraced.
441  Can be incomplete, fields are initialized from `sensorRef`.
442  If there are multiple items, only the first one is used.
443 
444  Returns
445  -------
446  result : `struct`
447 
448  return a pipeBase.Struct:
449 
450  - ``exposure`` : a template calexp
451  - ``sources`` : source catalog measured on the template
452  """
453 
454  if len(templateIdList) == 0:
455  raise RuntimeError("No template data reference supplied.")
456  if len(templateIdList) > 1:
457  self.log.warning("Multiple template data references supplied. Using the first one only.")
458 
459  templateId = sensorRef.dataId.copy()
460  templateId.update(templateIdList[0])
461 
462  self.log.info("Fetching calexp (%s) as template.", templateId)
463 
464  butler = sensorRef.getButler()
465  template = butler.get(datasetType="calexp", dataId=templateId)
466  if self.config.doAddCalexpBackground:
467  templateBg = butler.get(datasetType="calexpBackground", dataId=templateId)
468  mi = template.getMaskedImage()
469  mi += templateBg.getImage()
470 
471  if not template.hasPsf():
472  raise pipeBase.TaskError("Template has no psf")
473 
474  templateSources = butler.get(datasetType="src", dataId=templateId)
475  return pipeBase.Struct(exposure=template,
476  sources=templateSources)
477 
def run(self, coaddExposures, bbox, wcs)
Definition: getTemplate.py:603

◆ runDataRef()

def lsst.ip.diffim.getTemplate.GetCalexpAsTemplateTask.runDataRef (   self,
args,
**  kwargs 
)

Definition at line 478 of file getTemplate.py.

478  def runDataRef(self, *args, **kwargs):
479  return self.run(*args, **kwargs)
480 

◆ runQuantum()

def lsst.ip.diffim.getTemplate.GetCalexpAsTemplateTask.runQuantum (   self,
**  kwargs 
)

Definition at line 481 of file getTemplate.py.

481  def runQuantum(self, **kwargs):
482  raise NotImplementedError("Calexp template is not supported with gen3 middleware")
483 
484 

Member Data Documentation

◆ ConfigClass

lsst.ip.diffim.getTemplate.GetCalexpAsTemplateTask.ConfigClass = GetCalexpAsTemplateConfig
static

Definition at line 424 of file getTemplate.py.


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