ReferenceMockLSST¶
- class lsst.ip.isr.ReferenceMockLSST(**kwargs)¶
- Bases: - IsrMockLSST- Parent class for those that make reference calibrations. - Methods Summary - addBiasLevel(ampData, biasLevel)- Add bias level to an amplifier's image data. - amplifierAddBrighterFatter(ampImageData, ...)- Add brighter fatter effect and/or diffusion to the image. Parameters ---------- ampImageData : - lsst.afw.image.ImageFAmplifier image to operate on. rng :- galsim.BaseDeviateRandom number generator. bfStrength :- floatScaling parameter of the brighter fatter effect (nominally = 1) nRecalc: 'int' The number of electrons to accumulate before recalculating the distortion of the pixel shapes.- amplifierAddDeferredCharge(exposure, amp)- Add serial CTI to the amplifier data. - amplifierAddFringe(amp, ampData, scale[, x0, y0])- Add a fringe-like ripple pattern to an amplifier's image data. - amplifierAddNoise(ampData, mean, sigma[, rng])- Add Gaussian noise to an amplifier's image data. - amplifierAddNonlinearity(ampData, centers, ...)- Add non-linearity to amplifier data. - amplifierAddSource(ampData, scale, x0, y0)- Add a single Gaussian source to an amplifier. - amplifierAddXGradient(ampData, start, end)- Add a x-axis linear gradient to an amplifier's image data. - amplifierAddYGradient(ampData, start, end)- Add a y-axis linear gradient to an amplifier's image data. - amplifierMultiplyFlat(amp, ampData, fracDrop)- Multiply an amplifier's image data by a flat-like pattern. - applyGain(ampData, gain)- Apply gain to the amplifier's data. - Empty (clear) the metadata for this Task and all sub-Tasks. - getCamera([isForAssembly])- Construct a test camera object. - getExposure([isTrimmed])- Construct a test exposure. - Get metadata for all tasks. - Get the task name as a hierarchical name including parent task names. - Get the full serial overscan bounding box from an amplifier. - getName()- Get the name of the task. - Get a dictionary of all tasks as a shallow copy. - getWcs()- Construct a dummy WCS object. - localCoordToExpCoord(ampData, x, y)- Convert between a local amplifier coordinate and the full exposure coordinate. - Generate a simple simulated brighter-fatter kernel. Returns ------- kernel : - lsst.ip.isr.BrighterFatterKernelSimulated brighter-fatter kernel.- Generate the simulated crosstalk coefficients. - makeData()- Generate simulated ISR data. - makeDefectList([isTrimmed])- Generate a simple defect list. - Generate a CTI calibration. - makeField(doc)- Make a - lsst.pex.config.ConfigurableFieldfor this task.- Generate a simulated ISR LSST image. - Generate a linearity dataset. - makeSubtask(name, **keyArgs)- Create a subtask as a new instance as the - nameattribute of this task.- Generate a simulated flat transmission curve. - roundADU(ampData)- Round adu to nearest integer. - run()- Generate a mock ISR product following LSSTCam ISR, and return it. - timer(name[, logLevel])- Context manager to log performance data for an arbitrary block of code. - Methods Documentation - addBiasLevel(ampData, biasLevel)¶
- Add bias level to an amplifier’s image data. - Parameters:
- ampDatalsst.afw.image.ImageF
- Amplifier image to operate on. 
- biasLevelfloat
- Bias level to be added to the image. 
 
- ampData
 
 - amplifierAddBrighterFatter(ampImageData, rng, bfStrength, nRecalc)¶
- Add brighter fatter effect and/or diffusion to the image. Parameters ———- ampImageData : - lsst.afw.image.ImageF- Amplifier image to operate on. - rnggalsim.BaseDeviate
- Random number generator. 
- bfStrengthfloat
- Scaling parameter of the brighter fatter effect (nominally = 1) 
- nRecalc: ‘int’
- The number of electrons to accumulate before recalculating the distortion of the pixel shapes. 
 
- rng
 - amplifierAddDeferredCharge(exposure, amp)¶
- Add serial CTI to the amplifier data. - Parameters:
- exposurelsst.afw.image.ExposureF
- The exposure object containing the amplifier to apply deferred charge to. 
- amplsst.afw.image.Amplifier
- The amplifier object (contains geometry info). 
 
- exposure
 
 - amplifierAddFringe(amp, ampData, scale, x0=100, y0=0)¶
- Add a fringe-like ripple pattern to an amplifier’s image data. - Parameters:
- ampAmpInfoRecord
- Amplifier to operate on. Needed for amp<->exp coordinate transforms. 
- ampDatalsst.afw.image.ImageF
- Amplifier image to operate on. 
- scalenumpy.arrayorfloat
- Peak intensity scaling for the ripple. 
- x0numpy.arrayorfloat, optional
- Fringe center 
- y0numpy.arrayorfloat, optional
- Fringe center 
 
- amp
 - Notes - This uses an offset sinc function to generate a ripple pattern. True fringes have much finer structure, but this pattern should be visually identifiable. The (x, y) coordinates are in the frame of the amplifier, and (u, v) in the frame of the full trimmed image. 
 - amplifierAddNoise(ampData, mean, sigma, rng=None)¶
- Add Gaussian noise to an amplifier’s image data. - This method operates in the amplifier coordinate frame. 
 - amplifierAddNonlinearity(ampData, centers, values, offset)¶
- Add non-linearity to amplifier data. - Parameters:
- ampDatalsst.afw.image.ImageF
- Amplifier image to operate on. 
- centersnp.ndarray
- Spline nodes. 
- valuesnp.ndarray
- Spline values. 
- offsetfloat
- Offset zero-point between linearizer (internal vs external). 
 
- ampData
 
 - amplifierAddSource(ampData, scale, x0, y0)¶
- Add a single Gaussian source to an amplifier. - This method operates in the amplifier coordinate frame. 
 - amplifierAddXGradient(ampData, start, end)¶
- Add a x-axis linear gradient to an amplifier’s image data. - This method operates in the amplifier coordinate frame. 
 - amplifierAddYGradient(ampData, start, end)¶
- Add a y-axis linear gradient to an amplifier’s image data. - This method operates in the amplifier coordinate frame. 
 - amplifierMultiplyFlat(amp, ampData, fracDrop, u0=100.0, v0=100.0)¶
- Multiply an amplifier’s image data by a flat-like pattern. - Parameters:
- amplsst.afw.ampInfo.AmpInfoRecord
- Amplifier to operate on. Needed for amp<->exp coordinate transforms. 
- ampDatalsst.afw.image.ImageF
- Amplifier image to operate on. 
- fracDropfloat
- Fractional drop from center to edge of detector along x-axis. 
- u0float
- Peak location in detector coordinates. 
- v0float
- Peak location in detector coordinates. 
 
- amp
 
 - applyGain(ampData, gain)¶
- Apply gain to the amplifier’s data. This method divides the data by the gain because the mocks need to convert the data in electron to adu, so it does the inverse operation to applyGains in isrFunctions. - Parameters:
- ampDatalsst.afw.image.ImageF
- Amplifier image to operate on. 
- gainfloat
- Gain value in electron/adu. 
 
- ampData
 
 - getCamera(isForAssembly=False)¶
