Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3mon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
km3py
km3mon
Commits
ebff3cf3
Commit
ebff3cf3
authored
6 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Include baseline
parent
bbf79216
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/rttc.py
+14
-2
14 additions, 2 deletions
scripts/rttc.py
with
14 additions
and
2 deletions
scripts/rttc.py
+
14
−
2
View file @
ebff3cf3
...
...
@@ -40,8 +40,10 @@ km3pipe.style.use('km3pipe')
from
km3pipe.logger
import
logging
@kp.tools.timed_cache
(
hours
=
1
)
def
get_baseline_rttc
(
det_id
,
hours
=
24
):
"""
Retrieve the median and std RTTC values for a given time interval [h]
"""
print
(
"
Retrieving baseline RTTC
"
)
now
=
time
.
time
()
dm
=
kp
.
db
.
DBManager
()
det_oid
=
dm
.
get_det_oid
(
det_id
)
...
...
@@ -54,7 +56,7 @@ def get_baseline_rttc(det_id, hours=24):
runs
[
runs
.
UNIXSTARTTIME
<
(
now
-
60
*
60
*
hours
)
*
1000
].
tail
(
1
).
RUN
)
baselines
=
{}
for
du
in
self
.
det
.
dus
:
for
du
in
det
.
dus
:
data
=
OrderedDict
()
for
param
in
[
'
wr_mu
'
]
+
[
'
wr_delta[%d]
'
%
i
for
i
in
range
(
4
)]:
_data
=
sds
.
datalognumbers
(
...
...
@@ -62,7 +64,10 @@ def get_baseline_rttc(det_id, hours=24):
detid
=
det_oid
,
minrun
=
run_24h_ago
,
maxrun
=
latest_run
,
source_name
=
clbmap
.
base
(
1
).
upi
)
source_name
=
clbmap
.
base
(
du
).
upi
)
if
_data
is
None
:
data
[
param
]
=
(
0
,
0
)
continue
data
[
param
]
=
(
_data
.
DATA_VALUE
.
median
(),
_data
.
DATA_VALUE
.
std
())
rttc_median
=
data
[
'
wr_mu
'
][
0
]
-
sum
(
[
data
[
p
][
0
]
for
p
in
list
(
data
.
keys
())[
1
:]])
...
...
@@ -96,6 +101,7 @@ def main():
session
=
dmm
.
start_session
(
'
rttc_monitoring
'
,
params
)
for
values
in
session
:
baselines
=
get_baseline_rttc
(
det_id
,
hours
=
24
)
for
du
in
detector
.
dus
:
i
=
detector
.
dus
.
index
(
du
)
idx_start
=
i
*
5
...
...
@@ -116,6 +122,12 @@ def main():
wr_delta0
+
wr_delta1
+
wr_delta2
+
wr_delta3
)
rttc
.
append
(
rttc_value
)
rttc_median
=
baselines
[
du
][
0
]
rttc_std
=
baselines
[
du
][
1
]
ax
.
axhline
(
y
=
rttc_median
+
rttc_std
,
color
=
'
r
'
,
lw
=
1
,
ls
=
'
--
'
)
ax
.
axhline
(
y
=
rttc_median
-
rttc_std
,
color
=
'
r
'
,
lw
=
1
,
ls
=
'
--
'
)
ax
.
axhline
(
y
=
rttc_median
,
color
=
'
r
'
,
lw
=
2
,
ls
=
'
-
'
)
ax
.
plot
(
times
,
rttc
,
marker
=
"
X
"
,
markersize
=
6
,
linestyle
=
'
None
'
)
clb
=
clbmap
.
base
(
du
)
...
...
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