LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
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.