233 3.54369868e-02, -8.44782871e-01, -1.64614462e+00,
234 -3.83933101e+00, -5.60243416e+00, -6.51691578e+00,
235 -5.60243416e+00, -3.83933101e+00, -1.64614462e+00,
236 -8.44782871e-01, 3.54369868e-02, 5.31096720e-01,
237 8.10171823e-01, 4.83499829e-01],
238 [1.12382749e+00, 2.22609074e+00, 1.27877807e+00,
239 4.55434098e-01, -1.76842385e+00, -1.90046460e+00,
240 -8.10874526e+00, -1.20534899e+01, -1.48627948e+01,
241 -1.20534899e+01, -8.10874526e+00, -1.90046460e+00,
242 -1.76842385e+00, 4.55434098e-01, 1.27877807e+00,
243 2.22609074e+00, 1.12382749e+00],
244 [1.78571940e+00, 4.38918110e+00, 3.95098587e+00,
245 3.70961649e-01, -3.48151981e+00, -9.61567736e+00,
246 -1.78621172e+01, -2.32278872e+01, -2.31833727e+01,
247 -2.32278872e+01, -1.78621172e+01, -9.61567736e+00,
248 -3.48151981e+00, 3.70961649e-01, 3.95098587e+00,
249 4.38918110e+00, 1.78571940e+00],
250 [1.62986900e+00, 3.67851228e+00, 5.68645252e+00,
251 2.15342566e-01, -8.89937202e+00, -1.44739813e+01,
252 -2.98952660e+01, -4.37420817e+01, -4.83160958e+01,
253 -4.37420817e+01, -2.98952660e+01, -1.44739813e+01,
254 -8.89937202e+00, 2.15342566e-01, 5.68645252e+00,
255 3.67851228e+00, 1.62986900e+00],
256 [1.05524430e+00, 1.71917897e+00, 1.73105590e+00,
257 -2.10088420e+00, -1.15118208e+01, -2.55007598e+01,
258 -4.73056159e+01, -6.97257685e+01, -8.09264433e+01,
259 -6.97257685e+01, -4.73056159e+01, -2.55007598e+01,
260 -1.15118208e+01, -2.10088420e+00, 1.73105590e+00,
261 1.71917897e+00, 1.05524430e+00],
262 [8.71929228e-01, 5.41025574e-01, 9.47560771e-01,
263 -5.75314708e-01, -7.46104027e+00, -4.42314481e+01,
264 -9.54126971e+01, -1.61603201e+02, -2.07520692e+02,
265 -1.61603201e+02, -9.54126971e+01, -4.42314481e+01,
266 -7.46104027e+00, -5.75314708e-01, 9.47560771e-01,
267 5.41025574e-01, 8.71929228e-01],
268 [1.89144704e+00, 3.57543979e+00, -6.91419168e-02,
269 -3.37950835e+00, -1.46695089e+01, -7.22850746e+01,
270 -1.65563055e+02, -3.10820425e+02, -4.70026655e+02,
271 -3.10820425e+02, -1.65563055e+02, -7.22850746e+01,
272 -1.46695089e+01, -3.37950835e+00, -6.91419168e-02,
273 3.57543979e+00, 1.89144704e+00],
274 [3.11841913e+00, 7.84024994e+00, 1.88495248e+00,
275 -7.69011009e+00, -2.71782400e+01, -1.04343326e+02,
276 -2.47561370e+02, -5.32959841e+02, -1.16529012e+03,
277 -5.32959841e+02, -2.47561370e+02, -1.04343326e+02,
278 -2.71782400e+01, -7.69011009e+00, 1.88495248e+00,
279 7.84024994e+00, 3.11841913e+00],
280 [2.74197956e+00, 4.73107997e+00, -9.48352966e-01,
281 -9.44822832e+00, -3.06477671e+01, -1.26788739e+02,
282 -3.22828411e+02, -8.47943472e+02, -3.87702420e+03,
283 -8.47943472e+02, -3.22828411e+02, -1.26788739e+02,
284 -3.06477671e+01, -9.44822832e+00, -9.48352966e-01,
285 4.73107997e+00, 2.74197956e+00],
286 [3.11841913e+00, 7.84024994e+00, 1.88495248e+00,
287 -7.69011009e+00, -2.71782400e+01, -1.04343326e+02,
288 -2.47561370e+02, -5.32959841e+02, -1.16529012e+03,
289 -5.32959841e+02, -2.47561370e+02, -1.04343326e+02,
290 -2.71782400e+01, -7.69011009e+00, 1.88495248e+00,
291 7.84024994e+00, 3.11841913e+00],
292 [1.89144704e+00, 3.57543979e+00, -6.91419168e-02,
293 -3.37950835e+00, -1.46695089e+01, -7.22850746e+01,
294 -1.65563055e+02, -3.10820425e+02, -4.70026655e+02,
295 -3.10820425e+02, -1.65563055e+02, -7.22850746e+01,
296 -1.46695089e+01, -3.37950835e+00, -6.91419168e-02,
297 3.57543979e+00, 1.89144704e+00],
298 [8.71929228e-01, 5.41025574e-01, 9.47560771e-01,
299 -5.75314708e-01, -7.46104027e+00, -4.42314481e+01,
300 -9.54126971e+01, -1.61603201e+02, -2.07520692e+02,
301 -1.61603201e+02, -9.54126971e+01, -4.42314481e+01,
302 -7.46104027e+00, -5.75314708e-01, 9.47560771e-01,
303 5.41025574e-01, 8.71929228e-01],
304 [1.05524430e+00, 1.71917897e+00, 1.73105590e+00,
305 -2.10088420e+00, -1.15118208e+01, -2.55007598e+01,
306 -4.73056159e+01, -6.97257685e+01, -8.09264433e+01,
307 -6.97257685e+01, -4.73056159e+01, -2.55007598e+01,
308 -1.15118208e+01, -2.10088420e+00, 1.73105590e+00,
309 1.71917897e+00, 1.05524430e+00],
310 [1.62986900e+00, 3.67851228e+00, 5.68645252e+00,
311 2.15342566e-01, -8.89937202e+00, -1.44739813e+01,
312 -2.98952660e+01, -4.37420817e+01, -4.83160958e+01,
313 -4.37420817e+01, -2.98952660e+01, -1.44739813e+01,
314 -8.89937202e+00, 2.15342566e-01, 5.68645252e+00,
315 3.67851228e+00, 1.62986900e+00],
316 [1.78571940e+00, 4.38918110e+00, 3.95098587e+00,
317 3.70961649e-01, -3.48151981e+00, -9.61567736e+00,
318 -1.78621172e+01, -2.32278872e+01, -2.31833727e+01,
319 -2.32278872e+01, -1.78621172e+01, -9.61567736e+00,
320 -3.48151981e+00, 3.70961649e-01, 3.95098587e+00,
321 4.38918110e+00, 1.78571940e+00],
322 [1.12382749e+00, 2.22609074e+00, 1.27877807e+00,
323 4.55434098e-01, -1.76842385e+00, -1.90046460e+00,
324 -8.10874526e+00, -1.20534899e+01, -1.48627948e+01,
325 -1.20534899e+01, -8.10874526e+00, -1.90046460e+00,
326 -1.76842385e+00, 4.55434098e-01, 1.27877807e+00,
327 2.22609074e+00, 1.12382749e+00],
328 [4.83499829e-01, 8.10171823e-01, 5.31096720e-01,
329 3.54369868e-02, -8.44782871e-01, -1.64614462+00,
330 -3.83933101e+00, -5.60243416e+00, -6.51691578e+00,
331 -5.60243416e+00, -3.83933101e+00, -1.64614462e+00,
332 -8.44782871e-01, 3.54369868e-02, 5.31096720e-01,
333 8.10171823e-01, 4.83499829e-01]]) * 1e-10
341 129.0, 151.9, 179.4, 211.9, 250.5, 296.2, 350.0,
342 413.5, 488.0, 576.0, 680.4, 753.0, 888.2, 1040.5,
343 1254.1, 1478.9, 1747.0, 2055.7, 2416.9, 2855.2,
344 3361.9, 3969.4, 4665.9, 5405.3, 6380.0, 7516.7,
345 8875.9, 10488.6, 12681.9, 14974.2, 17257.6, 20366.5,
346 24026.7, 28372.1, 33451.7, 39550.4, 46624.8, 55042.9,
347 64862.7, 76503.1, 90265.6, 106384.2, 0.0, 0.0, 0.0,
348 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1,
349 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0,
350 0.1, 0.2, 0.6, 0.1, 0.0, 0.1, 0.0, 0.6, 0.3, 0.5, 0.8,
351 0.8, 1.5, 2.0, 1.8, 2.4, 2.6, 3.7, 5.0, 6.4, 8.4, 10.9,
362 'decayTime': {
'C:0,0': 2.30,
370 'globalCti': {
'C:0,0': 5.25e-07,
378 'serialTraps': {
'C:0,0': {
'size': 20000.0,
381 'trap_type':
'spline',
383 'C:0,1': {
'size': 20000.0,
386 'trap_type':
'spline',
388 'C:0,2': {
'size': 20000.0,
391 'trap_type':
'spline',
393 'C:0,3': {
'size': 20000.0,
396 'trap_type':
'spline',
398 'C:1,0': {
'size': 20000.0,
401 'trap_type':
'spline',
403 'C:1,1': {
'size': 20000.0,
406 'trap_type':
'spline',
408 'C:1,2': {
'size': 20000.0,
411 'trap_type':
'spline',
413 'C:1,3': {
'size': 20000.0,
416 'trap_type':
'spline',
423 self.makeSubtask(
"assembleCcd")
452 """Generate a simulated ISR LSST image.
456 exposure : `lsst.afw.image.Exposure` or `dict`
457 Simulated ISR image data.
461 This method constructs a "raw" data image.
467 rngSky = np.random.RandomState(seed=self.config.rngSeed + 1)
468 rngDark = np.random.RandomState(seed=self.config.rngSeed + 2)
469 rng2DBias = np.random.RandomState(seed=self.config.rngSeed + 3)
470 rngOverscan = np.random.RandomState(seed=self.config.rngSeed + 4)
471 rngReadNoise = np.random.RandomState(seed=self.config.rngSeed + 5)
472 rngBrighterFatter = galsim.BaseDeviate(self.config.rngSeed + 6)
475 if self.config.doAddHighSignalNonlinearity:
481 for idx, amp
in enumerate(exposure.getDetector()):
484 if self.config.isTrimmed:
488 bbox = amp.getRawDataBBox()
489 bboxFull = amp.getRawBBox()
492 ampImageData = exposure.image[bbox]
494 ampFullData = exposure.image[bboxFull]
500 if self.config.doAddSky:
504 self.config.skyLevel,
505 np.sqrt(self.config.skyLevel),
509 if self.config.doAddSource:
510 for sourceAmp, sourceFlux, sourceX, sourceY
in zip(self.config.sourceAmp,
511 self.config.sourceFlux,
513 self.config.sourceY):
518 if self.config.doAddFringe:
522 np.array(self.config.fringeScale),
523 x0=np.array(self.config.fringeX0),
524 y0=np.array(self.config.fringeY0))
526 if self.config.doAddFlat:
527 if self.config.calibMode:
532 u0 = exposure.getDetector().getBBox().getDimensions().getX()/2.
533 v0 = exposure.getDetector().getBBox().getDimensions().getY()/2.
539 if self.config.doAddBrightDefects:
542 for defect
in defectList:
543 exposure.image[defect.getBBox()] = self.config.brightDefectLevel
545 for idx, amp
in enumerate(exposure.getDetector()):
548 if self.config.isTrimmed:
552 bbox = amp.getRawDataBBox()
553 bboxFull = amp.getRawBBox()
556 ampImageData = exposure.image[bbox]
558 ampFullData = exposure.image[bboxFull]
561 if self.config.doAddDark
or self.config.doAddDarkNoiseOnly:
562 if self.config.doAddDarkNoiseOnly:
565 darkLevel = self.config.darkRate * self.config.darkTime
566 if self.config.calibMode:
569 darkNoise = np.sqrt(self.config.darkRate * self.config.darkTime)
574 if self.config.doAddBrighterFatter
is True:
578 self.config.bfStrength,
583 if self.config.doAddDeferredCharge:
588 if self.config.doAdd2DBias:
595 self.config.noise2DBias,
603 if self.config.doAddClockInjectedOffset:
606 self.config.clockInjectedOffsetLevel,
612 if (self.config.doAddParallelOverscanRamp
or self.config.doAddSerialOverscanRamp)
and \
613 not self.config.isTrimmed:
615 if self.config.doAddParallelOverscanRamp:
618 1.0 * self.config.overscanScale)
620 if self.config.doAddSerialOverscanRamp:
623 1.0 * self.config.overscanScale)
627 if self.config.doAddHighSignalNonlinearity:
629 if linearizer.linearityType[amp.getName()] !=
"Spline":
630 raise RuntimeError(
"IsrMockLSST only supports spline non-linearity.")
632 coeffs = linearizer.linearityCoeffs[amp.getName()]
633 centers, values = np.split(coeffs, 2)
637 values[centers < self.config.highSignalNonlinearityThreshold] = 0.0
640 values *= self.config.gainDict[amp.getName()]
649 self.config.clockInjectedOffsetLevel
if self.config.doAddClockInjectedOffset
else 0.0,
656 if not self.config.calibMode:
661 self.config.readNoise,
666 if not self.config.isTrimmed:
667 parallelOverscanBBox = amp.getRawParallelOverscanBBox()
668 parallelOverscanData = exposure.image[parallelOverscanBBox]
671 serialOverscanData = exposure.image[serialOverscanBBox]
676 parallelOverscanData,
678 self.config.readNoise,
684 self.config.readNoise,
689 if self.config.doAddBadParallelOverscanColumn
and not self.config.isTrimmed:
692 amp = exposure.getDetector()[2]
693 parBBox = amp.getRawParallelOverscanBBox()
698 exposure[bboxBad].image.array[:, :] = self.config.badParallelOverscanColumnLevel
700 if self.config.doAddBadParallelOverscanColumnNeighbors:
701 for neighbor
in [49, 51]:
706 exposure[bboxBad].image.array[:, :] += self.config.badParallelOverscanColumnNeighborsLevel
710 if self.config.doAddCrosstalk:
712 exposureClean = exposure.clone()
713 for idxS, ampS
in enumerate(exposure.getDetector()):
714 for idxT, ampT
in enumerate(exposure.getDetector()):
715 ampDataTarget = exposure.image[ampT.getBBox()
if self.config.isTrimmed
716 else ampT.getRawBBox()]
717 ampDataSource = ctCalib.extractAmp(exposureClean.image, ampS, ampT,
718 isTrimmed=self.config.isTrimmed,
722 for amp
in exposure.getDetector():
725 if self.config.isTrimmed:
729 bbox = amp.getRawDataBBox()
730 bboxFull = amp.getRawBBox()
733 ampImageData = exposure.image[bbox]
735 ampFullData = exposure.image[bboxFull]
738 if self.config.doApplyGain:
739 gain = self.config.gainDict.get(amp.getName(), self.config.gain)
744 if self.config.doAddBias:
748 if self.config.doRoundAdu:
752 if self.config.calibMode:
753 if self.config.doApplyGain:
754 exposure.metadata[
"LSST ISR UNITS"] =
"adu"
756 exposure.metadata[
"LSST ISR UNITS"] =
"electron"
758 if self.config.doGenerateAmpDict:
760 for amp
in exposure.getDetector():
761 expDict[amp.getName()] = exposure