Skip to content

Commit

Permalink
Fixed bug where not all polarization modes were supported for file-re…
Browse files Browse the repository at this point in the history
…naming in the RTC-S1 PGE
  • Loading branch information
Scott Collins committed May 3, 2023
1 parent b4928be commit 1f8e54c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/opera/pge/rtc_s1/rtc_s1_pge.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,10 @@ def __init__(self, pge_name, runconfig_path, **kwargs):
self.rename_by_pattern_map = {
"*_VV.tif": self._rtc_geotiff_filename,
"*_VH.tif": self._rtc_geotiff_filename,
"*_HH.tif": self._rtc_geotiff_filename,
"*_HV.tif": self._rtc_geotiff_filename,
"*_VV+VH.tif": self._rtc_geotiff_filename,
"*_HH+HV.tif": self._rtc_geotiff_filename,
"*_rtc_anf.tif": self._static_layer_filename,
"*_nlooks.tif": self._static_layer_filename,
"*_local_incidence_angle.tif": self._static_layer_filename,
Expand Down
8 changes: 8 additions & 0 deletions src/opera/test/data/test_rtc_s1_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ RunConfig:
- 'python3 -c "from opera.util.metadata_utils import create_test_rtc_metadata_product; create_test_rtc_metadata_product(\"rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0.h5\")";'
- 'touch rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_VH.tif;'
- 'touch rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_VV.tif;'
- 'touch rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_HH.tif;'
- 'touch rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_HV.tif;'
- 'touch rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_VV+VH.tif;'
- 'touch rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_HH+HV.tif;'
- 'touch rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0.png;'
- 'touch rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_nlooks.tif;'
- 'touch rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_layover_shadow_mask.tif;'
- 'dd if=/dev/urandom of=rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_VH.tif bs=1M count=1;'
- 'dd if=/dev/urandom of=rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_VV.tif bs=1M count=1;'
- 'dd if=/dev/urandom of=rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_HH.tif bs=1M count=1;'
- 'dd if=/dev/urandom of=rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_HV.tif bs=1M count=1;'
- 'dd if=/dev/urandom of=rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_VV+VH.tif bs=1M count=1;'
- 'dd if=/dev/urandom of=rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_HH+HV.tif bs=1M count=1;'
- 'dd if=/dev/urandom of=rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0.png bs=1M count=1;'
- 'dd if=/dev/urandom of=rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_nlooks.tif bs=1M count=1;'
- 'dd if=/dev/urandom of=rtc_s1_test/output_dir/t069_147170_iw1/rtc_product_v1.0_layover_shadow_mask.tif bs=1M count=1;'
Expand Down
6 changes: 5 additions & 1 deletion src/opera/test/pge/rtc_s1/test_rtc_s1_pge.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,16 @@ def test_filename_application(self):

output_files = glob.glob(join(pge.runconfig.output_product_path, f"{core_filename}*.tif"))

self.assertEqual(len(output_files), 4)
self.assertEqual(len(output_files), 8)

output_files = list(map(os.path.basename, output_files))

self.assertIn(f"{core_filename}_VV.tif", output_files)
self.assertIn(f"{core_filename}_VH.tif", output_files)
self.assertIn(f"{core_filename}_HH.tif", output_files)
self.assertIn(f"{core_filename}_HV.tif", output_files)
self.assertIn(f"{core_filename}_VV+VH.tif", output_files)
self.assertIn(f"{core_filename}_HH+HV.tif", output_files)
self.assertIn(f"{core_filename}_nlooks.tif", output_files)
self.assertIn(f"{core_filename}_layover_shadow_mask.tif", output_files)

Expand Down

0 comments on commit 1f8e54c

Please sign in to comment.