LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+bd2ed33bd6,g1470d8bcf6+c6d6eb38e2,g14a832a312+9d12ad093c,g2079a07aa2+86d27d4dc4,g2305ad1205+91a32aca49,g295015adf3+88246b6574,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+c34e8be1fa,g487adcacf7+85dcfbcc36,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ea1711114f,g5a732f18d5+53520f316c,g64a986408d+bd2ed33bd6,g858d7b2824+bd2ed33bd6,g8a8a8dda67+585e252eca,g99cad8db69+016a06b37a,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+ef4e3a5875,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+b6d7b42999,gc120e1dc64+f745648b3a,gc28159a63d+0e5473021a,gcf0d15dbbd+c34e8be1fa,gdaeeff99f8+f9a426f77a,ge6526c86ff+508d0e0a30,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+8d59551888,gf1cff7945b+bd2ed33bd6,w.2024.16
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: