From 61a886ee4ced3d2697b88af16dbee4496d8ff5fb Mon Sep 17 00:00:00 2001 From: Stephan Finkensieper Date: Tue, 17 May 2022 13:58:20 +0000 Subject: [PATCH] Add docstrings. --- level1c4pps/calibration_coefs.py | 8 ++++++++ level1c4pps/tests/test_seviri2pps.py | 1 + 2 files changed, 9 insertions(+) diff --git a/level1c4pps/calibration_coefs.py b/level1c4pps/calibration_coefs.py index 7101603..d7dce62 100644 --- a/level1c4pps/calibration_coefs.py +++ b/level1c4pps/calibration_coefs.py @@ -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} diff --git a/level1c4pps/tests/test_seviri2pps.py b/level1c4pps/tests/test_seviri2pps.py index 471eb4f..75e7c82 100644 --- a/level1c4pps/tests/test_seviri2pps.py +++ b/level1c4pps/tests/test_seviri2pps.py @@ -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',