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
5c40a915
Commit
5c40a915
authored
9 years ago
by
Bruce Flynn
Browse files
Options
Downloads
Patches
Plain Diff
merge: fix for incorrect VIIRS apid order
Add option to CLI tool to specify VIIRS APID order. **NOT TESTED
parent
57353045
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
edosl0util/cli/merge.py
+11
-1
11 additions, 1 deletion
edosl0util/cli/merge.py
edosl0util/merge.py
+1
-1
1 addition, 1 deletion
edosl0util/merge.py
with
12 additions
and
2 deletions
edosl0util/cli/merge.py
+
11
−
1
View file @
5c40a915
...
...
@@ -3,6 +3,8 @@ from datetime import datetime
from
edosl0util.cli
import
util
from
edosl0util
import
merge
,
stream
VIIRS_APID_ORDER
=
[
826
,
821
]
+
range
(
800
,
826
)
def
main
():
parser
=
util
.
default_parser
()
...
...
@@ -15,14 +17,22 @@ def main():
help
=
(
'
Truncate to the interval given as coma separated timestamps of
'
'
the format YYYY-MM-DD HH:MM:SS. The begin time is inclusive, the
'
'
end time is exclusive.
'
))
parser
.
add_argument
(
'
-a
'
,
'
--apid-order
'
,
choices
=
[
'
viirs
'
,
'
numerical
'
],
default
=
'
numerical
'
,
help
=
(
'
Packets will be sorted by time and the named order provided.
'
'"
viirs
"
will sort packets in APID order as expectet by the VIIRS
'
'
L1 software.
"
numerical
"
will simply sort APIDs in numerical
'
'
order
'
))
parser
.
add_argument
(
'
pds
'
,
nargs
=
'
+
'
)
args
=
parser
.
parse_args
()
util
.
configure_logging
(
args
)
apid_order
=
{
'
viirs
'
:
VIIRS_APID_ORDER
,
'
numerical
'
:
None
}[
args
.
apid_order
]
streams
=
[
stream
.
jpss_packet_stream
(
io
.
open
(
f
,
'
rb
'
))
for
f
in
args
.
pds
]
merge
.
merge
(
streams
,
output
=
io
.
open
(
args
.
output
,
'
wb
'
),
trunc_to
=
args
.
trunc_to
)
streams
,
output
=
io
.
open
(
args
.
output
,
'
wb
'
),
trunc_to
=
args
.
trunc_to
,
apid_order
=
apid_order
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
edosl0util/merge.py
+
1
−
1
View file @
5c40a915
...
...
@@ -86,7 +86,7 @@ def read_packet_index(stream):
def
_sort_by_time_apid
(
index
,
order
=
None
):
if
order
:
index
=
sorted
(
index
,
key
=
lambda
p
:
order
.
index
(
p
.
apid
))
index
=
sorted
(
index
,
key
=
lambda
p
:
order
.
index
(
p
.
apid
)
if
p
.
apid
in
order
else
-
1
)
else
:
index
=
sorted
(
index
,
key
=
lambda
p
:
p
.
apid
)
return
sorted
(
index
,
key
=
lambda
p
:
p
.
stamp
)
...
...
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