Skip to content

Commit

Permalink
Make nominal time calculator private
Browse files Browse the repository at this point in the history
  • Loading branch information
sfinkens committed Feb 16, 2024
1 parent 835c551 commit 1eadfb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions satpy/readers/ahi_hsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,13 @@ def _timeline(self):
@property
def nominal_start_time(self):
"""Time this band was nominally to be recorded."""
calc = NominalTimeCalculator(self._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."""
calc = NominalTimeCalculator(self._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 Expand Up @@ -745,7 +745,7 @@ def _ir_calibrate(self, data):
return (c0_ + c1_ * Te_ + c2_ * Te_ ** 2).clip(0)


class NominalTimeCalculator:
class _NominalTimeCalculator:
"""Get time when a scan was nominally to be recorded."""

def __init__(self, timeline, area):
Expand Down
8 changes: 4 additions & 4 deletions satpy/tests/reader_tests/test_ahi_hsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import numpy as np
import pytest

from satpy.readers.ahi_hsd import AHIHSDFileHandler, NominalTimeCalculator
from satpy.readers.ahi_hsd import AHIHSDFileHandler, _NominalTimeCalculator
from satpy.readers.utils import get_geostationary_mask
from satpy.tests.utils import make_dataid

Expand Down Expand Up @@ -645,7 +645,7 @@ class TestNominalTimeCalculator:
)
def test_invalid_timeline(self, timeline, expected):
"""Test handling of invalid timeline."""
calc = NominalTimeCalculator(timeline, "FLDK")
calc = _NominalTimeCalculator(timeline, "FLDK")
res = calc.get_nominal_start_time(datetime(2020, 1, 1, 12, 0, 0))
assert res == expected

Expand Down Expand Up @@ -697,7 +697,7 @@ def test_invalid_timeline(self, timeline, expected):
def test_areas(self, area, expected):
"""Test nominal timestamps for multiple areas."""
obs_start_time = datetime(2018, 10, 22, 3, 0, 20, 596896)
calc = NominalTimeCalculator("0300", area)
calc = _NominalTimeCalculator("0300", area)
nom_start_time = calc.get_nominal_start_time(obs_start_time)
nom_end_time = calc.get_nominal_end_time(nom_start_time)
assert nom_start_time == expected["tstart"]
Expand Down Expand Up @@ -734,7 +734,7 @@ def test_areas(self, area, expected):
)
def test_timelines(self, timeline, obs_start_time, expected):
"""Test nominal timestamps for multiple timelines."""
calc = NominalTimeCalculator(timeline, "FLDK")
calc = _NominalTimeCalculator(timeline, "FLDK")
nom_start_time = calc.get_nominal_start_time(obs_start_time)
nom_end_time = calc.get_nominal_end_time(nom_start_time)
assert nom_start_time == expected["tstart"]
Expand Down

0 comments on commit 1eadfb5

Please sign in to comment.