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
65fc1856
Commit
65fc1856
authored
8 years ago
by
Bruce Flynn
Browse files
Options
Downloads
Patches
Plain Diff
fix: Too many open files for converting lots of spacecraft data
parent
c5f240b1
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/cli/rdr2l0.py
+6
-3
6 additions, 3 deletions
edosl0util/cli/rdr2l0.py
with
6 additions
and
3 deletions
edosl0util/cli/rdr2l0.py
+
6
−
3
View file @
65fc1856
...
...
@@ -8,7 +8,6 @@ __copyright__ = "Copyright (C) 2015 University of Wisconsin SSEC. All rights res
import
os
import
glob
import
logging
import
tempfile
from
datetime
import
datetime
,
timedelta
from
edosl0util
import
stream
,
merge
,
jpssrdr
...
...
@@ -95,7 +94,8 @@ def spacecraft(satellite, rdrs, start, end):
for
apid
in
(
0
,
8
,
11
):
# alphanumeric sorting to bootstrap final sort
inputs
=
sorted
(
glob
.
glob
(
'
*.ancillary{}.pkts
'
.
format
(
apid
)))
streams
=
[
stream
.
jpss_packet_stream
(
open
(
f
,
'
rb
'
))
for
f
in
inputs
]
files
=
[
open
(
f
,
'
rb
'
)
for
f
in
inputs
]
streams
=
[
stream
.
jpss_packet_stream
(
f
)
for
f
in
files
]
product
=
'
P{}{:04d}
'
.
format
(
scid
,
apid
)
pdsname
=
pdsfilename
(
product
,
start
)
...
...
@@ -103,6 +103,9 @@ def spacecraft(satellite, rdrs, start, end):
with
open
(
pdsname
,
'
wb
'
)
as
dest
:
merge
.
merge
(
streams
,
output
=
dest
,
trunc_to
=
[
start
,
end
])
# lots of files so make sure they're closed
[
f
.
close
()
for
f
in
files
]
def
main
():
# XXX: This currently uses standard CCSDS packet merging that does not have
...
...
@@ -192,7 +195,7 @@ def main():
util
.
configure_logging
(
args
)
pdsname
=
args
.
func
(
args
)
args
.
func
(
args
)
if
not
args
.
leave_pkts
:
remove_files
(
glob
.
glob
(
'
*.pkts
'
))
...
...
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