Skip to content

Commit 96d9d1d

Browse files
LiangJYuhfattahi
andauthored
fix partial IDs found (#39)
* fix partial IDs found with cleaner logic and repeat warnings Co-authored-by: Heresh Fattahi <[email protected]>
1 parent 39e4887 commit 96d9d1d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/s1reader/s1_reader.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,14 +482,15 @@ def load_bursts(path: str, orbit_path: str, swath_num: int, pol: str='vv',
482482

483483
burst_ids_found = set([b.burst_id for b in bursts])
484484

485-
if not burst_ids_found:
486-
warnings.warn("None of provided bursts IDs found")
487-
485+
warnings.simplefilter("always")
488486
set_burst_ids = set(burst_ids)
489-
if burst_ids_found != set_burst_ids:
487+
if not burst_ids_found:
488+
warnings.warn("None of provided burst IDs found in sub-swath {swath_num}")
489+
elif burst_ids_found != set_burst_ids:
490490
diff = set_burst_ids.difference(burst_ids_found)
491-
warn_str = f'Not all burst IDs found. Not found: {diff}. '
492-
warn_str += f'Found: {burst_ids_found}'
491+
warn_str = 'Not all burst IDs found. \n '
492+
warn_str += f'Not found: {diff} . \n'
493+
warn_str += f'Found bursts: {burst_ids_found}'
493494
warnings.warn(warn_str)
494495

495496
return bursts

0 commit comments

Comments
 (0)