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
887ad75c
Commit
887ad75c
authored
7 years ago
by
Bruce Flynn
Browse files
Options
Downloads
Patches
Plain Diff
py3 compat issues
parent
1a4b0232
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
edosl0util/jpssrdr.py
+8
-5
8 additions, 5 deletions
edosl0util/jpssrdr.py
tests/test_merge.py
+1
-1
1 addition, 1 deletion
tests/test_merge.py
tests/test_rdrgen.py
+2
-1
2 additions, 1 deletion
tests/test_rdrgen.py
with
11 additions
and
7 deletions
edosl0util/jpssrdr.py
+
8
−
5
View file @
887ad75c
...
...
@@ -9,9 +9,9 @@ Code for reading/writing/manipulating JPSS Common RDR files as documented in:
"""
__copyright__
=
"
Copyright (C) 2015 University of Wisconsin SSEC. All rights reserved.
"
import
os
import
logging
import
ctypes
as
c
import
logging
import
os
from
collections
import
namedtuple
import
numpy
as
np
...
...
@@ -73,6 +73,7 @@ def _make_packet_impl(size):
"""
# size minus the CCSDS primary header size
data_size
=
size
-
6
class
PktImpl
(
BaseStruct
):
# noqa
_fields_
=
[
(
'
version
'
,
c
.
c_uint8
,
3
),
...
...
@@ -84,6 +85,7 @@ def _make_packet_impl(size):
(
'
length_minus1
'
,
c
.
c_uint16
),
(
'
data
'
,
c
.
c_uint8
*
data_size
)
]
return
PktImpl
...
...
@@ -272,8 +274,8 @@ def write_rdr_datasets(filepath, ancillary=False, skipfill=False):
for
apid
,
pkts
in
packets
.
items
():
LOG
.
debug
(
'
writing ancillary gran %d %s-%s-%s %d
'
,
idx
,
rdr
.
header
.
satellite
,
rdr
.
header
.
sensor
,
rdr
.
header
.
type_id
,
apid
)
idx
,
rdr
.
header
.
satellite
.
decode
()
,
rdr
.
header
.
sensor
.
decode
()
,
rdr
.
header
.
type_id
.
decode
()
,
apid
)
pktfile
=
'
{}.{}{}.pkts
'
.
format
(
rdrname
,
typekey
,
apid
)
with
open
(
pktfile
,
'
ab
'
)
as
dest
:
_write_packets
(
pkts
,
dest
,
skipfill
)
...
...
@@ -284,6 +286,7 @@ def write_rdr_datasets(filepath, ancillary=False, skipfill=False):
for
idx
,
rdr
in
enumerate
(
rdrs
[
typekey
]):
LOG
.
debug
(
'
... %s gran %d %s-%s-%s
'
,
typekey
,
idx
,
rdr
.
header
.
satellite
,
rdr
.
header
.
sensor
,
rdr
.
header
.
type_id
)
idx
,
rdr
.
header
.
satellite
.
decode
(),
rdr
.
header
.
sensor
.
decode
(),
rdr
.
header
.
type_id
.
decode
())
_write_packets
(
rdr
.
packets
(),
dest
,
skipfill
)
return
rdrs
This diff is collapsed.
Click to expand it.
tests/test_merge.py
+
1
−
1
View file @
887ad75c
...
...
@@ -3,7 +3,7 @@ from operator import eq, lt, gt
import
pytest
from
edosl0util
import
merge
,
headers
from
edosl0util
import
merge
class
Test_Ptr
:
...
...
This diff is collapsed.
Click to expand it.
tests/test_rdrgen.py
+
2
−
1
View file @
887ad75c
...
...
@@ -114,7 +114,8 @@ def test_can_reproduce_rdr_from_class():
[
'
h5diff
'
,
'
-c
'
,
'
-p
'
,
'
1e-6
'
,
class_rdr_path
,
os
.
path
.
join
(
tmp_dir
,
writer
.
file_name
)],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
assert
p
.
communicate
()[
0
]
==
''
stdout
,
_
=
p
.
communicate
()
assert
stdout
.
decode
()
==
''
assert
p
.
returncode
==
0
...
...
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