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
d7f36fdd
Commit
d7f36fdd
authored
9 years ago
by
Greg Quinn
Browse files
Options
Downloads
Patches
Plain Diff
Add crgen.diff_crs for validated generated CR data
parent
b03b94a2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
edosl0util/crgen.py
+29
-1
29 additions, 1 deletion
edosl0util/crgen.py
setup.py
+1
-0
1 addition, 0 deletions
setup.py
with
30 additions
and
1 deletion
edosl0util/crgen.py
+
29
−
1
View file @
d7f36fdd
...
...
@@ -2,14 +2,42 @@
"""
EDOS PDS construction record generation for SUOMI NPP
"""
from
datetime
import
datetime
import
copy
import
difflib
import
itertools
import
logging
import
os
import
pprint
import
edosl0util.crio
as
crio
from
edosl0util.headers
import
DaySegmentedTimecode
from
edosl0util.stream
import
jpss_packet_stream
def
diff_crs
(
real_file
,
generated_file
):
"""
Print full diff output from a real EDOS CR to one generated by this module
Only fields which can be generated by this module via a packet scan are compared.
Nothing is output if the CRs are the same.
"""
def
main
():
real
=
crio
.
read
(
real_file
)
generated
=
crio
.
read
(
generated_file
)
make_comparable
(
real
,
generated
)
if
real
!=
generated
:
diff
=
difflib
.
ndiff
(
pprint
.
pformat
(
real
).
splitlines
(),
pprint
.
pformat
(
generated
).
splitlines
())
for
line
in
diff
:
print
line
def
make_comparable
(
real
,
generated
):
insert_fake_cr_info
(
real
)
del
generated
[
'
completion_time
'
]
# it seems CR completion time does not match PDS
del
real
[
'
completion_time
'
]
# creation time from the file name
main
()
def
test_build_apid_info
():
# FIXME: build CR comparison into the CLI
calculated
=
build_cr
(
'
P1571289CRISSCIENCEAAT15320210920101.PDS
'
)
...
...
@@ -102,7 +130,7 @@ def get_pds_creation_time(pds_file_or_id):
def
build_apid_info
(
scan_apid_info
):
"""
Build up apid_info resulting from scan_packets into a full apid_info for a CR
"""
apid_info
=
deepcopy
(
scan_apid_info
)
apid_info
=
copy
.
deepcopy
(
scan_apid_info
)
for
entry
in
apid_info
:
entry
[
'
scid
'
]
=
npp_scid
entry
[
'
vcid_count
'
]
=
1
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
0
View file @
d7f36fdd
...
...
@@ -22,6 +22,7 @@ setup(
edosl0trunc = edosl0util.cli.trunc:main
edosl0info = edosl0util.cli.info:main
edosl0merge = edosl0util.cli.merge:main
edosl0crgen = edosl0util.cli.crgen:main
rdr2l0 = edosl0util.cli.rdr2l0:main
"""
)
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