Coverage for python/lsst/obs/lsst/imsim.py: 93%
22 statements
« prev ^ index » next coverage.py v6.4.1, created at 2022-07-11 08:24 +0000
« prev ^ index » next coverage.py v6.4.1, created at 2022-07-11 08:24 +0000
1# This file is part of obs_lsst.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (http://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the LSST License Statement and
20# the GNU General Public License along with this program. If not,
21# see <http://www.lsstcorp.org/LegalNotices/>.
22#
23from . import LsstCamMapper, LsstCamMakeRawVisitInfo
24from .ingest import LsstCamParseTask
25from .translators import LsstCamImSimTranslator
26from ._instrument import LsstCamImSim
27from .filters import LSSTCAM_IMSIM_FILTER_DEFINITIONS
29__all__ = ["ImsimMapper", "ImsimParseTask"]
32class ImsimMakeRawVisitInfo(LsstCamMakeRawVisitInfo):
33 """Make a VisitInfo from the FITS header of a raw image."""
34 metadataTranslator = LsstCamImSimTranslator
37class ImsimMapper(LsstCamMapper):
38 """The Mapper for the imsim simulations of the LsstCam."""
39 translatorClass = LsstCamImSimTranslator
40 MakeRawVisitInfoClass = ImsimMakeRawVisitInfo
41 _gen3instrument = LsstCamImSim
43 _cameraName = "imsim"
44 yamlFileList = ["imsim/imsimMapper.yaml"] + list(LsstCamMapper.yamlFileList)
45 filterDefinitions = LSSTCAM_IMSIM_FILTER_DEFINITIONS
47 def bypass_ccdExposureId_bits(self, datasetType, pythonType, location, dataId):
48 """How many bits are required for the maximum exposure ID"""
49 return 34 # To match the value computed in gen3
52class ImsimParseTask(LsstCamParseTask):
53 """Parser suitable for imsim data.
54 """
56 _mapperClass = ImsimMapper
57 _translatorClass = LsstCamImSimTranslator
59 def translate_controller(self, md):
60 """Always return Simulation as controller for imsim data."""
61 return "S"