Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
add unit test for shapes of correction LUTs
  • Loading branch information
scottstanie committed Mar 6, 2023
commit 491ff9fee570f2ec1c24afa4fb4ea527c9b55bb4
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_paths():
test_paths.safe = f"{test_path}/data/S1A_IW_SLC__1SDV_20200511T135117_20200511T135144_032518_03C421_7768.zip"
test_paths.orbit_dir = f"{test_path}/data/orbits"
test_paths.orbit_file = "S1A_OPER_AUX_POEORB_OPOD_20210318T120818_V20200510T225942_20200512T005942.EOF"
test_paths.dem_file = f"{test_path}/data/dummy_dem.tif"

return test_paths

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

orbit_path = f'{test_paths.orbit_dir}/{test_paths.orbit_file}'
bursts = s1_reader.load_bursts(test_paths.safe, orbit_path, i_subswath,
pol)
bursts = s1_reader.load_bursts(test_paths.safe, orbit_path, i_subswath, pol)

return bursts
Binary file added tests/data/dummy_dem.tif
Binary file not shown.
20 changes: 20 additions & 0 deletions tests/test_corrections.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def test_correction_shapes(bursts, test_paths):
az_step, rg_step = 0.25, 200

for burst in bursts:
az_fm_mismatch = burst.az_fm_rate_mismatch_mitigation(
test_paths.dem_file, range_step=rg_step, az_step=az_step
)
shape = (az_fm_mismatch.length, az_fm_mismatch.width)

# Make sure the other two corrections have the same shape
geometrical_steering_doppler = burst.doppler_induced_range_shift(
range_step=rg_step, az_step=az_step
)
assert shape == (
geometrical_steering_doppler.length,
geometrical_steering_doppler.width,
)

bistatic_delay = burst.bistatic_delay(range_step=rg_step, az_step=az_step)
assert shape == (bistatic_delay.length, bistatic_delay.width)