LSST Applications 24.1.6,g063fba187b+56b85ce14a,g0f08755f38+df8a265115,g12f32b3c4e+891a09f10d,g1524ad2192+7a5d7b3fbd,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g28da252d5a+07cb1400be,g2bbee38e9b+ae03bbfc84,g2bc492864f+ae03bbfc84,g3156d2b45e+6e55a43351,g347aa1857d+ae03bbfc84,g35bb328faa+a8ce1bb630,g3a166c0a6a+ae03bbfc84,g3e281a1b8c+c5dd892a6c,g414038480c+6b9177ef31,g41af890bb2+8f257c4c0b,g781aacb6e4+a8ce1bb630,g7af13505b9+7137b3b17d,g80478fca09+6df6903293,g82479be7b0+091ce1d07f,g858d7b2824+df8a265115,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,g9726552aa6+414189b318,ga5288a1d22+4a2bca08d7,gacef1a1666+c9a8ff65f4,gb58c049af0+d64f4d3760,gbcfae0f0a0+de1d42d831,gc28159a63d+ae03bbfc84,gcf0d15dbbd+72117bf34e,gda6a2b7d83+72117bf34e,gdaeeff99f8+1711a396fd,ge500cccec5+c8c9c9af63,ge79ae78c31+ae03bbfc84,gf0baf85859+c1f95f4921,gfa517265be+df8a265115,gfa999e8aa5+17cd334064,gfb92a5be7c+df8a265115
LSST Data Management Base Package
|
Classes | |
class | ButlerImage |
class | FakeImageDataSource |
Functions | |
prepareWcsData (wcs, amp, isTrimmed=True) | |
plotFocalPlane (camera, fieldSizeDeg_x=0, fieldSizeDeg_y=None, dx=0.1, dy=0.1, figsize=(10., 10.), useIds=False, showFig=True, savePath=None) | |
makeImageFromAmp (amp, imValue=None, imageFactory=afwImage.ImageU, markSize=10, markValue=0, scaleGain=lambda gain:(gain *1000)//10) | |
calcRawCcdBBox (ccd) | |
makeImageFromCcd (ccd, isTrimmed=True, showAmpGain=True, imageFactory=afwImage.ImageU, rcMarkSize=10, binSize=1) | |
rawCallback (im, ccd=None, imageSource=None, correctGain=False, subtractBias=False, convertToFloat=False, obeyNQuarter=True) | |
overlayCcdBoxes (ccd, untrimmedCcdBbox=None, nQuarter=0, isTrimmed=False, ccdOrigin=(0, 0), display=None, binSize=1) | |
showAmp (amp, imageSource=FakeImageDataSource(isTrimmed=False), display=None, overlay=True, imageFactory=afwImage.ImageU) | |
showCcd (ccd, imageSource=FakeImageDataSource(), display=None, overlay=True, imageFactory=afwImage.ImageF, binSize=1, inCameraCoords=False) | |
getCcdInCamBBoxList (ccdList, binSize, pixelSize_o, origin) | |
getCameraImageBBox (camBbox, pixelSize, bufferSize) | |
makeImageFromCamera (camera, detectorNameList=None, background=numpy.nan, bufferSize=10, imageSource=FakeImageDataSource(), imageFactory=afwImage.ImageU, binSize=1) | |
showCamera (camera, imageSource=FakeImageDataSource(), imageFactory=afwImage.ImageF, detectorNameList=None, binSize=10, bufferSize=10, overlay=True, title="", showWcs=None, ctype=afwDisplay.GREEN, textSize=1.25, originAtCenter=True, display=None, **kwargs) | |
makeFocalPlaneWcs (pixelSize, referencePixel) | |
findAmp (ccd, pixelPosition) | |
Variables | |
_LOG = logging.getLogger(__name__) | |
Support for displaying cameraGeom objects.
lsst.afw.cameraGeom.utils.calcRawCcdBBox | ( | ccd | ) |
Calculate the raw ccd bounding box. Parameters ---------- ccd : `lsst.afw.cameraGeom.Detector` Detector for which to calculate the un-trimmed bounding box. Returns ------- bbox : `lsst.geom.Box2I` or `None` Bounding box of the un-trimmed Detector, or `None` if there is not enough information to calculate raw BBox.
Definition at line 244 of file utils.py.
lsst.afw.cameraGeom.utils.findAmp | ( | ccd, | |
pixelPosition ) |
Find the Amp with the specified pixel position within the composite Parameters ---------- ccd : `lsst.afw.cameraGeom.Detector` Detector to look in. pixelPosition : `lsst.geom.Point2I` The pixel position to find the amp for. Returns ------- `lsst.afw.table.AmpInfoCatalog` Amp record in which ``pixelPosition`` falls or `None` if no Amp found.
Definition at line 1064 of file utils.py.
lsst.afw.cameraGeom.utils.getCameraImageBBox | ( | camBbox, | |
pixelSize, | |||
bufferSize ) |
Get the bounding box of a camera sized image in pixels Parameters ---------- camBbox : `lsst.geom.Box2D` Camera bounding box in focal plane coordinates (mm). pixelSize : `float` Size of a detector pixel in mm. bufferSize : `int` Buffer around edge of image in pixels. Returns ------- box : `lsst.geom.Box2I` The resulting bounding box.
Definition at line 829 of file utils.py.
lsst.afw.cameraGeom.utils.getCcdInCamBBoxList | ( | ccdList, | |
binSize, | |||
pixelSize_o, | |||
origin ) |
Get the bounding boxes of a list of Detectors within a camera sized pixel grid Parameters ---------- ccdList : `lsst.afw.cameraGeom.Detector` List of Detector. binSize : `int` Bin the image by this factor in both dimensions. pixelSize_o : `float` Size of the pixel in mm. origin : `int` Origin of the camera pixel grid in pixels. Returns ------- boxList : `list` [`lsst.geom.Box2I`] A list of bounding boxes in camera pixel coordinates.
Definition at line 785 of file utils.py.
lsst.afw.cameraGeom.utils.makeFocalPlaneWcs | ( | pixelSize, | |
referencePixel ) |
Make a WCS for the focal plane geometry (i.e. one that returns positions in "mm") Parameters ---------- pixelSize : `float` Size of the image pixels in physical units referencePixel : `lsst.geom.Point2D` Pixel for origin of WCS Returns ------- `lsst.afw.geom.Wcs` Wcs object for mapping between pixels and focal plane.
Definition at line 1032 of file utils.py.
lsst.afw.cameraGeom.utils.makeImageFromAmp | ( | amp, | |
imValue = None, | |||
imageFactory = afwImage.ImageU, | |||
markSize = 10, | |||
markValue = 0, | |||
scaleGain = lambda gain: (gain*1000)//10 ) |
Make an image from an amp object. Since images are integer images by default, the gain needs to be scaled to give enough dynamic range to see variation from amp to amp. The scaling algorithm is assignable. Parameters ---------- amp : `lsst.afw.table.AmpInfoRecord` Amp record to use for constructing the raw amp image. imValue : `float` or `None` Value to assign to the constructed image, or scaleGain(gain) if `None`. imageFactory : callable like `lsst.afw.image.Image` Type of image to construct. markSize : `float` Size of mark at read corner in pixels. markValue : `float` Value of pixels in the read corner mark. scaleGain : callable The function by which to scale the gain (must take a single argument). Returns ------- ampImage : `lsst.afw.image` An untrimmed amp image, of the type produced by ``imageFactory``.
Definition at line 185 of file utils.py.
lsst.afw.cameraGeom.utils.makeImageFromCamera | ( | camera, | |
detectorNameList = None, | |||
background = numpy.nan, | |||
bufferSize = 10, | |||
imageSource = FakeImageDataSource(), | |||
imageFactory = afwImage.ImageU, | |||
binSize = 1 ) |
Make an Image of a Camera. Put each detector's image in the correct location and orientation on the focal plane. The input images can be binned to an integer fraction of their original bboxes. Parameters ---------- camera : `lsst.afw.cameraGeom.Camera` Camera object to use to make the image. detectorNameList : `list` [`str`] List of detector names from ``camera`` to use in building the image. Use all Detectors if `None`. background : `float` Value to use where there is no Detector. bufferSize : `int` Size of border in binned pixels to make around the camera image. imageSource : `FakeImageDataSource` or `None` Source to get ccd images. Must have a ``getCcdImage()`` method. imageFactory : callable like `lsst.afw.image.Image` Type of image to build. binSize : `int` Bin the image by this factor in both dimensions. Returns ------- image : `lsst.afw.image.Image` Image of the entire camera.
Definition at line 855 of file utils.py.
lsst.afw.cameraGeom.utils.makeImageFromCcd | ( | ccd, | |
isTrimmed = True, | |||
showAmpGain = True, | |||
imageFactory = afwImage.ImageU, | |||
rcMarkSize = 10, | |||
binSize = 1 ) |
Make an Image of a CCD. Parameters ---------- ccd : `lsst.afw.cameraGeom.Detector` Detector to use in making the image. isTrimmed : `bool` Assemble a trimmed Detector image. showAmpGain : `bool` Use the per-amp gain to color the pixels in the image? imageFactory : callable like `lsst.afw.image.Image` Image type to generate. rcMarkSize : `float` Size of the mark to make in the amp images at the read corner. binSize : `int` Bin the image by this factor in both dimensions. Returns ------- image : `lsst.afw.image.Image` Image of the Detector (type returned by ``imageFactory``).
Definition at line 266 of file utils.py.
lsst.afw.cameraGeom.utils.overlayCcdBoxes | ( | ccd, | |
untrimmedCcdBbox = None, | |||
nQuarter = 0, | |||
isTrimmed = False, | |||
ccdOrigin = (0, 0), | |||
display = None, | |||
binSize = 1 ) |
Overlay bounding boxes on an image display. Parameters ---------- ccd : `lsst.afw.cameraGeom.Detector` Detector to iterate for the amp bounding boxes. untrimmedCcdBbox : `lsst.geom.Box2I` or `None` Bounding box of the un-trimmed Detector. nQuarter : `int` number of 90 degree rotations to apply to the bounding boxes (used for rotated chips). isTrimmed : `bool` Is the Detector image over which the boxes are layed trimmed? ccdOrigin : `tuple` of `float` Detector origin relative to the parent origin if in a larger pixel grid. display : `lsst.afw.display.Display` Image display to display on. binSize : `int` Bin the image by this factor in both dimensions. Notes ----- The colours are: - Entire detector GREEN - All data for amp GREEN - HorizontalPrescan YELLOW - HorizontalOverscan RED - Data BLUE - VerticalOverscan MAGENTA - VerticalOverscan MAGENTA
Definition at line 585 of file utils.py.
lsst.afw.cameraGeom.utils.plotFocalPlane | ( | camera, | |
fieldSizeDeg_x = 0, | |||
fieldSizeDeg_y = None, | |||
dx = 0.1, | |||
dy = 0.1, | |||
figsize = (10., 10.), | |||
useIds = False, | |||
showFig = True, | |||
savePath = None ) |
Make a plot of the focal plane along with a set points that sample the field of view. Parameters ---------- camera : `lsst.afw.cameraGeom.Camera` A camera object fieldSizeDeg_x : `float` Amount of the field to sample in x in degrees fieldSizeDeg_y : `float` or `None` Amount of the field to sample in y in degrees dx : `float` Spacing of sample points in x in degrees dy : `float` Spacing of sample points in y in degrees figsize : `tuple` containing two `float` Matplotlib style tuple indicating the size of the figure in inches useIds : `bool` Label detectors by name, not id? showFig : `bool` Display the figure on the screen? savePath : `str` or `None` If not `None`, save a copy of the figure to this name.
Definition at line 88 of file utils.py.
lsst.afw.cameraGeom.utils.prepareWcsData | ( | wcs, | |
amp, | |||
isTrimmed = True ) |
Put Wcs from an Amp image into CCD coordinates Parameters ---------- wcs : `lsst.afw.geom.SkyWcs` The WCS object to start from. amp : `lsst.afw.table.AmpInfoRecord` Amp object to use isTrimmed : `bool` Is the image to which the WCS refers trimmed of non-imaging pixels? Returns ------- ampWcs : `lsst.afw.geom.SkyWcs` The modified WCS.
Definition at line 56 of file utils.py.
lsst.afw.cameraGeom.utils.rawCallback | ( | im, | |
ccd = None, | |||
imageSource = None, | |||
correctGain = False, | |||
subtractBias = False, | |||
convertToFloat = False, | |||
obeyNQuarter = True ) |
A callback function that may or may not subtract bias/correct gain/trim a raw image. Parameters ---------- im : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage` or `lsst.afw.image.Exposure` An image of a chip, ready to be binned and maybe rotated. ccd : `lsst.afw.cameraGeom.Detector` or `None` The Detector; if `None` assume that im is an exposure and extract its Detector. imageSource : `FakeImageDataSource` or `None` Source to get ccd images. Must have a `getCcdImage()` method. correctGain : `bool` Correct each amplifier for its gain? subtractBias : `bool` Subtract the bias from each amplifier? convertToFloat : `bool` Convert ``im`` to floating point if possible. obeyNQuarter : `bool` Obey nQuarter from the Detector (default: True) Returns ------- image : `lsst.afw.image.Image` like The constructed image (type returned by ``im.Factory``). Notes ----- If imageSource is derived from ButlerImage, imageSource.butler is available.
Definition at line 512 of file utils.py.
lsst.afw.cameraGeom.utils.showAmp | ( | amp, | |
imageSource = FakeImageDataSource(isTrimmed=False), | |||
display = None, | |||
overlay = True, | |||
imageFactory = afwImage.ImageU ) |
Show an amp in an image display. Parameters ---------- amp : `lsst.afw.tables.AmpInfoRecord` Amp record to use in display. imageSource : `FakeImageDataSource` or `None` Source for getting the amp image. Must have a ``getAmpImage()`` method. display : `lsst.afw.display.Display` Image display to use. overlay : `bool` Overlay bounding boxes? imageFactory : callable like `lsst.afw.image.Image` Type of image to display (only used if ampImage is `None`).
Definition at line 685 of file utils.py.
lsst.afw.cameraGeom.utils.showCamera | ( | camera, | |
imageSource = FakeImageDataSource(), | |||
imageFactory = afwImage.ImageF, | |||
detectorNameList = None, | |||
binSize = 10, | |||
bufferSize = 10, | |||
overlay = True, | |||
title = "", | |||
showWcs = None, | |||
ctype = afwDisplay.GREEN, | |||
textSize = 1.25, | |||
originAtCenter = True, | |||
display = None, | |||
** | kwargs ) |
Show a Camera on display, with the specified display. The rotation of the sensors is snapped to the nearest multiple of 90 deg. Also note that the pixel size is constant over the image array. The lower left corner (LLC) of each sensor amp is snapped to the LLC of the pixel containing the LLC of the image. Parameters ---------- camera : `lsst.afw.cameraGeom.Camera` Camera object to use to make the image. imageSource : `FakeImageDataSource` or `None` Source to get ccd images. Must have a ``getCcdImage()`` method. imageFactory : `lsst.afw.image.Image` Type of image to make detectorNameList : `list` [`str`] or `None` List of detector names from `camera` to use in building the image. Use all Detectors if `None`. binSize : `int` Bin the image by this factor in both dimensions. bufferSize : `int` Size of border in binned pixels to make around the camera image. overlay : `bool` Overlay Detector IDs and boundaries? title : `str` Title to use in display. showWcs : `bool` Include a WCS in the display? ctype : `lsst.afw.display.COLOR` or `str` Color to use when drawing Detector boundaries. textSize : `float` Size of detector labels originAtCenter : `bool` Put origin of the camera WCS at the center of the image? If `False`, the origin will be at the lower left. display : `lsst.afw.display` Image display on which to display. **kwargs : All remaining keyword arguments are passed to makeImageFromCamera Returns ------- image : `lsst.afw.image.Image` The mosaic image.
Definition at line 926 of file utils.py.
lsst.afw.cameraGeom.utils.showCcd | ( | ccd, | |
imageSource = FakeImageDataSource(), | |||
display = None, | |||
overlay = True, | |||
imageFactory = afwImage.ImageF, | |||
binSize = 1, | |||
inCameraCoords = False ) |
Show a CCD on display. Parameters ---------- ccd : `lsst.afw.cameraGeom.Detector` Detector to use in display. imageSource : `FakeImageDataSource` or `None` Source to get ccd images. Must have a ``getCcdImage()`` method. display : `lsst.afw.display.Display` image display to use. overlay : `bool` Show amp bounding boxes on the displayed image? imageFactory : callable like `lsst.afw.image.Image` The image factory to use in generating the images. binSize : `int` Bin the image by this factor in both dimensions. inCameraCoords : `bool` Show the Detector in camera coordinates?
Definition at line 734 of file utils.py.