Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EdosL0Util
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SIPS
EdosL0Util
Commits
2d1b0444
Commit
2d1b0444
authored
5 years ago
by
Bruce Flynn
Browse files
Options
Downloads
Patches
Plain Diff
add filter for orphans to make rdrgen happy
parent
168c8fbf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
edosl0util/rdrgen.py
+41
-0
41 additions, 0 deletions
edosl0util/rdrgen.py
with
41 additions
and
0 deletions
edosl0util/rdrgen.py
+
41
−
0
View file @
2d1b0444
...
...
@@ -25,6 +25,47 @@ def iter_pkts(l0_files):
yield
pkt
def
filter_group_orphans
(
s
):
"""
Filter out any packets in a group that do not fall withing the expected
sequence id series and expected packets per group.
This is useful for input RDR packet streams received from direct braodcast
that may have sub-ideal packet sequences that RDR generation does not play
well with.
"""
seqnums
=
{}
viirs_apids
=
set
(
ViirsScienceApidInfo
.
apids
)
for
p
in
iter
(
s
):
if
p
.
apid
in
viirs_apids
:
group_size
=
ViirsScienceApidInfo
.
get_packets_per_scan
(
p
.
apid
)
# Not groupped
if
group_size
==
1
:
yield
p
continue
# Start of new group
if
p
.
is_first
():
seqnums
[
p
.
apid
]
=
p
.
seqid
yield
p
continue
# If not in seqnums we must not have seen a first packet for this
# APID so it must be hanging, drop it.
if
p
.
apid
not
in
seqnums
:
continue
# Packet does not have sequence number expected to be part of this
# group, must be an orphan, drop it.
# Ok to assume VIIRS here because it's the only one using groups.
if
not
ViirsGroupedPacketTimeTracker
.
check_sequence_number
(
p
.
seqid
,
seqnums
[
p
.
apid
],
group_size
):
continue
yield
p
else
:
yield
p
def
packets_to_rdrs
(
sat
,
l0_files
,
**
kwargs
):
return
build_rdr
(
sat
,
iter_pkts
(
l0_files
),
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment