lsst.jointcal  master-g9041cab851+12
jointcalCoadd.py
Go to the documentation of this file.
1 # See COPYRIGHT file at the top of the source tree.
2 
3 from __future__ import division, absolute_import, print_function
4 
5 from lsst.pipe.tasks.makeCoaddTempExp import MakeCoaddTempExpTask
6 from lsst.pipe.base import Struct
7 
8 
9 class JointcalCoaddTask(MakeCoaddTempExpTask):
10 
11  def getCalExp(self, dataRef, bgSubtracted):
12  """!Return one "calexp" calibrated exposure
13 
14  @param[in] dataRef a sensor-level data reference
15  @param[in] bgSubtracted return calexp with background subtracted? If False get the
16  calexp's background background model and add it to the calexp.
17  @return calibrated exposure
18 
19  If config.doApplyUberCal, meas_mosaic calibrations will be applied to
20  the returned exposure using applyMosaicResults.
21  """
22  exposure = dataRef.get("calexp")
23 
24  if not bgSubtracted:
25  background = dataRef.get("calexpBackground")
26  mi = exposure.getMaskedImage()
27  mi += background.getImage()
28  del mi
29  if not self.config.doApplyUberCal:
30  return exposure
31  # if we are here, it means that we have to apply the improved calibrations coming from jointcal
32  self.log.info("doApplyUberCal is set - Using jointcal updated calibrations")
33  self.applyJointcalResultsExposure(dataRef, calexp=exposure)
34  return exposure
35 
36  def applyJointcalResultsExposure(self, dataRef, calexp=None):
37  """Update an Exposure with the Wcs, from meas_jointcal
38  (Calib and flux sacling will be also used later).
39  If None, the calexp will be loaded from the dataRef. Otherwise it is
40  updated in-place.
41  """
42  if calexp is None:
43  calexp = dataRef.get("calexp")
44 
45  wcsCont = dataRef.get("wcs")
46  calexp.setWcs(wcsCont.getWcs())
47 
48  return Struct(exposure=calexp)
def getCalExp(self, dataRef, bgSubtracted)
Return one "calexp" calibrated exposure.
def applyJointcalResultsExposure(self, dataRef, calexp=None)