Skip to content

Commit

Permalink
Remove getAmpImage
Browse files Browse the repository at this point in the history
Gen2-specific.
  • Loading branch information
timj committed Sep 6, 2022
1 parent 42eca3a commit 0f03fb9
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions python/lsst/obs/lsst/cameraTransforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import lsst.geom as geom
import lsst.afw.cameraGeom as cameraGeom

__all__ = ["LsstCameraTransforms", "getAmpImage", "channelToAmp"]
__all__ = ["LsstCameraTransforms", "channelToAmp"]


class LsstCameraTransforms():
Expand Down Expand Up @@ -273,41 +273,6 @@ def focalMmToAmpPixel(self, focalPlaneX, focalPlaneY):
ampX, ampY = ampXY
return detector.getName(), ampToChannel(amp), ampX, ampY

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


def getAmpImage(butler, dataId, channel):
r"""Return a amplifier image
Parameters
----------
butler : `lsst.daf.persistence.butler.Butler`
The butler which will perform the I/O
dataId : `dict` or `dafPersist.butler.DataId`
The dataId specifying the desired detector
channel : `int`
The 1-indexed channel ID for the desired amplifier
Returns
-------
detectorName : `lsst.afw.image.ExposureF`
The desired image
Notes
-----
The Gen2 butler can't quite do this natively as it doesn't
know how to only lookup things that it doesn't know, so we
so that for it, poor lamb
"""
keys = ["run", "detector"]
did = dataId.copy()
did.update(dict(zip(keys, butler.queryMetadata("raw", keys, did)[0])))
# the only snap is snap==0
did["snap"] = 0

return butler.get('raw_amp', did, channel=channel)


def ampToChannel(amp):
r"""Given an Amplifier, return the channel
Expand Down

0 comments on commit 0f03fb9

Please sign in to comment.