Skip to content

Commit

Permalink
Merge pull request #729 from nasa/issue_717
Browse files Browse the repository at this point in the history
issue 717: feat(data-subscriber): improve logging. improve evaluator
  • Loading branch information
hhlee445 authored Feb 1, 2024
2 parents c9a6d03 + d312f19 commit 1525748
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions data_subscriber/rtc/evaluator_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ def process(orbit_to_interval_to_products_map: dict, orbit_to_mbc_orbit_dfs_map:
r = {max(r, key=len)} # reduce_to_largest_set
coverage_result_set_id_to_product_sets_map[coverage_group][mgrs_set_id] = r

# remove redundant sets across coverage groups. the above removes redundant sets within a single group
mgrs_set_id_to_sets_count_map = defaultdict(int)
for coverage_group in coverage_result_set_id_to_product_sets_map:
for mgrs_set_id in coverage_result_set_id_to_product_sets_map[coverage_group]:
mgrs_set_id_to_sets_count_map[mgrs_set_id] = 1 + mgrs_set_id_to_sets_count_map[mgrs_set_id]
for mgrs_set_id in mgrs_set_id_to_sets_count_map:
if mgrs_set_id_to_sets_count_map[mgrs_set_id] > 1:
for coverage_group in [coverage_group for coverage_group in sorted(coverage_result_set_id_to_product_sets_map, reverse=True) if coverage_group != 100]:
if mgrs_set_id in coverage_result_set_id_to_product_sets_map[coverage_group].keys():
del coverage_result_set_id_to_product_sets_map[coverage_group][mgrs_set_id]
mgrs_set_id_to_sets_count_map[mgrs_set_id] = -1 + mgrs_set_id_to_sets_count_map[mgrs_set_id]

return dict(coverage_result_set_id_to_product_sets_map)


Expand Down

0 comments on commit 1525748

Please sign in to comment.