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-24664: Refactor data ID translation rule system #206

Merged
merged 1 commit into from
May 2, 2020
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
7 changes: 7 additions & 0 deletions python/lsst/obs/lsst/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from lsst.daf.butler.core.utils import getFullTypeName
from lsst.utils import getPackageDir
from lsst.obs.base.instrument import Instrument
from lsst.obs.base.gen2to3 import TranslatorFactory
from .filters import LSSTCAM_FILTER_DEFINITIONS, LATISS_FILTER_DEFINITIONS

from .translators import LatissTranslator, LsstCamTranslator, \
Expand Down Expand Up @@ -151,6 +152,12 @@ def extractDetectorRecord(self, camGeomDetector):
raft=group,
)

def makeDataIdTranslatorFactory(self) -> TranslatorFactory:
# Docstring inherited from lsst.obs.base.Instrument.
factory = TranslatorFactory()
factory.addGenericInstrumentRules(self.getName(), detectorKey="detector", exposureKey="expId")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thrown off by detectorKey="detector" (aren't they all?!?) until I remembered that this was about the names in gen2. Probably not worth a comment though.

return factory


class LsstComCam(LsstCam):
"""Gen3 Butler specialization for ComCam data.
Expand Down