Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 69 add slstr #70

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions trollsched/boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
20 changes: 20 additions & 0 deletions trollsched/tests/test_satpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down