LSST Applications g0265f82a02+093ff98f47,g02d81e74bb+10352d6f39,g1f3e9fa97e+40b0fc677d,g2079a07aa2+14824f138e,g2bbee38e9b+093ff98f47,g337abbeb29+093ff98f47,g3ddfee87b4+064c02c7ee,g487adcacf7+7e842ebf4b,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g568d43a26c+1d7ac31cb0,g591dd9f2cf+fb1f69e2ea,g858d7b2824+10352d6f39,g8a8a8dda67+a6fc98d2e7,g8cdfe0ae6a+66d966b544,g99cad8db69+7ce8a7c20a,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga2e4dd1c03+064c02c7ee,ga8c6da7877+04f6ba86dc,gae46bcf261+093ff98f47,gb0e22166c9+3863383f4c,gba4ed39666+9664299f35,gbb8dafda3b+db40f59a7d,gbeb006f7da+e6a448e96d,gbf5cecdb8a+10352d6f39,gc0f3af6251+10a3fd39cd,gc120e1dc64+5839e50a77,gc28159a63d+093ff98f47,gcf0d15dbbd+064c02c7ee,gd2a12a3803+0c2c227a2b,gdaeeff99f8+a38ce5ea23,ge79ae78c31+093ff98f47,gee10cc3b42+a6fc98d2e7,gf1cff7945b+10352d6f39,w.2024.15
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder Class Reference

Public Member Functions

 __init__ (self, task, visitId, num=0)
 
 addCalExp (self, calExp, ccdId, nGoodPix)
 
 finish (self, coaddTempExp, nGoodPix=None)
 

Public Attributes

 task
 
 coaddInputs
 
 visitRecord
 

Protected Member Functions

 _setExposureInfoInRecord (self, exposure, record)
 

Detailed Description

A helper class for CoaddInputRecorderTask, managing the CoaddInputs object for that single
CoaddTempExp.  This will contain a single 'visit' record for the CoaddTempExp and a number of 'ccd'
records.

Should generally be created by calling CoaddInputRecorderTask.makeCoaddTempExp().

Parameters
----------
task : `lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask`
    The CoaddInputRecorderTask that is utilising us.
visitId : `int`
    Identifier (integer) for the visit.
num : `int`
    Number of CCDs for this visit that overlap this patch (for reserving memory).

Definition at line 56 of file coaddInputRecorder.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.__init__ ( self,
task,
visitId,
num = 0 )

Definition at line 73 of file coaddInputRecorder.py.

73 def __init__(self, task, visitId, num=0):
74 self.task = task
75 self.coaddInputs = self.task.makeCoaddInputs()
76 self.coaddInputs.visits.reserve(1)
77 if num > 0:
78 self.coaddInputs.ccds.reserve(num)
79 self.visitRecord = self.coaddInputs.visits.addNew()
80 self.visitRecord.setId(visitId)
81

Member Function Documentation

◆ _setExposureInfoInRecord()

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder._setExposureInfoInRecord ( self,
exposure,
record )
protected
Set exposure info and bbox in an ExposureTable record.

Parameters
----------
exposure : `lsst.afw.image.ExposureF`
    Exposure whose info is to be recorded.
record : `Unknown`
    Record of an ExposureTable to set.

Definition at line 141 of file coaddInputRecorder.py.

141 def _setExposureInfoInRecord(self, exposure, record):
142 """Set exposure info and bbox in an ExposureTable record.
143
144 Parameters
145 ----------
146 exposure : `lsst.afw.image.ExposureF`
147 Exposure whose info is to be recorded.
148 record : `Unknown`
149 Record of an ExposureTable to set.
150 """
151 info = exposure.getInfo()
152 record.setPsf(info.getPsf())
153 record.setWcs(info.getWcs())
154 record.setPhotoCalib(info.getPhotoCalib())
155 record.setApCorrMap(info.getApCorrMap())
156 record.setValidPolygon(info.getValidPolygon())
157 record.setVisitInfo(info.getVisitInfo())
158 record.setBBox(exposure.getBBox())
159 record.setTransmissionCurve(info.getTransmissionCurve())
160
161

◆ addCalExp()

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.addCalExp ( self,
calExp,
ccdId,
nGoodPix )
Add a 'ccd' record for a calexp just added to the CoaddTempExp.

