Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-35902: Remove getAmpImage #419

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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