Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rtleap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Lloyd Carothers
rtleap
Commits
77ffcd26
Commit
77ffcd26
authored
7 years ago
by
Lloyd Carothers
Browse files
Options
Downloads
Patches
Plain Diff
print jerks untested mods.
parent
867548a8
Branches
jerks_unsure
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rtleap.py
+34
-11
34 additions, 11 deletions
rtleap.py
with
34 additions
and
11 deletions
rtleap.py
+
34
−
11
View file @
77ffcd26
...
...
@@ -363,7 +363,7 @@ class Reftek(object):
return
def
find_tears
(
self
,
start
=
None
,
end
=
None
):
'''
Finds all gaps and overlaps
'''
Finds all gaps and overlaps
ignoring mass positions
'''
dstreams
=
DataStreams
()
# tears
...
...
@@ -374,8 +374,9 @@ class Reftek(object):
if
p
.
ptype
==
'
EH
'
:
# add /replace stream
dstreams
.
addEH
(
p
)
continue
# if dt
if
p
.
ptype
==
'
DT
'
:
if
p
.
ptype
==
'
DT
'
and
p
.
ds
<
8
:
first_samp_time
=
p
.
Ltime
should_start
,
last_packet
=
dstreams
.
addDT
(
p
)
if
not
should_start
:
...
...
@@ -391,8 +392,11 @@ class Reftek(object):
def
find_dsp_diffs
(
self
,
start
=
None
,
end
=
None
):
'''
Find all DSP diff lines in SOH
'''
dsp_list
=
list
()
for
p
in
self
.
gen_packets
(
start
=
start
,
end
=
end
,
ds
=
0
):
return
p
.
DSPdiff
()
if
p
.
DSPdiff
():
dsp_list
.
append
(
p
.
DSPdiff
())
return
dsp_list
def
find_2016_leap_dsp
(
self
):
'''
Returns the time of the first dsp diff of -1s 0msec after 2017:001
...
...
@@ -436,7 +440,7 @@ class Reftek(object):
dsptime
=
self
.
find_2016_leap_dsp
()
print
'
DAS corrected for leap at:
'
,
dsptime
for
cf
in
self
.
gen_cf_files
(
start
=
NEWYEAR
,
end
=
dsptime
):
if
0
<
cf
.
ds
and
cf
.
ds
<
8
:
# 8 datastreams
if
0
<
cf
.
ds
and
cf
.
ds
<
8
:
# 8 datastreams
, 0=ds, 9=M.P.
mistimed_files
.
append
(
cf
)
return
mistimed_files
...
...
@@ -554,7 +558,7 @@ class Reftek(object):
if
not
data
:
raise
StopIteration
yield
Packet
(
data
)
def
print_packets
(
self
):
for
p
in
self
.
gen_packets
():
print
p
...
...
@@ -769,26 +773,38 @@ def find_rt_files(paths):
if
__name__
==
'
__main__
'
:
parser
=
argparse
.
ArgumentParser
()
parser
.
version
=
VERSION
parser
.
description
=
(
'
Program for finding, viewing, correcting
Dec 2016
'
'
leapsecond
timing of
RT-130 data.
'
parser
.
description
=
(
'
Program for finding, viewing,
and
correcting
'
'
Dec 2016
leapsecond
mistimed
RT-130 data.
'
)
parser
.
add_argument
(
'
paths
'
,
nargs
=
'
*
'
,
default
=
[
'
./
'
],
help
=
'
Input CF dir
'
,
help
=
'
Input CF dirs. The root dir of a CF card
'
'
recorded by and RT-130, containing YYYYDDD dirs.
'
,
)
parser
.
add_argument
(
'
-p
'
,
dest
=
'
print_packets
'
,
action
=
'
store_true
'
,
help
=
'
Print packets. Like refpacket
'
,
help
=
'
Print
all
packets. Like refpacket
.
'
,
)
parser
.
add_argument
(
'
-t
'
,
dest
=
'
find_tears
'
,
action
=
'
store_true
'
,
help
=
'
Print tears
'
,
help
=
'
Print all tears. Does not include mass position
'
'
channels.
'
,
)
parser
.
add_argument
(
'
-j
'
,
dest
=
'
find_jerks
'
,
action
=
'
store_true
'
,
help
=
'
Print all jerks.
'
,
)
parser
.
add_argument
(
'
-c
'
,
dest
=
'
correct
'
,
action
=
'
store_true
'
,
help
=
'
Fix Dec 2016 leapsecond tears
'
,
help
=
'
Fix Dec 2016 leapsecond tears. Files corrected
'
'
will first be backed up with .ORIG suffix, then
'
'
corrections will be applied to the original files
'
'
allowing most downstream processes (rt2ms) to work
'
'
on the corrected data. Does not alter mass position
'
'
or SOH channels.
'
,
)
args
=
parser
.
parse_args
()
...
...
@@ -821,3 +837,10 @@ if __name__ == '__main__':
print
'
-
'
*
15
,
'
Finding tears:
'
,
rt
print
ref
.
find_tears
()
print
'
-
'
*
60
if
args
.
find_jerks
:
for
rt
in
refs
:
print
'
-
'
*
15
,
'
Finding jerks:
'
,
rt
print
ref
.
find_dsp_diffs
()
print
'
-
'
*
60
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