Skip to content

Commit

Permalink
Add method to gen2 mapper to return gen3 instrument
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jul 10, 2020
1 parent 7159dfd commit 2fe9ef0
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/lsst/obs/lsst/comCam.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from . import LsstCamMapper, LsstCamMakeRawVisitInfo
from .ingest import LsstCamParseTask
from .translators import LsstComCamTranslator
from ._instrument import LsstComCam

__all__ = ["LsstComCamMapper", "LsstComCamParseTask"]

Expand All @@ -36,6 +37,7 @@ class LsstComCamMapper(LsstCamMapper):
"""The Mapper for the LSST ComCam camera."""
translatorClass = LsstComCamTranslator
MakeRawVisitInfoClass = LsstComCamMakeRawVisitInfo
_gen3instrument = LsstComCam
_cameraName = "comCam"


Expand Down
2 changes: 2 additions & 0 deletions python/lsst/obs/lsst/imsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from . import LsstCamMapper, LsstCamMakeRawVisitInfo
from .ingest import LsstCamParseTask
from .translators import LsstImSimTranslator
from ._instrument import LsstImSim

__all__ = ["ImsimMapper", "ImsimParseTask"]

Expand All @@ -36,6 +37,7 @@ class ImsimMapper(LsstCamMapper):
"""The Mapper for the imsim simulations of the LsstCam."""
translatorClass = LsstImSimTranslator
MakeRawVisitInfoClass = ImsimMakeRawVisitInfo
_gen3instrument = LsstImSim

_cameraName = "imsim"
yamlFileList = ["imsim/imsimMapper.yaml"] + list(LsstCamMapper.yamlFileList)
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/obs/lsst/latiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from .ingest import LsstCamParseTask
from .translators import LatissTranslator
from .filters import LATISS_FILTER_DEFINITIONS
from ._instrument import Latiss

__all__ = ["LatissMapper", "LatissParseTask"]

Expand All @@ -40,6 +41,7 @@ class LatissMapper(LsstCamMapper):
"""The Mapper for the LATISS camera."""

MakeRawVisitInfoClass = LatissMakeRawVisitInfo
_gen3instrument = Latiss

_cameraName = "latiss"
yamlFileList = ["latiss/latissMapper.yaml"] + list(LsstCamMapper.yamlFileList)
Expand Down
15 changes: 15 additions & 0 deletions python/lsst/obs/lsst/lsstCamMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import lsst.daf.persistence as dafPersist
from .translators import LsstCamTranslator
from ._fitsHeader import readRawFitsHeader
from ._instrument import LsstCam

from .filters import LSSTCAM_FILTER_DEFINITIONS
from .assembly import attachRawWcsFromBoresight, fixAmpsAndAssemble
Expand Down Expand Up @@ -408,9 +409,23 @@ def std_raw(self, item, dataId, filter=True):
setVisitInfo=False, # it's already set, and the metadata's stripped
filter=filter)

@classmethod
def getGen3Instrument(cls):
"""Return the gen3 Instrument class equivalent for this gen2 Mapper.
Returns
-------
instr : `type`
A `~lsst.obs.base.Instrument` class.
"""
if cls._gen3instrument is None:
raise RuntimeError(f"Mapper {cls} forgot to set gen3 instrument internally")
return cls._gen3instrument


class LsstCamMapper(LsstCamBaseMapper):
"""The mapper for lsstCam."""
translatorClass = LsstCamTranslator
MakeRawVisitInfoClass = LsstCamRawVisitInfo
_cameraName = "lsstCam"
_gen3instrument = LsstCam
2 changes: 2 additions & 0 deletions python/lsst/obs/lsst/phosim.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from . import LsstCamMapper, LsstCamMakeRawVisitInfo
from .ingest import LsstCamParseTask
from .translators import LsstPhoSimTranslator
from ._instrument import LsstPhoSim

__all__ = ["PhosimMapper", "PhosimParseTask", "PhosimEimgParseTask"]

Expand All @@ -36,6 +37,7 @@ class PhosimMapper(LsstCamMapper):
"""The Mapper for the phosim simulations of the LsstCam."""
translatorClass = LsstPhoSimTranslator
MakeRawVisitInfoClass = PhosimRawVisitInfo
_gen3instrument = LsstPhoSim

_cameraName = "phosim"
yamlFileList = ["imsim/imsimMapper.yaml"] + list(LsstCamMapper.yamlFileList)
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/obs/lsst/ts3.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from . import LsstCamMapper, LsstCamMakeRawVisitInfo
from .ingest import LsstCamParseTask
from .translators import LsstTS3Translator
from ._instrument import LsstTS3

__all__ = ["Ts3Mapper", "Ts3ParseTask"]

Expand All @@ -36,6 +37,7 @@ class Ts3Mapper(LsstCamMapper):
"""The Mapper for the ts3 camera."""
translatorClass = LsstTS3Translator
MakeRawVisitInfoClass = Ts3MakeRawVisitInfo
_gen3instrument = LsstTS3
_cameraName = "ts3"
yamlFileList = ["ts3/ts3Mapper.yaml"] + list(LsstCamMapper.yamlFileList)

Expand Down
2 changes: 2 additions & 0 deletions python/lsst/obs/lsst/ts8.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from . import LsstCamMapper, LsstCamMakeRawVisitInfo
from .ingest import LsstCamParseTask
from .translators import LsstTS8Translator
from ._instrument import LsstTS8

__all__ = ["Ts8Mapper", "Ts8ParseTask"]

Expand All @@ -36,6 +37,7 @@ class Ts8Mapper(LsstCamMapper):
"""The Mapper for the ts8 camera."""
translatorClass = LsstTS8Translator
MakeRawVisitInfoClass = Ts8MakeRawVisitInfo
_gen3instrument = LsstTS8
_cameraName = "ts8"
yamlFileList = ["ts8/ts8Mapper.yaml"] + list(LsstCamMapper.yamlFileList)

Expand Down
2 changes: 2 additions & 0 deletions python/lsst/obs/lsst/ucd.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from . import LsstCamMapper, LsstCamMakeRawVisitInfo
from .ingest import LsstCamParseTask
from .translators import LsstUCDCamTranslator
from ._instrument import LsstUCDCam

__all__ = ["UcdMapper", "UcdParseTask"]

Expand All @@ -36,6 +37,7 @@ class UcdMapper(LsstCamMapper):
"""The Mapper for the UCDavis camera."""
translatorClass = LsstUCDCamTranslator
MakeRawVisitInfoClass = UcdMakeRawVisitInfo
_gen3instrument = LsstUCDCam

_cameraName = "ucd"
yamlFileList = ["ucd/ucdMapper.yaml"] + list(LsstCamMapper.yamlFileList)
Expand Down

0 comments on commit 2fe9ef0

Please sign in to comment.