Parameters
----------
calExp : `lsst.afw.image.Exposure`
    Calibrated exposure just added to the CoaddTempExp, or None in case of
    failures that should nonetheless be tracked.  Should be the original
    calexp, in that it should contain the original Psf and Wcs, not the
    warped and/or matched ones.
ccdId : `int`
    A unique numeric ID for the Exposure.
nGoodPix : `int`
    Number of good pixels this image will contribute to the CoaddTempExp.
    If saveEmptyCcds is not set and this value is zero, no record will be
    added.

Definition at line 82 of file coaddInputRecorder.py.

82 def addCalExp(self, calExp, ccdId, nGoodPix):
83 """Add a 'ccd' record for a calexp just added to the CoaddTempExp.
84
85 Parameters
86 ----------
87 calExp : `lsst.afw.image.Exposure`
88 Calibrated exposure just added to the CoaddTempExp, or None in case of
89 failures that should nonetheless be tracked. Should be the original
90 calexp, in that it should contain the original Psf and Wcs, not the
91 warped and/or matched ones.
92 ccdId : `int`
93 A unique numeric ID for the Exposure.
94 nGoodPix : `int`
95 Number of good pixels this image will contribute to the CoaddTempExp.
96 If saveEmptyCcds is not set and this value is zero, no record will be
97 added.
98 """
99 if nGoodPix == 0 and not self.task.config.saveEmptyCcds:
100 return
101 record = self.coaddInputs.ccds.addNew()
102 record.setId(ccdId)
103 record.setL(self.task.ccdVisitKey, self.visitRecord.getId())
104 try:
105 record.setI(self.task.ccdCcdKey, calExp.getDetector().getId())
106 except Exception as e:
107 self.task.log.warning("Error getting detector serial number in visit %d; using -1; error=%s",
108 self.visitRecord.getId(), e)
109 record.setI(self.task.ccdCcdKey, -1)
110 record.setI(self.task.ccdGoodPixKey, nGoodPix)
111 if calExp is not None:
112 self._setExposureInfoInRecord(exposure=calExp, record=record)
113 if self.task.config.saveCcdWeights:
114 record.setD(self.task.ccdWeightKey, 1.0) # No weighting or overlap when warping
115 record.set(self.task.ccdFilterKey, calExp.getFilter().physicalLabel)
116

◆ finish()

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.finish ( self,
coaddTempExp,
nGoodPix = None )
Finish creating the CoaddInputs for a CoaddTempExp.

Parameters
----------
coaddTempExp : `lsst.afw.image.Exposure`
    Exposure object from which to obtain the PSF, WCS, and bounding
    box for the entry in the 'visits' table.  On return, the completed
    CoaddInputs object will be attached to it.
nGoodPix : `int`
    Total number of good pixels in the CoaddTempExp; ignored unless
    saveVisitGoodPix is true.

Definition at line 117 of file coaddInputRecorder.py.

117 def finish(self, coaddTempExp, nGoodPix=None):
118 """Finish creating the CoaddInputs for a CoaddTempExp.
119
120 Parameters
121 ----------
122 coaddTempExp : `lsst.afw.image.Exposure`
123 Exposure object from which to obtain the PSF, WCS, and bounding
124 box for the entry in the 'visits' table. On return, the completed
125 CoaddInputs object will be attached to it.
126 nGoodPix : `int`
127 Total number of good pixels in the CoaddTempExp; ignored unless
128 saveVisitGoodPix is true.
129 """
130 self._setExposureInfoInRecord(exposure=coaddTempExp, record=self.visitRecord)
131 if self.task.config.saveVisitGoodPix:
132 self.visitRecord.setI(self.task.visitGoodPixKey, nGoodPix)
133 coaddTempExp.getInfo().setCoaddInputs(self.coaddInputs)
134 wcs = coaddTempExp.getWcs()
135 if False:
136 # This causes a test failure, pending fix in issue HSC-802
137 coaddTempExp.setPsf(CoaddPsf(self.coaddInputs.ccds, wcs))
138 apCorrMap = makeCoaddApCorrMap(self.coaddInputs.ccds, coaddTempExp.getBBox(afwImage.PARENT), wcs)
139 coaddTempExp.getInfo().setApCorrMap(apCorrMap)
140

Member Data Documentation

◆ coaddInputs

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.coaddInputs

Definition at line 75 of file coaddInputRecorder.py.

◆ task

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.task

Definition at line 74 of file coaddInputRecorder.py.

◆ visitRecord

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.visitRecord

Definition at line 79 of file coaddInputRecorder.py.


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