LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Classes | |
class | FakeImageDataSource |
class | ButlerImage |
Functions | |
def | prepareWcsData (wcs, amp, isTrimmed=True) |
def | plotFocalPlane (camera, fieldSizeDeg_x=0, fieldSizeDeg_y=None, dx=0.1, dy=0.1, figsize=(10., 10.), useIds=False, showFig=True, savePath=None) |
def | makeImageFromAmp (amp, imValue=None, imageFactory=afwImage.ImageU, markSize=10, markValue=0, scaleGain=lambda gain:(gain *1000)//10) |
def | calcRawCcdBBox (ccd) |
def | makeImageFromCcd (ccd, isTrimmed=True, showAmpGain=True, imageFactory=afwImage.ImageU, rcMarkSize=10, binSize=1) |
def | rawCallback (im, ccd=None, imageSource=None, correctGain=False, subtractBias=False, convertToFloat=False, obeyNQuarter=True) |
def | overlayCcdBoxes (ccd, untrimmedCcdBbox=None, nQuarter=0, isTrimmed=False, ccdOrigin=(0, 0), display=None, binSize=1) |
def | showAmp (amp, imageSource=FakeImageDataSource(isTrimmed=False), display=None, overlay=True, imageFactory=afwImage.ImageU) |
def | showCcd (ccd, imageSource=FakeImageDataSource(), display=None, overlay=True, imageFactory=afwImage.ImageF, binSize=1, inCameraCoords=False) |
def | getCcdInCamBBoxList (ccdList, binSize, pixelSize_o, origin) |
def | getCameraImageBBox (camBbox, pixelSize, bufferSize) |
def | makeImageFromCamera (camera, detectorNameList=None, background=numpy.nan, bufferSize=10, imageSource=FakeImageDataSource(), imageFactory=afwImage.ImageU, binSize=1) |
def | 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) |
def | makeFocalPlaneWcs (pixelSize, referencePixel) |
def | findAmp (ccd, pixelPosition) |
def 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.
def 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 1067 of file utils.py.
def 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 832 of file utils.py.
def 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 788 of file utils.py.
def 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 1035 of file utils.py.
def 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.
def 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 858 of file utils.py.
def 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.
def 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 588 of file utils.py.
def 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.
def 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.
def 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 515 of file utils.py.
def 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 688 of file utils.py.
def 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 930 of file utils.py.
def 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 737 of file utils.py.