33 import lsst.pex.config
as pexConfig
35 from .crosstalk
import X_FLIP, Y_FLIP
37 __all__ = [
"IsrMockConfig",
"IsrMock",
"RawMock",
"TrimmedRawMock",
"RawDictMock",
38 "CalibratedRawMock",
"MasterMock",
39 "BiasMock",
"DarkMock",
"FlatMock",
"FringeMock",
"UntrimmedFringeMock",
40 "BfKernelMock",
"DefectMock",
"CrosstalkCoeffMock",
"TransmissionMock",
45 """Configuration parameters for isrMock. 47 These parameters produce generic fixed position signals from 48 various sources, and combine them in a way that matches how those 49 signals are combined to create real data. The camera used is the 50 test camera defined by the afwUtils code. 53 isLsstLike = pexConfig.Field(
56 doc=
"If True, products have one raw image per amplifier, otherwise, one raw image per detector.",
58 isTrimmed = pexConfig.Field(
61 doc=
"If True, amplifiers have been trimmed and mosaicked to remove regions outside the data BBox.",
63 detectorIndex = pexConfig.Field(
66 doc=
"Index for the detector to use. The default value uses a standard 2x4 array of amps.",
68 rngSeed = pexConfig.Field(
71 doc=
"Seed for random number generator used to add noise.",
74 gain = pexConfig.Field(
77 doc=
"Gain for simulated data in e^-/DN.",
79 readNoise = pexConfig.Field(
82 doc=
"Read noise of the detector in e-.",
84 expTime = pexConfig.Field(
87 doc=
"Exposure time for simulated data.",
91 skyLevel = pexConfig.Field(
94 doc=
"Background contribution to be generated from 'the sky' in DN.",
96 sourceFlux = pexConfig.ListField(
99 doc=
"Peak flux level (in DN) of simulated 'astronomical sources'.",
101 sourceAmp = pexConfig.ListField(
104 doc=
"Amplifier to place simulated 'astronomical sources'.",
106 sourceX = pexConfig.ListField(
109 doc=
"Peak position (in amplifier coordinates) of simulated 'astronomical sources'.",
111 sourceY = pexConfig.ListField(
114 doc=
"Peak position (in amplifier coordinates) of simulated 'astronomical sources'.",
116 overscanScale = pexConfig.Field(
119 doc=
"Amplitude (in DN) of the ramp function to add to overscan data.",
121 biasLevel = pexConfig.Field(
124 doc=
"Background contribution to be generated from the bias offset in DN.",
126 darkRate = pexConfig.Field(
129 doc=
"Background level contribution (in e-/s) to be generated from dark current.",
131 darkTime = pexConfig.Field(
134 doc=
"Exposure time for the dark current contribution.",
136 flatDrop = pexConfig.Field(
139 doc=
"Fractional flux drop due to flat from center to edge of detector along x-axis.",
141 fringeScale = pexConfig.ListField(
144 doc=
"Peak fluxes for the components of the fringe ripple in DN.",
146 fringeX0 = pexConfig.ListField(
149 doc=
"Center position for the fringe ripples.",
151 fringeY0 = pexConfig.ListField(
154 doc=
"Center position for the fringe ripples.",
158 doAddSky = pexConfig.Field(
161 doc=
"Apply 'sky' signal to output image.",
163 doAddSource = pexConfig.Field(
166 doc=
"Add simulated source to output image.",
168 doAddCrosstalk = pexConfig.Field(
171 doc=
"Apply simulated crosstalk to output image. This cannot be corrected by ISR, " 172 "as detector.hasCrosstalk()==False.",
174 doAddOverscan = pexConfig.Field(
177 doc=
"If untrimmed, add overscan ramp to overscan and data regions.",
179 doAddBias = pexConfig.Field(
182 doc=
"Add bias signal to data.",
184 doAddDark = pexConfig.Field(
187 doc=
"Add dark signal to data.",
189 doAddFlat = pexConfig.Field(
192 doc=
"Add flat signal to data.",
194 doAddFringe = pexConfig.Field(
197 doc=
"Add fringe signal to data.",
201 doTransmissionCurve = pexConfig.Field(
204 doc=
"Return a simulated transmission curve.",
206 doDefects = pexConfig.Field(
209 doc=
"Return a simulated defect list.",
211 doBrighterFatter = pexConfig.Field(
214 doc=
"Return a simulated brighter-fatter kernel.",
216 doCrosstalkCoeffs = pexConfig.Field(
219 doc=
"Return the matrix of crosstalk coefficients.",
221 doDataRef = pexConfig.Field(
224 doc=
"Return a simulated gen2 butler dataRef.",
226 doGenerateImage = pexConfig.Field(
229 doc=
"Return the generated output image if True.",
231 doGenerateData = pexConfig.Field(
234 doc=
"Return a non-image data structure if True.",
236 doGenerateAmpDict = pexConfig.Field(
239 doc=
"Return a dict of exposure amplifiers instead of an afwImage.Exposure.",
244 """Class to generate consistent mock images for ISR testing. 246 ISR testing currently relies on one-off fake images that do not 247 accurately mimic the full set of detector effects. This class 248 uses the test camera/detector/amplifier structure defined in 249 `lsst.afw.cameraGeom.testUtils` to avoid making the test data 250 dependent on any of the actual obs package formats. 252 ConfigClass = IsrMockConfig
253 _DefaultName =
"isrMock" 257 self.
rng = np.random.RandomState(self.config.rngSeed)
259 [1e-2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
260 [1e-2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
261 [1e-2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
262 [1e-2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
263 [1e-2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
264 [1e-2, 0.0, 0.0, 2.2e-2, 0.0, 0.0, 0.0, 0.0],
265 [1e-2, 5e-3, 5e-4, 3e-3, 4e-2, 5e-3, 5e-3, 0.0]])
268 [4., 16., 26., 16., 4.],
269 [7., 26., 41., 26., 7.],
270 [4., 16., 26., 16., 4.],
271 [1., 4., 7., 4., 1.]]) / 273.0
274 """Generate a mock ISR product, and return it. 278 image : `lsst.afw.image.Exposure` 279 Simulated ISR image with signals added. 281 Simulated ISR data products. 283 Returned if no valid configuration was found. 288 Raised if both doGenerateImage and doGenerateData are specified. 290 if self.config.doGenerateImage
and self.config.doGenerateData:
291 raise RuntimeError(
"Only one of doGenerateImage and doGenerateData may be specified.")
292 elif self.config.doGenerateImage:
294 elif self.config.doGenerateData:
300 """Generate simulated ISR data. 302 Currently, only the class defined crosstalk coefficient 303 matrix, brighter-fatter kernel, a constant unity transmission 304 curve, or a simple single-entry defect list can be generated. 309 Simulated ISR data product. 311 if sum(map(bool, [self.config.doBrighterFatter,
312 self.config.doDefects,
313 self.config.doTransmissionCurve,
314 self.config.doCrosstalkCoeffs])) != 1:
315 raise RuntimeError(
"Only one data product can be generated at a time.")
316 elif self.config.doBrighterFatter
is True:
318 elif self.config.doDefects
is True:
320 elif self.config.doTransmissionCurve
is True:
322 elif self.config.doCrosstalkCoeffs
is True:
328 """Generate a simple Gaussian brighter-fatter kernel. 332 kernel : `numpy.ndarray` 333 Simulated brighter-fatter kernel. 338 """Generate a simple single-entry defect list. 342 defectList : `lsst.meas.algorithms.Defects` 343 Simulated defect list 349 """Generate the simulated crosstalk coefficients. 353 coeffs : `numpy.ndarray` 354 Simulated crosstalk coefficients. 360 """Generate a simulated flat transmission curve. 364 transmission : `lsst.afw.image.TransmissionCurve` 365 Simulated transmission curve. 368 return afwImage.TransmissionCurve.makeIdentity()
371 """Generate a simulated ISR image. 375 exposure : `lsst.afw.image.Exposure` or `dict` 376 Simulated ISR image data. 380 This method currently constructs a "raw" data image by: 381 * Generating a simulated sky with noise 382 * Adding a single Gaussian "star" 383 * Adding the fringe signal 384 * Multiplying the frame by the simulated flat 385 * Adding dark current (and noise) 386 * Adding a bias offset (and noise) 387 * Adding an overscan gradient parallel to the pixel y-axis 388 * Simulating crosstalk by adding a scaled version of each 389 amplifier to each other amplifier. 391 The exposure with image data constructed this way is in one of 393 * A single image, with overscan and prescan regions retained 394 * A single image, with overscan and prescan regions trimmed 395 * A `dict`, containing the amplifer data indexed by the 398 The nonlinearity, CTE, and brighter fatter are currently not 401 Note that this method generates an image in the reverse 402 direction as the ISR processing, as the output image here has 403 had a series of instrument effects added to an idealized 408 for idx, amp
in enumerate(exposure.getDetector()):
410 if self.config.isTrimmed
is True:
413 bbox = amp.getRawDataBBox()
415 ampData = exposure.image[bbox]
417 if self.config.doAddSky
is True:
418 self.
amplifierAddNoise(ampData, self.config.skyLevel, np.sqrt(self.config.skyLevel))
420 if self.config.doAddSource
is True:
421 for sourceAmp, sourceFlux, sourceX, sourceY
in zip(self.config.sourceAmp,
422 self.config.sourceFlux,
424 self.config.sourceY):
428 if self.config.doAddFringe
is True:
430 x0=np.array(self.config.fringeX0),
431 y0=np.array(self.config.fringeY0))
433 if self.config.doAddFlat
is True:
434 if ampData.getArray().sum() == 0.0:
436 u0 = exposure.getDimensions().getX()
437 v0 = exposure.getDimensions().getY()
440 if self.config.doAddDark
is True:
442 self.config.darkRate * self.config.darkTime / self.config.gain,
443 np.sqrt(self.config.darkRate *
444 self.config.darkTime / self.config.gain))
446 if self.config.doAddCrosstalk
is True:
448 for idxS, ampS
in enumerate(exposure.getDetector()):
449 for idxT, ampT
in enumerate(exposure.getDetector()):
450 ampDataS = exposure.image[ampS.getBBox()
if self.config.isTrimmed
451 else ampS.getRawDataBBox()]
452 ampDataT = exposure.image[ampT.getBBox()
if self.config.isTrimmed
453 else ampT.getRawDataBBox()]
455 (X_FLIP[ampS.getReadoutCorner()] ^
456 X_FLIP[ampT.getReadoutCorner()]),
457 (Y_FLIP[ampS.getReadoutCorner()] ^
458 Y_FLIP[ampT.getReadoutCorner()]))
461 for amp
in exposure.getDetector():
463 if self.config.isTrimmed
is True:
466 bbox = amp.getRawDataBBox()
468 ampData = exposure.image[bbox]
470 if self.config.doAddBias
is True:
472 self.config.readNoise / self.config.gain)
474 if self.config.doAddOverscan
is True:
475 oscanBBox = amp.getRawHorizontalOverscanBBox()
476 oscanData = exposure.image[oscanBBox]
478 self.config.readNoise / self.config.gain)
481 1.0 * self.config.overscanScale)
483 1.0 * self.config.overscanScale)
485 if self.config.doGenerateAmpDict
is True:
487 for amp
in exposure.getDetector():
488 expDict[amp.getName()] = exposure
495 """Construct a test camera object. 499 camera : `lsst.afw.cameraGeom.camera` 502 cameraWrapper = afwTestUtils.CameraWrapper(self.config.isLsstLike)
503 camera = cameraWrapper.camera
507 """Construct a test exposure. 509 The test exposure has a simple WCS set, as well as a list of 510 unlikely header keywords that can be removed during ISR 511 processing to exercise that code. 515 exposure : `lsst.afw.exposure.Exposure` 516 Construct exposure containing masked image of the 520 detector = camera[self.config.detectorIndex]
521 image = afwUtils.makeImageFromCcd(detector,
522 isTrimmed=self.config.isTrimmed,
526 imageFactory=afwImage.ImageF)
528 var = afwImage.ImageF(image.getDimensions())
534 exposure.setDetector(detector)
535 exposure.setWcs(self.
getWcs())
537 visitInfo =
afwImage.VisitInfo(exposureTime=self.config.expTime, darkTime=self.config.darkTime)
538 exposure.getInfo().setVisitInfo(visitInfo)
540 metadata = exposure.getMetadata()
541 metadata.add(
"SHEEP", 7.3,
"number of sheep on farm")
542 metadata.add(
"MONKEYS", 155,
"monkeys per tree")
543 metadata.add(
"VAMPIRES", 4,
"How scary are vampires.")
545 ccd = exposure.getDetector()
546 newCcd = ccd.rebuild()
549 newAmp = amp.rebuild()
550 newAmp.setLinearityCoeffs((0., 1., 0., 0.))
551 newAmp.setLinearityType(
"Polynomial")
552 newAmp.setGain(self.config.gain)
553 newAmp.setSuspectLevel(25000.0)
554 newAmp.setSaturation(32000.0)
555 newCcd.append(newAmp)
556 exposure.setDetector(newCcd.finish())
558 exposure.image.array[:] = np.zeros(exposure.getImage().getDimensions()).transpose()
559 exposure.mask.array[:] = np.zeros(exposure.getMask().getDimensions()).transpose()
560 exposure.variance.array[:] = np.zeros(exposure.getVariance().getDimensions()).transpose()
565 """Construct a dummy WCS object. 567 Taken from the deprecated ip_isr/examples/exampleUtils.py. 569 This is not guaranteed, given the distortion and pixel scale 570 listed in the afwTestUtils camera definition. 574 wcs : `lsst.afw.geom.SkyWcs` 582 """Convert between a local amplifier coordinate and the full 587 ampData : `lsst.afw.image.ImageF` 588 Amplifier image to use for conversions. 590 X-coordinate of the point to transform. 592 Y-coordinate of the point to transform. 597 Transformed x-coordinate. 599 Transformed y-coordinate. 603 The output is transposed intentionally here, to match the 604 internal transpose between numpy and afw.image coordinates. 606 u = x + ampData.getBBox().getBeginX()
607 v = y + ampData.getBBox().getBeginY()
613 """Add Gaussian noise to an amplifier's image data. 615 This method operates in the amplifier coordinate frame. 619 ampData : `lsst.afw.image.ImageF` 620 Amplifier image to operate on. 622 Mean value of the Gaussian noise. 624 Sigma of the Gaussian noise. 626 ampArr = ampData.array
627 ampArr[:] = ampArr[:] + self.
rng.normal(mean, sigma,
628 size=ampData.getDimensions()).transpose()
631 """Add a y-axis linear gradient to an amplifier's image data. 633 This method operates in the amplifier coordinate frame. 637 ampData : `lsst.afw.image.ImageF` 638 Amplifier image to operate on. 640 Start value of the gradient (at y=0). 642 End value of the gradient (at y=ymax). 644 nPixY = ampData.getDimensions().getY()
645 ampArr = ampData.array
646 ampArr[:] = ampArr[:] + (np.interp(range(nPixY), (0, nPixY - 1), (start, end)).reshape(nPixY, 1) +
647 np.zeros(ampData.getDimensions()).transpose())
650 """Add a single Gaussian source to an amplifier. 652 This method operates in the amplifier coordinate frame. 656 ampData : `lsst.afw.image.ImageF` 657 Amplifier image to operate on. 659 Peak flux of the source to add. 661 X-coordinate of the source peak. 663 Y-coordinate of the source peak. 665 for x
in range(0, ampData.getDimensions().getX()):
666 for y
in range(0, ampData.getDimensions().getY()):
667 ampData.array[y][x] = (ampData.array[y][x] +
668 scale * np.exp(-0.5 * ((x - x0)**2 + (y - y0)**2) / 3.0**2))
671 """Add a scaled copy of an amplifier to another, simulating crosstalk. 673 This method operates in the amplifier coordinate frame. 677 ampDataSource : `lsst.afw.image.ImageF` 678 Amplifier image to add scaled copy from. 679 ampDataTarget : `lsst.afw.image.ImageF` 680 Amplifier image to add scaled copy to. 682 Flux scale of the copy to add to the target. 686 This simulates simple crosstalk between amplifiers. 688 ampDataTarget.array[:] = (ampDataTarget.array[:] +
689 scale * ampDataSource.array[:])
693 """Add a fringe-like ripple pattern to an amplifier's image data. 697 amp : `~lsst.afw.ampInfo.AmpInfoRecord` 698 Amplifier to operate on. Needed for amp<->exp coordinate transforms. 699 ampData : `lsst.afw.image.ImageF` 700 Amplifier image to operate on. 701 scale : `numpy.array` or `float` 702 Peak intensity scaling for the ripple. 703 x0 : `numpy.array` or `float`, optional 705 y0 : `numpy.array` or `float`, optional 710 This uses an offset sinc function to generate a ripple 711 pattern. True fringes have much finer structure, but this 712 pattern should be visually identifiable. The (x, y) 713 coordinates are in the frame of the amplifier, and (u, v) in 714 the frame of the full trimmed image. 716 for x
in range(0, ampData.getDimensions().getX()):
717 for y
in range(0, ampData.getDimensions().getY()):
719 ampData.getArray()[y][x] = np.sum((ampData.getArray()[y][x] +
721 np.sinc(((u - x0) / 50)**2 +
722 ((v - y0) / 50)**2)))
725 """Multiply an amplifier's image data by a flat-like pattern. 729 amp : `lsst.afw.ampInfo.AmpInfoRecord` 730 Amplifier to operate on. Needed for amp<->exp coordinate transforms. 731 ampData : `lsst.afw.image.ImageF` 732 Amplifier image to operate on. 734 Fractional drop from center to edge of detector along x-axis. 736 Peak location in detector coordinates. 738 Peak location in detector coordinates. 742 This uses a 2-d Gaussian to simulate an illumination pattern 743 that falls off towards the edge of the detector. The (x, y) 744 coordinates are in the frame of the amplifier, and (u, v) in 745 the frame of the full trimmed image. 748 raise RuntimeError(
"Flat fractional drop cannot be greater than 1.0")
750 sigma = u0 / np.sqrt(-2.0 * np.log(fracDrop))
752 for x
in range(0, ampData.getDimensions().getX()):
753 for y
in range(0, ampData.getDimensions().getY()):
755 f = np.exp(-0.5 * ((u - u0)**2 + (v - v0)**2) / sigma**2)
756 ampData.array[y][x] = (ampData.array[y][x] * f)
760 """Generate a raw exposure suitable for ISR. 764 self.config.isTrimmed =
False 765 self.config.doGenerateImage =
True 766 self.config.doGenerateAmpDict =
False 767 self.config.doAddOverscan =
True 768 self.config.doAddSky =
True 769 self.config.doAddSource =
True 770 self.config.doAddCrosstalk =
False 771 self.config.doAddBias =
True 772 self.config.doAddDark =
True 776 """Generate a trimmed raw exposure. 780 self.config.isTrimmed =
True 781 self.config.doAddOverscan =
False 785 """Generate a trimmed raw exposure. 789 self.config.isTrimmed =
True 790 self.config.doGenerateImage =
True 791 self.config.doAddOverscan =
False 792 self.config.doAddSky =
True 793 self.config.doAddSource =
True 794 self.config.doAddCrosstalk =
False 796 self.config.doAddBias =
False 797 self.config.doAddDark =
False 798 self.config.doAddFlat =
False 799 self.config.doAddFringe =
True 801 self.config.biasLevel = 0.0
802 self.config.readNoise = 10.0
806 """Generate a raw exposure dict suitable for ISR. 810 self.config.doGenerateAmpDict =
True 814 """Parent class for those that make master calibrations. 818 self.config.isTrimmed =
True 819 self.config.doGenerateImage =
True 820 self.config.doAddOverscan =
False 821 self.config.doAddSky =
False 822 self.config.doAddSource =
False 823 self.config.doAddCrosstalk =
False 825 self.config.doAddBias =
False 826 self.config.doAddDark =
False 827 self.config.doAddFlat =
False 828 self.config.doAddFringe =
False 832 """Simulated master bias calibration. 836 self.config.doAddBias =
True 837 self.config.readNoise = 10.0
841 """Simulated master dark calibration. 845 self.config.doAddDark =
True 846 self.config.darkTime = 1.0
850 """Simulated master flat calibration. 854 self.config.doAddFlat =
True 858 """Simulated master fringe calibration. 862 self.config.doAddFringe =
True 866 """Simulated untrimmed master fringe calibration. 870 self.config.isTrimmed =
False 874 """Simulated brighter-fatter kernel. 878 self.config.doGenerateImage =
False 879 self.config.doGenerateData =
True 880 self.config.doBrighterFatter =
True 881 self.config.doDefects =
False 882 self.config.doCrosstalkCoeffs =
False 883 self.config.doTransmissionCurve =
False 887 """Simulated defect list. 891 self.config.doGenerateImage =
False 892 self.config.doGenerateData =
True 893 self.config.doBrighterFatter =
False 894 self.config.doDefects =
True 895 self.config.doCrosstalkCoeffs =
False 896 self.config.doTransmissionCurve =
False 900 """Simulated crosstalk coefficient matrix. 904 self.config.doGenerateImage =
False 905 self.config.doGenerateData =
True 906 self.config.doBrighterFatter =
False 907 self.config.doDefects =
False 908 self.config.doCrosstalkCoeffs =
True 909 self.config.doTransmissionCurve =
False 913 """Simulated transmission curve. 917 self.config.doGenerateImage =
False 918 self.config.doGenerateData =
True 919 self.config.doBrighterFatter =
False 920 self.config.doDefects =
False 921 self.config.doCrosstalkCoeffs =
False 922 self.config.doTransmissionCurve =
True 926 """Simulated gen2 butler data ref. 928 Currently only supports get and put operations, which are most 929 likely to be called for data in ISR processing. 932 dataId =
"isrMock Fake Data" 940 if 'config' in kwargs.keys():
948 self.
config.doGenerateImage =
True 949 self.
config.doGenerateData =
False 954 self.
config.doGenerateImage =
False 955 self.
config.doGenerateData =
True 957 def get(self, dataType, **kwargs):
958 """Return an appropriate data product. 963 Type of data product to return. 967 mock : IsrMock.run() result 970 if "_filename" in dataType:
972 return tempfile.mktemp(),
"mock" 973 elif 'transmission_' in dataType:
976 elif dataType ==
'ccdExposureId':
979 elif dataType ==
'camera':
982 elif dataType ==
'raw':
985 elif dataType ==
'bias':
988 elif dataType ==
'dark':
991 elif dataType ==
'flat':
994 elif dataType ==
'fringe':
997 elif dataType ==
'defects':
1000 elif dataType ==
'bfKernel':
1003 elif dataType ==
'linearizer':
1005 elif dataType ==
'crosstalkSources':
1008 raise RuntimeError(
"ISR DataRefMock cannot return %s.", dataType)
1010 def put(self, exposure, filename):
1011 """Write an exposure to a FITS file. 1015 exposure : `lsst.afw.image.Exposure` 1016 Image data to write out. 1018 Base name of the output file. 1020 exposure.writeFits(filename+
".fits")
1024 """Simulated gen2 butler data ref. 1026 Currently only supports get and put operations, which are most 1027 likely to be called for data in ISR processing. 1030 dataId =
"isrMock Fake Data" 1038 if 'config' in kwargs.keys():
1042 self.
config.isTrimmed =
True 1043 self.
config.doAddFringe =
True 1044 self.
config.readNoise = 10.0
1046 def get(self, dataType, **kwargs):
1047 """Return an appropriate data product. 1052 Type of data product to return. 1056 mock : IsrMock.run() result 1059 if "_filename" in dataType:
1060 return tempfile.mktemp(),
"mock" 1061 elif 'transmission_' in dataType:
1063 elif dataType ==
'ccdExposureId':
1065 elif dataType ==
'camera':
1067 elif dataType ==
'raw':
1069 elif dataType ==
'bias':
1071 elif dataType ==
'dark':
1073 elif dataType ==
'flat':
1075 elif dataType ==
'fringe':
1077 configCopy = copy.deepcopy(self.
config)
1078 for scale, x, y
in zip(self.
config.fringeScale, self.
config.fringeX0, self.
config.fringeY0):
1079 configCopy.fringeScale = [1.0]
1080 configCopy.fringeX0 = [x]
1081 configCopy.fringeY0 = [y]
1084 elif dataType ==
'defects':
1086 elif dataType ==
'bfKernel':
1088 elif dataType ==
'linearizer':
1090 elif dataType ==
'crosstalkSources':
1095 def put(self, exposure, filename):
1096 """Write an exposure to a FITS file. 1100 exposure : `lsst.afw.image.Exposure` 1101 Image data to write out. 1103 Base name of the output file. 1105 exposure.writeFits(filename+
".fits")
def amplifierAddNoise(self, ampData, mean, sigma)
def __init__(self, kwargs)
def __init__(self, kwargs)
def __init__(self, kwargs)
def amplifierAddSource(self, ampData, scale, x0, y0)
def __init__(self, kwargs)
std::shared_ptr< ImageT > flipImage(ImageT const &inImage, bool flipLR, bool flipTB)
Flip an image left–right and/or top–bottom.
def __init__(self, kwargs)
def amplifierAddYGradient(self, ampData, start, end)
def put(self, exposure, filename)
def __init__(self, kwargs)
Information about a single exposure of an imaging camera.
def __init__(self, kwargs)
def get(self, dataType, kwargs)
def amplifierAddFringe(self, amp, ampData, scale, x0=100, y0=0)
Fit spatial kernel using approximate fluxes for candidates, and solving a linear system of equations...
def __init__(self, kwargs)
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > * makeMaskedImage(typename std::shared_ptr< Image< ImagePixelT >> image, typename std::shared_ptr< Mask< MaskPixelT >> mask=Mask< MaskPixelT >(), typename std::shared_ptr< Image< VariancePixelT >> variance=Image< VariancePixelT >())
A function to return a MaskedImage of the correct type (cf.
def __init__(self, kwargs)
std::shared_ptr< Exposure< ImagePixelT, MaskPixelT, VariancePixelT > > makeExposure(MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &mimage, std::shared_ptr< geom::SkyWcs const > wcs=std::shared_ptr< geom::SkyWcs const >())
A function to return an Exposure of the correct type (cf.
def __init__(self, kwargs)
def __init__(self, kwargs)
Represent a 2-dimensional array of bitmask pixels.
def localCoordToExpCoord(self, ampData, x, y)
def __init__(self, kwargs)
def amplifierMultiplyFlat(self, amp, ampData, fracDrop, u0=100.0, v0=100.0)
def __init__(self, kwargs)
def run(self, skyInfo, tempExpRefList, imageScalerList, weightList, altMaskList=None, mask=None, supplementaryData=None)
def get(self, dataType, kwargs)
def put(self, exposure, filename)
Point in an unspecified spherical coordinate system.
def __init__(self, kwargs)
std::shared_ptr< SkyWcs > makeSkyWcs(TransformPoint2ToPoint2 const &pixelsToFieldAngle, lsst::geom::Angle const &orientation, bool flipX, lsst::geom::SpherePoint const &boresight, std::string const &projection="TAN")
Construct a FITS SkyWcs from camera geometry.
Eigen::Matrix2d makeCdMatrix(lsst::geom::Angle const &scale, lsst::geom::Angle const &orientation=0 *lsst::geom::degrees, bool flipX=false)
Make a WCS CD matrix.
def makeTransmissionCurve(self)
def __init__(self, kwargs)
def __init__(self, kwargs)
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
def amplifierAddCT(self, ampDataSource, ampDataTarget, scale)
An integer coordinate rectangle.
def makeCrosstalkCoeff(self)
def __init__(self, kwargs)