Skip to content

Commit

Permalink
Merge pull request #260 from lsst/tickets/DM-45850
Browse files Browse the repository at this point in the history
DM-45850: Scale the EFD electrometer reading by the exposure time.
  • Loading branch information
erykoff authored Aug 20, 2024
2 parents e6209b1 + c352484 commit 775955d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions python/lsst/cp/pipe/ptc/cpPtcExtract.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ def run(self, inputExp, inputDims, taskMetadata=None, inputPhotodiodeData=None):
'dt': dt,
'begin': ts.begin,
'end': ts.end,
'exptime': ref.dataId.exposure.exposure_time,
}
if not obsMin or ts.begin < obsMin:
obsMin = ts.begin - dt
Expand All @@ -494,7 +495,11 @@ def run(self, inputExp, inputDims, taskMetadata=None, inputPhotodiodeData=None):
results = client.parseElectrometerStatus(pdData,
expDate['end'],
index=self.config.efdSalIndex)
monitorDiodeCharge[expId] = results[1]
# The monitor diode charge is negative and a time average,
# so we need to flip the sign and multiply by the exposure
# time.
monitorDiodeCharge[expId] = -1.0 * results[1] * expDate['exptime']

# The data can be large, so:
del pdData
del client
Expand Down Expand Up @@ -583,7 +588,11 @@ def run(self, inputExp, inputDims, taskMetadata=None, inputPhotodiodeData=None):
readNoise1[ampName] = getReadNoise(exp1, ampName)
readNoise2[ampName] = getReadNoise(exp2, ampName)

meanReadNoise[ampName] = np.nanmean([readNoise1[ampName], readNoise2[ampName]])
with warnings.catch_warnings():
warnings.simplefilter("ignore")
# We allow the mean read noise to be nan if both read noise
# values are nan, so suppress this warning.
meanReadNoise[ampName] = np.nanmean([readNoise1[ampName], readNoise2[ampName]])

# We demand that both mu1 and mu2 be finite and greater than 0.
if not np.isfinite(mu1) or not np.isfinite(mu2) \
Expand Down

0 comments on commit 775955d

Please sign in to comment.