LSSTApplications  16.0-10-g4f78f78+15,16.0-10-gc1446dd+41,16.0-11-g09ed895+1,16.0-12-g4477fe7+1,16.0-14-g0a28612+1,16.0-14-g6c7ed55+15,16.0-15-ga29f190+1,16.0-16-g89065d4+13,16.0-16-gcf62dc0+9,16.0-16-gd8e3590+15,16.0-16-ge6a35c8+5,16.0-17-g7e0e4ff+9,16.0-19-gb830ed4e+15,16.0-2-g0febb12+21,16.0-2-g9d5294e+60,16.0-2-ga8830df+5,16.0-23-gcb65559+3,16.0-24-gc1c7f52+8,16.0-3-ge00e371+20,16.0-33-g83da4dfe+2,16.0-4-g18f3627+4,16.0-4-g5f3a788+20,16.0-4-ga3eb747+10,16.0-4-gabf74b7+15,16.0-4-gade8416+8,16.0-4-gb13d127+5,16.0-5-g6a53317+20,16.0-5-gb3f8a4b+73,16.0-5-gef99c9f+11,16.0-6-g9321be7+4,16.0-6-gcbc7b31+18,16.0-6-gf49912c+15,16.0-62-g7ad45169d+1,16.0-7-g9645df7+1,16.0-7-gd2eeba5+27,16.0-8-g21fd5fe+15,16.0-8-g3a9f023+11,16.0-8-ge230541+2,16.0-9-g85d1a16+15,master-g72da5ad0b5+5,w.2018.46
LSSTDataManagementBasePackage
jointcalCoadd.py
Go to the documentation of this file.
1 # See COPYRIGHT file at the top of the source tree.
2 from lsst.pipe.tasks.makeCoaddTempExp import MakeCoaddTempExpTask
3 from lsst.pipe.base import Struct
4 
5 __all__ = ["JointcalCoaddTaskConfig", "JointcalCoaddTask"]
6 
7 
8 class JointcalCoaddTaskConfig(MakeCoaddTempExpTask.ConfigClass):
9  """Config for JointcalCoaddTask
10  """
11  def setDefaults(self):
12  MakeCoaddTempExpTask.ConfigClass.setDefaults(self)
13  self.doApplyUberCal = True
14 
15 
17 
18  ConfigClass = JointcalCoaddTaskConfig
19 
20  def getCalExp(self, dataRef, bgSubtracted):
21  """Return one "calexp" calibrated exposure
22 
23  Parameters
24  ----------
25  dataRef
26  a sensor-level data reference
27  bgSubtracted
28  return calexp with background subtracted? If False get the
29  calexp's background background model and add it to the calexp.
30 
31  Returns
32  -------
33  afw.image.ExposureF
34  The calibrated exposure. If config.doApplyUberCal, jointcal
35  calibrations will be applied to the returned exposure using
36  applyMosaicResults.
37  """
38  exposure = dataRef.get("calexp")
39 
40  if not bgSubtracted:
41  background = dataRef.get("calexpBackground")
42  mi = exposure.getMaskedImage()
43  mi += background.getImage()
44  del mi
45  if not self.config.doApplyUberCal:
46  return exposure
47  # if we are here, it means that we have to apply the improved calibrations coming from jointcal
48  self.log.info("doApplyUberCal is set - Using jointcal updated calibrations")
49  self.applyJointcalResultsExposure(dataRef, calexp=exposure)
50  return exposure
51 
52  def applyJointcalResultsExposure(self, dataRef, calexp=None):
53  """Update an Exposure with the Wcs, from meas_jointcal
54  (Calib and flux sacling will be also used later).
55  If None, the calexp will be loaded from the dataRef. Otherwise it is
56  updated in-place.
57  """
58  if calexp is None:
59  calexp = dataRef.get("calexp")
60 
61  wcsCont = dataRef.get("jointcal_wcs")
62  calexp.setWcs(wcsCont)
63 
64  return Struct(exposure=calexp)
Warp and optionally PSF-Match calexps onto an a common projection.
def getCalExp(self, dataRef, bgSubtracted)
def applyJointcalResultsExposure(self, dataRef, calexp=None)