Skip to content

Commit 5989526

Browse files
hfattahiLiangJYu
andauthored
bug fix for first valid line (#44)
* first line with index 0 can be valid * Update src/s1reader/s1_reader.py Co-authored-by: Liang Yu <[email protected]> Co-authored-by: Liang Yu <[email protected]>
1 parent 96d9d1d commit 5989526

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/s1reader/s1_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ def burst_from_xml(annotation_path: str, orbit_path: str, tiff_path: str,
377377
first_valid_samples = [int(val) for val in burst_list_element.find('firstValidSample').text.split()]
378378
last_valid_samples = [int(val) for val in burst_list_element.find('lastValidSample').text.split()]
379379

380-
first_valid_line = [x > 0 for x in first_valid_samples].index(True)
381-
n_valid_lines = [x > 0 for x in first_valid_samples].count(True)
380+
first_valid_line = [x >= 0 for x in first_valid_samples].index(True)
381+
n_valid_lines = [x >=0 for x in first_valid_samples].count(True)
382382
last_line = first_valid_line + n_valid_lines - 1
383383

384384
first_valid_sample = max(first_valid_samples[first_valid_line],

0 commit comments

Comments
 (0)