Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

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 LsstImSimTranslator 

26from ._instrument import LsstImSim 

27from .filters import LSST_IMSIM_FILTER_DEFINITIONS 

28 

29__all__ = ["ImsimMapper", "ImsimParseTask"] 

30 

31 

32class ImsimMakeRawVisitInfo(LsstCamMakeRawVisitInfo): 

33 """Make a VisitInfo from the FITS header of a raw image.""" 

34 metadataTranslator = LsstImSimTranslator 

35 

36 

37class ImsimMapper(LsstCamMapper): 

38 """The Mapper for the imsim simulations of the LsstCam.""" 

39 translatorClass = LsstImSimTranslator 

40 MakeRawVisitInfoClass = ImsimMakeRawVisitInfo 

41 _gen3instrument = LsstImSim 

42 

43 _cameraName = "imsim" 

44 yamlFileList = ["imsim/imsimMapper.yaml"] + list(LsstCamMapper.yamlFileList) 

45 filterDefinitions = LSST_IMSIM_FILTER_DEFINITIONS 

46 

47 def bypass_ccdExposureId_bits(self, datasetType, pythonType, location, dataId): 

48 """How many bits are required for the maximum exposure ID""" 

49 return 38 # max detector_exposure_id ~ 60000000205 

50 

51 

52class ImsimParseTask(LsstCamParseTask): 

53 """Parser suitable for imsim data. 

54 """ 

55 

56 _mapperClass = ImsimMapper 

57 _translatorClass = LsstImSimTranslator 

58 

59 def translate_controller(self, md): 

60 """Always return Simulation as controller for imsim data.""" 

61 return "S"