Coverage for python/astro_metadata_translator/translators/subaru.py: 85%

13 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-01-10 02:29 -0800

1# This file is part of astro_metadata_translator. 

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 LICENSE file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# Use of this source code is governed by a 3-clause BSD-style 

10# license that can be found in the LICENSE file. 

11 

12"""Metadata translation code for Subaru telescope""" 

13 

14from __future__ import annotations 

15 

16__all__ = ("SubaruTranslator",) 

17 

18from astropy.coordinates import EarthLocation 

19 

20from ..translator import cache_translation 

21from .fits import FitsTranslator 

22 

23 

24class SubaruTranslator(FitsTranslator): 

25 """Metadata translator for Subaru telescope headers.""" 

26 

27 @cache_translation 

28 def to_location(self) -> EarthLocation: 

29 """Returns the location of the Subaru telescope on Mauna Kea. 

30 

31 Hardcodes the location and does not look at any headers. 

32 

33 Returns 

34 ------- 

35 location : `astropy.coordinates.EarthLocation` 

36 An object representing the location of the telescope. 

37 """ 

38 return EarthLocation.from_geodetic(-155.476667, 19.825556, 4139.0) 

39 

40 @cache_translation 

41 def to_observation_counter(self) -> int: 

42 """Return the lifetime exposure number. 

43 

44 Returns 

45 ------- 

46 sequence : `int` 

47 The observation counter. 

48 """ 

49 return self.to_exposure_id()