Skip to content
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
58c0648
add more small testing data
scottstanie Oct 28, 2022
eb8b2f3
make a failing test for anx crossing
scottstanie Oct 28, 2022
556e44d
create methods for burst/track, fill tests
scottstanie Oct 28, 2022
42df314
fix erroneous burst id in existing test
scottstanie Oct 28, 2022
63859d8
add a sample burst db to compare
scottstanie Oct 29, 2022
2c904d5
add script for remaking the burst sample
scottstanie Oct 29, 2022
af6d4ca
add a geometry check for the esa database
scottstanie Oct 29, 2022
53dc5ea
perform test without pandas
scottstanie Oct 29, 2022
0f86d66
codacy items
scottstanie Oct 29, 2022
2ed1623
add the geometry comparison to the other test cases
scottstanie Oct 29, 2022
cbabae1
add two more test cases
scottstanie Nov 1, 2022
98eb819
refactor tests for new cases
scottstanie Nov 1, 2022
dba751c
redo logic for strange track175 case
scottstanie Nov 1, 2022
2daef08
update burst csv
scottstanie Nov 1, 2022
a1e13c4
fix first test problem, cut bursts
scottstanie Nov 1, 2022
2236cf7
get tests working again for track175 case
scottstanie Nov 1, 2022
7e95f3c
fix esa db csv
scottstanie Nov 1, 2022
2382df4
use nsmap instead of long manual urls
scottstanie Nov 1, 2022
9e1b544
remove testing script
scottstanie Nov 1, 2022
1c1dc57
working version on full orbit cycle
scottstanie Nov 1, 2022
5d19f7d
fix tests to check all subswaths
scottstanie Nov 1, 2022
fcf833d
try recursive include for circleci fail, codacy
scottstanie Nov 1, 2022
110b06c
retry manifest
scottstanie Nov 1, 2022
eae3490
Merge branch 'main' into burst-id-fix
scottstanie Nov 16, 2022
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
Prev Previous commit
Next Next commit
add the geometry comparison to the other test cases
  • Loading branch information
scottstanie committed Oct 29, 2022
commit 2ed1623899409d733192293387fb5a06b12a0e1a
11 changes: 9 additions & 2 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
BURST_ID_PAT = r"t(?P<track>\d{3})_(?P<burst_id>\d{6})_iw(?P<subswath_num>[1-3])"


def test_burst_from_zip(bursts):
def test_burst_from_zip(bursts, esa_burst_db):
assert len(bursts) == 9
_compare_bursts_geometry_to_esa(bursts, esa_burst_db)


def test_burst_ids(test_paths, esa_burst_db):
Expand All @@ -26,6 +27,10 @@ def test_burst_ids(test_paths, esa_burst_db):
s1_burst_ids = [int(b.burst_id.split("_")[1]) for b in bursts]
assert esa_burst_ids == s1_burst_ids

_compare_bursts_geometry_to_esa(bursts, esa_burst_db)


def _compare_bursts_geometry_to_esa(bursts, esa_burst_db):
# Check that all the geometries match roughly to the ESA burst database
s1_geometries = [MultiPolygon(b.border) for b in bursts]
esa_geometries = [esa_burst_db[b.burst_id]["geometry"] for b in bursts]
Expand All @@ -35,7 +40,7 @@ def test_burst_ids(test_paths, esa_burst_db):
assert iou(s1_geom, esa_geom) > 0.75


def test_anx_crossing(test_paths):
def test_anx_crossing(test_paths, esa_burst_db):
"""Check on a frame that crosses the equator mid frame."""
zip_path = test_paths.data_dir / "S1A_IW_SLC__1SDV_20221024T184148_20221024T184218_045587_05735F_D6E2.zip"
orbit_file = get_orbit_file_from_dir(zip_path, test_paths.orbit_dir)
Expand All @@ -56,6 +61,8 @@ def test_anx_crossing(test_paths):
assert match
assert int(match.group("track")) == end_track

_compare_bursts_geometry_to_esa(bursts, esa_burst_db)


def _get_safe_et(zip_path, file_pattern):
with zipfile.ZipFile(zip_path) as zf:
Expand Down