Skip to content
Snippets Groups Projects
Commit 6949cbcf authored by Bruce Flynn's avatar Bruce Flynn
Browse files

add collect_modis_scans()

parent 2a7e717a
No related branches found
No related tags found
No related merge requests found
...@@ -75,3 +75,20 @@ def _modis_sort_key(p): ...@@ -75,3 +75,20 @@ def _modis_sort_key(p):
def sort_modis(packets): def sort_modis(packets):
return sorted(packets, key=_modis_sort_key) return sorted(packets, key=_modis_sort_key)
def collect_modis_scans(packets):
scan = None
scantimes = set()
for p in packets:
if p.apid not in (64, 957):
continue
tp = sourceid(p) if p.apid == 64 else "gbad"
if tp == "solar-diff" and p.stamp not in scantimes:
scantimes.add(p.stamp)
if scan is not None:
yield scan
scan = {"scantime": p.stamp, "packets": {}}
if tp not in scan["packets"]:
scan["packets"][tp] = []
scan["packets"][tp].append(p)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment