Coverage for python/astro_metadata_translator/translators/subaru.py: 87%
13 statements
« prev ^ index » next coverage.py v6.4.4, created at 2022-09-11 01:05 -0700
« prev ^ index » next coverage.py v6.4.4, created at 2022-09-11 01:05 -0700
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.
12"""Metadata translation code for Subaru telescope"""
14from __future__ import annotations
16__all__ = ("SubaruTranslator",)
18from astropy.coordinates import EarthLocation
20from ..translator import cache_translation
21from .fits import FitsTranslator
24class SubaruTranslator(FitsTranslator):
25 """Metadata translator for Subaru telescope headers."""
27 @cache_translation
28 def to_location(self) -> EarthLocation:
29 """Returns the location of the Subaru telescope on Mauna Kea.
31 Hardcodes the location and does not look at any headers.
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)
40 @cache_translation
41 def to_observation_counter(self) -> int:
42 """Return the lifetime exposure number.
44 Returns
45 -------
46 sequence : `int`
47 The observation counter.
48 """
49 return self.to_exposure_id()