Skip to content

Commit

Permalink
Refactor duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
sfinkens committed Feb 13, 2024
1 parent 911bc4d commit 835c551
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions satpy/readers/ahi_hsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,20 +426,20 @@ def observation_end_time(self):
"""Get the observation end time."""
return datetime(1858, 11, 17) + timedelta(days=float(self.basic_info["observation_end_time"].item()))

@property
def _timeline(self):
return "{:04d}".format(self.basic_info["observation_timeline"][0])

@property
def nominal_start_time(self):
"""Time this band was nominally to be recorded."""
timeline = "{:04d}".format(self.basic_info["observation_timeline"][0])
calc = NominalTimeCalculator(timeline,
self.observation_area)
calc = NominalTimeCalculator(self._timeline, self.observation_area)
return calc.get_nominal_start_time(self.observation_start_time)

@property
def nominal_end_time(self):
"""Get the nominal end time."""
timeline = "{:04d}".format(self.basic_info["observation_timeline"][0])
calc = NominalTimeCalculator(timeline,
self.observation_area)
calc = NominalTimeCalculator(self._timeline, self.observation_area)
return calc.get_nominal_end_time(self.nominal_start_time)

def get_dataset(self, key, info):
Expand Down

0 comments on commit 835c551

Please sign in to comment.