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 | Functions
lsst.afw.cameraGeom._assembleImage Namespace Reference

Classes

class  AmplifierIsolator
 

Functions

def assembleAmplifierImage (destImage, rawImage, amplifier)
 
def assembleAmplifierRawImage (destImage, rawImage, amplifier)
 
def makeUpdatedDetector (ccd)
 

Function Documentation

◆ assembleAmplifierImage()

def lsst.afw.cameraGeom._assembleImage.assembleAmplifierImage (   destImage,
  rawImage,
  amplifier 
)
Assemble the amplifier region of an image from a raw image.

Parameters
----------
destImage : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage`
    Assembled image; the region amplifier.getBBox() is overwritten with
    the assembled amplifier image.
rawImage : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage`
    Raw image (same type as destImage).
amplifier : `lsst.afw.cameraGeom.Amplifier`
    Amplifier geometry, with raw amplifier info.

Raises
------
RuntimeError
    Raised if image types do not match or amplifier has no raw amplifier info.

Definition at line 52 of file _assembleImage.py.

52 def assembleAmplifierImage(destImage, rawImage, amplifier):
53  """Assemble the amplifier region of an image from a raw image.
54 
55  Parameters
56  ----------
57  destImage : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage`
58  Assembled image; the region amplifier.getBBox() is overwritten with
59  the assembled amplifier image.
60  rawImage : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage`
61  Raw image (same type as destImage).
62  amplifier : `lsst.afw.cameraGeom.Amplifier`
63  Amplifier geometry, with raw amplifier info.
64 
65  Raises
66  ------
67  RuntimeError
68  Raised if image types do not match or amplifier has no raw amplifier info.
69  """
70  if type(destImage.Factory) != type(rawImage.Factory): # noqa: E721
71  raise RuntimeError(f"destImage type = {type(destImage.Factory).__name__} != "
72  f"{type(rawImage.Factory).__name__} = rawImage type")
73  inView = rawImage.Factory(rawImage, amplifier.getRawDataBBox())
74  outView = destImage.Factory(destImage, amplifier.getBBox())
75 
76  _insertPixelChunk(outView, inView, amplifier,
77  hasattr(rawImage, "getArrays"))
78 
79 
table::Key< int > type
Definition: Detector.cc:163
def assembleAmplifierImage(destImage, rawImage, amplifier)

◆ assembleAmplifierRawImage()

def lsst.afw.cameraGeom._assembleImage.assembleAmplifierRawImage (   destImage,
  rawImage,
  amplifier 
)
Assemble the amplifier region of a raw CCD image.

For most cameras this is a no-op: the raw image already is an assembled
CCD image.
However, it is useful for camera such as LSST for which each amplifier
image is a separate image.

Parameters
----------
destImage : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage`
    CCD Image; the region amplifier.getRawAmplifier().getBBox()
    is overwritten with the raw amplifier image.
rawImage : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage`
    Raw image (same type as destImage).
amplifier : `lsst.afw.cameraGeom.Amplifier`
    Amplifier geometry with raw amplifier info

Raises
------
RuntimeError
    Raised if image types do not match or amplifier has no raw amplifier info.

Definition at line 80 of file _assembleImage.py.

80 def assembleAmplifierRawImage(destImage, rawImage, amplifier):
81  """Assemble the amplifier region of a raw CCD image.
82 
83  For most cameras this is a no-op: the raw image already is an assembled
84  CCD image.
85  However, it is useful for camera such as LSST for which each amplifier
86  image is a separate image.
87 
88  Parameters
89  ----------
90  destImage : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage`
91  CCD Image; the region amplifier.getRawAmplifier().getBBox()
92  is overwritten with the raw amplifier image.
93  rawImage : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage`
94  Raw image (same type as destImage).
95  amplifier : `lsst.afw.cameraGeom.Amplifier`
96  Amplifier geometry with raw amplifier info
97 
98  Raises
99  ------
100  RuntimeError
101  Raised if image types do not match or amplifier has no raw amplifier info.
102  """
103  if type(destImage.Factory) != type(rawImage.Factory): # noqa: E721
104  raise RuntimeError(f"destImage type = {type(destImage.Factory).__name__} != "
105  f"{type(rawImage.Factory).__name__} = rawImage type")
106  inBBox = amplifier.getRawBBox()
107  inView = rawImage.Factory(rawImage, inBBox)
108  outBBox = amplifier.getRawBBox()
109  outBBox.shift(amplifier.getRawXYOffset())
110  outView = destImage.Factory(destImage, outBBox)
111 
112  _insertPixelChunk(outView, inView, amplifier,
113  hasattr(rawImage, "getArrays"))
114 
115 
def assembleAmplifierRawImage(destImage, rawImage, amplifier)

◆ makeUpdatedDetector()

def lsst.afw.cameraGeom._assembleImage.makeUpdatedDetector (   ccd)
Return a Detector that has had the definitions of amplifier geometry
updated post assembly.

Parameters
----------
ccd : `lsst.afw.image.Detector`
    The detector to copy and update.

Definition at line 116 of file _assembleImage.py.

116 def makeUpdatedDetector(ccd):
117  """Return a Detector that has had the definitions of amplifier geometry
118  updated post assembly.
119 
120  Parameters
121  ----------
122  ccd : `lsst.afw.image.Detector`
123  The detector to copy and update.
124  """
125  builder = ccd.rebuild()
126  for amp in builder.getAmplifiers():
127  amp.transform()
128  return builder.finish()
129 
130