Skip to content

Commit

Permalink
Add docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfinkens committed May 17, 2022
1 parent 9c1ea90 commit 61a886e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions level1c4pps/calibration_coefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ def get_calibration(platform, time, clip=False):


def _get_single_channel_calibration(platform, channel, time, clip):
"""Get calibration coefficients for a single channel.
Args:
platform: Platform name.
channel: Channel name.
time: Observation date or time.
clip: Clip at time coverage boundaries of the calibration dataset.
"""
time = _prepare_time(time, clip)
gain, offset = calib_meirink(platform, channel, time)
return {'gain': gain, 'offset': offset}
Expand Down
1 change: 1 addition & 0 deletions level1c4pps/tests/test_seviri2pps.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ def test_clip_at_time_coverage_bounds(self, coverage_boundary, outside_coverage)
self._assert_coefs_close(coefs1, coefs2)

def test_fails_with_invalid_time(self):
"""Test that calibration fails with timestamps < reference time."""
with pytest.raises(ValueError):
calib.get_calibration(
platform='MSG1',
Expand Down

0 comments on commit 61a886e

Please sign in to comment.