Skip to content

Commit

Permalink
Remove translator methods to parent class methods instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
aferte committed Feb 3, 2024
1 parent 7995fda commit 425f43b
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions python/lsst/obs/fiberspectrograph/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,37 +86,6 @@ def to_datetime_begin(self):
self._used_these_cards("DATE-BEG")
return Time(self._header["DATE-BEG"], scale="tai", format="isot")

@cache_translation
def to_observing_day(self):
"""Return the day of observation as YYYYMMDD integer.
Returns
-------
obs_day : `int`
The day of observation.
"""
date = self.to_datetime_begin()
date -= self._ROLLOVER_TIME
return int(date.strftime("%Y%m%d"))

@cache_translation
def to_observation_counter(self):
"""Return the sequence number within the observing day.
Returns
-------
counter : `int`
The sequence number for this day.
"""
if self.is_key_ok("SEQNUM"):
self._used_these_cards("SEQNUM")
return int(self._header["SEQNUM"])

# This indicates a problem so we warn and return a 0
log.warning("%s: Unable to determine the observation counter so returning 0",
self._log_prefix)
return 0

@cache_translation
def to_exposure_time(self):
# Docstring will be inherited. Property defined in properties.py
Expand Down Expand Up @@ -191,20 +160,3 @@ def to_visit_id(self):
"""Calculate the visit associated with this exposure.
"""
return self.to_exposure_id()

@cache_translation
def to_exposure_id(self):
"""Generate a unique exposure ID number
This is a combination of DAYOBS and SEQNUM
Returns
-------
exposure_id : `int`
Unique exposure number.
"""

dayobs = self.to_observing_day()
seqnum = self.to_observation_counter()

return self.compute_exposure_id(dayobs, seqnum)

0 comments on commit 425f43b

Please sign in to comment.