From c4a972b9d1e419c3aedfa333d0635dad95670e31 Mon Sep 17 00:00:00 2001 From: "Gustavo H. X. Shiroma" Date: Mon, 11 Mar 2024 09:44:02 -0700 Subject: [PATCH 1/3] read az. pixel spacing from S1 annotation files; update burst unit test accordingly --- src/s1reader/s1_burst_slc.py | 1 + src/s1reader/s1_reader.py | 4 +++- tests/test_bursts.py | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/s1reader/s1_burst_slc.py b/src/s1reader/s1_burst_slc.py index 8736244..d62b645 100644 --- a/src/s1reader/s1_burst_slc.py +++ b/src/s1reader/s1_burst_slc.py @@ -218,6 +218,7 @@ class Sentinel1BurstSlc: radar_center_frequency: float wavelength: float azimuth_steer_rate: float + average_azimuth_pixel_spacing: float azimuth_time_interval: float slant_range_time: float starting_range: float diff --git a/src/s1reader/s1_reader.py b/src/s1reader/s1_reader.py index 7d063ee..c305d0e 100644 --- a/src/s1reader/s1_reader.py +++ b/src/s1reader/s1_reader.py @@ -835,6 +835,7 @@ def burst_from_xml(annotation_path: str, orbit_path: str, tiff_path: str, orbit_direction = product_info_element.find('pass').text image_info_element = tree.find('imageAnnotation/imageInformation') + average_azimuth_pixel_spacing = float(image_info_element.find('azimuthPixelSpacing').text) azimuth_time_interval = float(image_info_element.find('azimuthTimeInterval').text) slant_range_time = float(image_info_element.find('slantRangeTime').text) ascending_node_time_annotation =\ @@ -1014,7 +1015,8 @@ def burst_from_xml(annotation_path: str, orbit_path: str, tiff_path: str, burst_misc_metadata = swath_misc_metadata.extract_by_aztime(sensing_start) bursts[i] = Sentinel1BurstSlc(ipf_version, sensing_start, radar_freq, wavelength, - azimuth_steer_rate, azimuth_time_interval, + azimuth_steer_rate, average_azimuth_pixel_spacing, + azimuth_time_interval, slant_range_time, starting_range, iw2_mid_range, range_sampling_rate, range_pxl_spacing, (n_lines, n_samples), az_fm_rate, doppler, diff --git a/tests/test_bursts.py b/tests/test_bursts.py index f5b4794..265c0a4 100644 --- a/tests/test_bursts.py +++ b/tests/test_bursts.py @@ -38,6 +38,11 @@ def test_burst(bursts): assert burst.radar_center_frequency == 5405000454.33435 assert burst.wavelength == 0.05546576 assert burst.azimuth_steer_rate == 0.024389943375862838 + + # the average azimuth pixel spacing varies across bursts + assert burst.average_azimuth_pixel_spacing > 13.9 + assert burst.average_azimuth_pixel_spacing < 14.0 + assert burst.starting_range == 901673.89084624 assert burst.iw2_mid_range == 875604.926001518 assert burst.range_sampling_rate == 64345238.12571428 From 56d1ea1d86494cc8c3de944b8d72eead7a81f05c Mon Sep 17 00:00:00 2001 From: "Gustavo H. X. Shiroma" Date: Mon, 11 Mar 2024 09:44:12 -0700 Subject: [PATCH 2/3] remove repeated code --- src/s1reader/s1_annotation.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/s1reader/s1_annotation.py b/src/s1reader/s1_annotation.py index 5da874d..a33aba5 100644 --- a/src/s1reader/s1_annotation.py +++ b/src/s1reader/s1_annotation.py @@ -454,9 +454,6 @@ def from_et(cls, et_in: ET): cls.number_of_samples = \ cls._parse_scalar('imageAnnotation/imageInformation/numberOfSamples', 'scalar_int') - cls.number_of_samples = \ - cls._parse_scalar('imageAnnotation/imageInformation/numberOfSamples', - 'scalar_int') cls.range_sampling_rate = \ cls._parse_scalar('generalAnnotation/productInformation/rangeSamplingRate', 'scalar_float') From 7f1d9eda3bab4c8bdea650341be3f1d1af557bf6 Mon Sep 17 00:00:00 2001 From: "Gustavo H. X. Shiroma" Date: Mon, 11 Mar 2024 09:44:33 -0700 Subject: [PATCH 3/3] bump version to 0.2.4 --- src/s1reader/version.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/s1reader/version.py b/src/s1reader/version.py index 15132fa..c84ad65 100644 --- a/src/s1reader/version.py +++ b/src/s1reader/version.py @@ -4,6 +4,7 @@ # release history Tag = collections.namedtuple('Tag', 'version date') release_history = ( + Tag('0.2.4', '2024-03-11'), Tag('0.2.3', '2023-09-21'), Tag('0.2.2', '2023-09-08'), Tag('0.2.1', '2023-08-23'),