Skip to content

Commit 491ff9f

Browse files
committed
add unit test for shapes of correction LUTs
1 parent 44cd2c2 commit 491ff9f

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def test_paths():
1212
test_paths.safe = f"{test_path}/data/S1A_IW_SLC__1SDV_20200511T135117_20200511T135144_032518_03C421_7768.zip"
1313
test_paths.orbit_dir = f"{test_path}/data/orbits"
1414
test_paths.orbit_file = "S1A_OPER_AUX_POEORB_OPOD_20210318T120818_V20200510T225942_20200512T005942.EOF"
15+
test_paths.dem_file = f"{test_path}/data/dummy_dem.tif"
1516

1617
return test_paths
1718

@@ -21,7 +22,6 @@ def bursts(test_paths):
2122
pol = 'vv'
2223

2324
orbit_path = f'{test_paths.orbit_dir}/{test_paths.orbit_file}'
24-
bursts = s1_reader.load_bursts(test_paths.safe, orbit_path, i_subswath,
25-
pol)
25+
bursts = s1_reader.load_bursts(test_paths.safe, orbit_path, i_subswath, pol)
2626

2727
return bursts

tests/data/dummy_dem.tif

55.5 KB
Binary file not shown.

tests/test_corrections.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
def test_correction_shapes(bursts, test_paths):
2+
az_step, rg_step = 0.25, 200
3+
4+
for burst in bursts:
5+
az_fm_mismatch = burst.az_fm_rate_mismatch_mitigation(
6+
test_paths.dem_file, range_step=rg_step, az_step=az_step
7+
)
8+
shape = (az_fm_mismatch.length, az_fm_mismatch.width)
9+
10+
# Make sure the other two corrections have the same shape
11+
geometrical_steering_doppler = burst.doppler_induced_range_shift(
12+
range_step=rg_step, az_step=az_step
13+
)
14+
assert shape == (
15+
geometrical_steering_doppler.length,
16+
geometrical_steering_doppler.width,
17+
)
18+
19+
bistatic_delay = burst.bistatic_delay(range_step=rg_step, az_step=az_step)
20+
assert shape == (bistatic_delay.length, bistatic_delay.width)

0 commit comments

Comments
 (0)