diff --git a/trollsched/boundary.py b/trollsched/boundary.py index d729a63..555c74d 100644 --- a/trollsched/boundary.py +++ b/trollsched/boundary.py @@ -78,6 +78,8 @@ def get_instrument_and_angle(self, overpass): elif instrument.startswith("mersi"): scan_angle = 55.4 instrument = "avhrr" + elif instrument.startswith("slstr"): + instrument = "slstr" elif overpass.satellite.name.startswith("aws"): scan_angle = 55.25 instrument = "avhrr" @@ -104,6 +106,8 @@ def create_instrument_geometry(self, instrument, scans_nb, scanpoints, scan_step sgeom = instrument_fun(scans_nb, scanpoints, scan_step=scan_step) elif instrument in ["mhs", "atms", "mwhs-2"]: sgeom = instrument_fun(scans_nb, scanpoints) + elif instrument.startswith("slstr"): + sgeom = instrument_fun(scans_nb, scanpoints) else: logger.warning("Instrument not tested: %s", instrument) sgeom = instrument_fun(scans_nb) diff --git a/trollsched/tests/test_satpass.py b/trollsched/tests/test_satpass.py index 344f4d6..5ab36a1 100644 --- a/trollsched/tests/test_satpass.py +++ b/trollsched/tests/test_satpass.py @@ -166,6 +166,15 @@ def get_mb_orbital(): return Orbital("Metop-B", line1=tle1, line2=tle2) +def get_s3a_orbital(): + """ + From 2022-06-06 + """ + tle1 = "1 41335U 16011A 22157.82164820 .00000041 00000-0 34834-4 0 9994" + tle2 = "2 41335 98.6228 225.2825 0001265 95.7364 264.3961 14.26738817328255" + return Orbital("Sentinel-3A", line1=tle1, line2=tle2) + + class TestPass: """Tests for the Pass object.""" @@ -205,6 +214,7 @@ def setup_method(self): self.n20orb = get_n20_orbital() self.n19orb = get_n19_orbital() self.mborb = get_mb_orbital() + self.s3aorb = get_s3a_orbital() self.euron1 = AREA_DEF_EURON1 self.antarctica = create_area_def( "antarctic", @@ -348,6 +358,16 @@ def test_swath_coverage_fy3(self): cov = mypass.area_coverage(self.euron1) assert cov == pytest.approx(0.786836, 1e-5) + # Sentinel 3A slstr + tstart = datetime(2022, 6, 6, 19, 58, 0) + tend = tstart + timedelta(seconds=60) + + tle1 = "1 41335U 16011A 22156.83983125 .00000043 00000-0 35700-4 0 9996" + tle2 = "2 41335 98.6228 224.3150 0001264 95.7697 264.3627 14.26738650328113" + mypass = Pass('SENTINEL 3A', tstart, tend, instrument='slstr', tle1=tle1, tle2=tle2) + cov = mypass.area_coverage(self.euron1) + self.assertAlmostEqual(cov, 0.05305641490480109, 6) + def test_arctic_is_not_antarctic(self): """Test that artic and antarctic are not mixed up.""" tstart = datetime(2021, 2, 3, 16, 28, 3)