Skip to content

Commit

Permalink
Merge pull request #210 from lsst/tickets/DM-24924
Browse files Browse the repository at this point in the history
DM-24924: Update telescope names
  • Loading branch information
timj committed May 14, 2020
2 parents 6e4eac3 + cee9386 commit 3ce2d20
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 48 deletions.
5 changes: 3 additions & 2 deletions python/lsst/obs/lsst/translators/comCam.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import logging

from .lsstCam import LsstCamTranslator
from .lsst import SIMONYI_TELESCOPE

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -69,11 +70,11 @@ def can_translate(cls, header, filename=None):
if "INSTRUME" in header and "TELESCOP" in header:
telescope = header["TELESCOP"]
instrument = header["INSTRUME"].lower()
if instrument == "comcam" and telescope == "LSST":
if instrument == "comcam" and telescope in (SIMONYI_TELESCOPE, "LSST"):
return True
telcode = header.get("TELCODE", None)
# Some lab data reports that it is LSST_CAMERA
if telcode == "CC" and telescope == "LSST":
if telcode == "CC" and telescope in (SIMONYI_TELESCOPE, "LSST"):
return True

return False
Expand Down
4 changes: 1 addition & 3 deletions python/lsst/obs/lsst/translators/latiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ class LatissTranslator(LsstBaseTranslator):
"""Supports the LATISS instrument."""

_const_map = {
# LATISS is not yet attached to a telescope so many translations
# are null.
"instrument": "LATISS",
"telescope": "LSSTAuxTel",
"telescope": "Rubin Auxiliary Telescope",
"detector_group": _DETECTOR_GROUP_NAME,
"detector_num": 0,
"detector_name": _DETECTOR_NAME, # Single sensor
Expand Down
12 changes: 8 additions & 4 deletions python/lsst/obs/lsst/translators/lsst.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

"""Metadata translation support code for LSST headers"""

__all__ = ("ROLLOVERTIME", "TZERO", "LSST_LOCATION", "read_detector_ids",
"compute_detector_exposure_id_generic", "LsstBaseTranslator")
__all__ = ("ROLLOVERTIME", "TZERO", "SIMONYI_LOCATION", "read_detector_ids",
"compute_detector_exposure_id_generic", "LsstBaseTranslator",
"SIMONYI_TELESCOPE")

import os.path
import yaml
Expand Down Expand Up @@ -43,7 +44,10 @@
GROUP_RE = re.compile(r"^(\d\d\d\d\-\d\d\-\d\dT\d\d:\d\d:\d\d)\.(\d\d\d)(?:[\+#](\d+))?$")

# LSST Default location in the absence of headers
LSST_LOCATION = EarthLocation.from_geodetic(-70.749417, -30.244639, 2663.0)
SIMONYI_LOCATION = EarthLocation.from_geodetic(-70.749417, -30.244639, 2663.0)

# Name of the main survey telescope
SIMONYI_TELESCOPE = "Simonyi Survey Telescope"

obs_lsst_packageDir = getPackageDir("obs_lsst")

Expand Down Expand Up @@ -155,7 +159,7 @@ class LsstBaseTranslator(FitsTranslator):
"""Maximum number of detectors to use when calculating the
detector_exposure_id."""

_DEFAULT_LOCATION = LSST_LOCATION
_DEFAULT_LOCATION = SIMONYI_LOCATION
"""Default telescope location in absence of relevant FITS headers."""

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/obs/lsst/translators/lsstCam.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# from astro_metadata_translator import cache_translation
from astro_metadata_translator.translators.helpers import is_non_science

from .lsst import LsstBaseTranslator
from .lsst import LsstBaseTranslator, SIMONYI_TELESCOPE

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -49,7 +49,7 @@ class LsstCamTranslator(LsstBaseTranslator):
"""Supports the lsstCam instrument."""

_const_map = {
"telescope": "LSST",
"telescope": SIMONYI_TELESCOPE,
# Migrate these to full translations once test data appears that
# includes them
"boresight_rotation_coord": "unknown",
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/lsst/translators/lsst_ucdcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class LsstUCDCamTranslator(LsstBaseTranslator):

_const_map = {
# TS8 is not attached to a telescope so many translations are null.
"telescope": "LSST",
"telescope": None,
"location": None,
"boresight_rotation_coord": None,
"boresight_rotation_angle": None,
Expand Down
10 changes: 5 additions & 5 deletions python/lsst/obs/lsst/translators/lsstsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from astropy.coordinates import AltAz
from astro_metadata_translator import cache_translation

from .lsst import LsstBaseTranslator, LSST_LOCATION
from .lsst import LsstBaseTranslator, SIMONYI_LOCATION, SIMONYI_TELESCOPE

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -48,10 +48,10 @@ def to_telescope(self):
# Docstring will be inherited. Property defined in properties.py
telescope = None
if self.is_key_ok("OUTFILE") and self._header["OUTFILE"].startswith("lsst"):
telescope = "LSST"
telescope = SIMONYI_TELESCOPE
self._used_these_cards("OUTFILE")
elif "LSST_NUM" in self._header:
telescope = "LSST"
telescope = SIMONYI_TELESCOPE
self._used_these_cards("LSST_NUM")
return telescope

Expand All @@ -61,8 +61,8 @@ def to_location(self):
location = None
# In theory simulated files might not be for LSST
tel = self.to_telescope()
if tel == "LSST":
location = LSST_LOCATION
if tel == SIMONYI_TELESCOPE:
location = SIMONYI_LOCATION
else:
# Try standard FITS headers
try:
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/lsst/translators/ts3.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LsstTS3Translator(LsstBaseTranslator):

_const_map = {
# TS3 is not attached to a telescope so many translations are null.
"telescope": "LSST",
"telescope": None,
"location": None,
"boresight_rotation_coord": None,
"boresight_rotation_angle": None,
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/lsst/translators/ts8.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LsstTS8Translator(LsstBaseTranslator):

_const_map = {
# TS8 is not attached to a telescope so many translations are null.
"telescope": "LSST",
"telescope": None,
"location": None,
"boresight_rotation_coord": None,
"boresight_rotation_angle": None,
Expand Down

0 comments on commit 3ce2d20

Please sign in to comment.