- Construct a test camera object. - Parameters¶- isForAssemblybool
- If True, construct a camera with “super raw” orientation (all amplifiers have LL readout corner but still contains the necessary flip and offset info needed for assembly. This is needed if isLsstLike is True. If False, return a camera with bboxes flipped and offset to the correct orientation given the readout corner. 
 - Returns:
- cameralsst.afw.cameraGeom.camera
- Test camera. 
 
- camera
 
- isForAssembly
 - getExposure(isTrimmed=None)¶
- Construct a test exposure. - The test exposure has a simple WCS set, as well as a list of unlikely header keywords that can be removed during ISR processing to exercise that code. 
 - getFullMetadata() TaskMetadata¶
- Get metadata for all tasks. - Returns:
- metadataTaskMetadata
- The keys are the full task name. Values are metadata for the top-level task and all subtasks, sub-subtasks, etc. 
 
- metadata
 - Notes - The returned metadata includes timing information (if - @timer.timeMethodis used) and any metadata set by the task. The name of each item consists of the full task name with- .replaced by- :, followed by- .and the name of the item, e.g.:- topLevelTaskName:subtaskName:subsubtaskName.itemName - using - :in the full task name disambiguates the rare situation that a task has a subtask and a metadata item with the same name.
 - getFullName() str¶
- Get the task name as a hierarchical name including parent task names. - Returns:
- fullNamestr
- The full name consists of the name of the parent task and each subtask separated by periods. For example: - The full name of top-level task “top” is simply “top”. 
- The full name of subtask “sub” of top-level task “top” is “top.sub”. 
- The full name of subtask “sub2” of subtask “sub” of top-level task “top” is “top.sub.sub2”. 
 
 
- fullName
 
 - getFullSerialOverscanBBox(amp)¶
- Get the full serial overscan bounding box from an amplifier. - This includes the serial/parallel overscan region. - Parameters:
- amplsst.afw.ampInfo.AmpInfoRecord
- Amplifier to operate on. 
 
- amp
- Returns:
- bboxlsst.geom.Box2I
 
- bbox
 
 - getName() str¶
- Get the name of the task. - Returns:
- taskNamestr
- Name of the task. 
 
- taskName
 - See also - getFullName
- Get the full name of the task. 
 
 - getTaskDict() dict[str, weakref.ReferenceType[lsst.pipe.base.task.Task]]¶
- Get a dictionary of all tasks as a shallow copy. - Returns:
- taskDictdict
- Dictionary containing full task name: task object for the top-level task and all subtasks, sub-subtasks, etc. 
 
- taskDict
 
 - getWcs()¶
- Construct a dummy WCS object. - Taken from the deprecated ip_isr/examples/exampleUtils.py. - This is not guaranteed, given the distortion and pixel scale listed in the afwTestUtils camera definition. - Returns:
- wcslsst.afw.geom.SkyWcs
- Test WCS transform. 
 
- wcs
 
 - localCoordToExpCoord(ampData, x, y)¶
- Convert between a local amplifier coordinate and the full exposure coordinate. - Parameters:
- Returns:
 - Notes - The output is transposed intentionally here, to match the internal transpose between numpy and afw.image coordinates. 
 - makeBfKernel()¶
- Generate a simple simulated brighter-fatter kernel. Returns ——- kernel : - lsst.ip.isr.BrighterFatterKernel- Simulated brighter-fatter kernel. 
 - makeCrosstalkCoeff()¶
- Generate the simulated crosstalk coefficients. - Returns:
- coeffsnumpy.ndarray
- Simulated crosstalk coefficients. 
 
- coeffs
 
 - makeData()¶
- Generate simulated ISR data. - Currently, only the class defined crosstalk coefficient matrix, brighter-fatter kernel, a constant unity transmission curve, or a simple single-entry defect list can be generated. - Returns:
- dataProduct
- Simulated ISR data product. 
 
 
 - makeDefectList(isTrimmed=True)¶
- Generate a simple defect list. - Parameters:
- isTrimmedbool, optional
- Return defects in trimmed coordinates? 
 
- isTrimmed
- Returns:
- defectListlsst.meas.algorithms.Defects
- Simulated defect list 
 
- defectList
 
 - makeDeferredChargeCalib()¶
- Generate a CTI calibration. - Returns:
- ctilsst.ip.isr.deferredCharge.DeferredChargeCalib
- Simulated deferred charge calibration. 
 
- cti
 
 - classmethod makeField(doc: str) ConfigurableField¶
- Make a - lsst.pex.config.ConfigurableFieldfor this task.- Parameters:
- docstr
- Help text for the field. 
 
- doc
- Returns:
- configurableFieldlsst.pex.config.ConfigurableField
- A - ConfigurableFieldfor this task.
 
- configurableField
 - Examples - Provides a convenient way to specify this task is a subtask of another task. - Here is an example of use: - class OtherTaskConfig(lsst.pex.config.Config): aSubtask = ATaskClass.makeField("brief description of task") 
 - makeImage()¶
- Generate a simulated ISR LSST image. - Returns:
- exposurelsst.afw.image.Exposureordict
- Simulated ISR image data. 
 
- exposure
 - Notes - This method constructs a “raw” data image. 
 - makeLinearity()¶
- Generate a linearity dataset. - Returns:
- linearizerlsst.ip.isr.Linearizer
 
- linearizer
 
 - makeLinearizer()¶
 - makeSubtask(name: str, **keyArgs: Any) None¶
- Create a subtask as a new instance as the - nameattribute of this task.- Parameters:
- namestr
- Brief name of the subtask. 
- **keyArgs
- Extra keyword arguments used to construct the task. The following arguments are automatically provided and cannot be overridden: - config.
- parentTask.
 
 
- name
 - Notes - The subtask must be defined by - Task.config.name, an instance of- ConfigurableFieldor- RegistryField.
 - makeTransmissionCurve()¶
- Generate a simulated flat transmission curve. - Returns:
- transmissionlsst.afw.image.TransmissionCurve
- Simulated transmission curve. 
 
- transmission
 
 - roundADU(ampData)¶
- Round adu to nearest integer. - Parameters:
- ampDatalsst.afw.image.ImageF
- Amplifier image to operate on. 
 
- ampData
 
 - run()¶
- Generate a mock ISR product following LSSTCam ISR, and return it. - Returns:
- imagelsst.afw.image.Exposure
- Simulated ISR image with signals added. 
- dataProduct
- Simulated ISR data products. 
- None
- Returned if no valid configuration was found. 
 
- image
- Raises:
- RuntimeError
- Raised if both doGenerateImage and doGenerateData are specified.