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
fe5a5148
Commit
fe5a5148
authored
6 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Add RTTC monitoring
parent
08ea8e62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile.in
+6
-4
6 additions, 4 deletions
Makefile.in
configure
+8
-0
8 additions, 0 deletions
configure
scripts/rttc.py
+92
-0
92 additions, 0 deletions
scripts/rttc.py
with
106 additions
and
4 deletions
Makefile.in
+
6
−
4
View file @
fe5a5148
...
...
@@ -83,12 +83,14 @@ start:
"echo narf"
@
tmux
select
-layout
even-vertical
@
# AHRS
@
# AHRS
/RTTC
@
#
@tmux
new-window
-n
ahrs
-t
${SESSION_NAME}
@tmux split-window -v -t ${SESSION_NAME}
:
ahrs
@
tmux send-keys
-t
${
SESSION_NAME
}
:ahrs.1
\
@tmux
new-window
-n
ahrs
-rttc
-t
${SESSION_NAME}
@tmux split-window -v -t ${SESSION_NAME}
:
ahrs
-rttc
@
tmux send-keys
-t
${
SESSION_NAME
}
:ahrs
-rttc
.1
\
"python scripts/ahrs_calibration.py -d
${
DETECTOR_ID
}
-p
${
MONITORING_LIGIER_PORT
}
"
Enter
@
tmux send-keys
-t
${
SESSION_NAME
}
:ahrs-rttc.2
\
"python scripts/rttc.py -d
${
DETECTOR_ID
}
-l
${
DETECTOR_MANAGER_IP
}
"
Enter
@
tmux
select
-layout
even-vertical
@
# K40
...
...
This diff is collapsed.
Click to expand it.
configure
+
8
−
0
View file @
fe5a5148
...
...
@@ -3,6 +3,7 @@
detector_id
=
29
daq_ligier_ip
=
"192.168.0.110"
daq_ligier_port
=
5553
detector_manager_ip
=
"192.168.0.120"
monitoring_ligier_ip
=
"127.0.0.1"
monitoring_ligier_port
=
5553
logio_ip
=
"127.0.0.1"
...
...
@@ -35,6 +36,10 @@ for arg in "$@"; do
daq_ligier_port
=
`
echo
$arg
|
sed
's/--daq-ligier-port=//'
`
;;
--detector-manager-ip
=
*
)
detector_manager_ip
=
`
echo
$arg
|
sed
's/--detector-manager-ip=//'
`
;;
--monitoring-ligier-port
=
*
)
monitoring_ligier_port
=
`
echo
$arg
|
sed
's/--monitoring-ligier-port=//'
`
;;
...
...
@@ -63,6 +68,7 @@ for arg in "$@"; do
echo
" --detector-id Detector ID
${
detector_id
}
"
echo
" --daq-ligier-ip DAQ Ligier
${
daq_ligier_ip
}
"
echo
" --daq-ligier-port Port of the DAQ Ligier
${
daq_ligier_port
}
"
echo
" --detector-manager-ip Detector Manager for RTTC
${
detector_manager_ip
}
"
echo
" --monitoring-ligier-port Port of the monitoring Ligier
${
monitoring_ligier_port
}
"
echo
" --logio-ip Log.io IP
${
logio_ip
}
"
echo
" --logio-port Port of the Log.io server
${
logio_port
}
"
...
...
@@ -78,6 +84,7 @@ done
echo
"DETECTOR_ID =
${
detector_id
}
"
>
Makefile
echo
"DAQ_LIGIER_IP =
${
daq_ligier_ip
}
"
>>
Makefile
echo
"DAQ_LIGIER_PORT =
${
daq_ligier_port
}
"
>>
Makefile
echo
"DETECTOR_MANAGER_IP =
${
detector_manager_ip
}
"
>>
Makefile
echo
"MONITORING_LIGIER_PORT =
${
monitoring_ligier_port
}
"
>>
Makefile
echo
"LOGIO_IP =
${
logio_ip
}
"
>>
Makefile
echo
"LOGIO_PORT =
${
logio_port
}
"
>>
Makefile
...
...
@@ -89,6 +96,7 @@ cat Makefile.in >> Makefile
show_km3mon_banner
echo
"Detector ID:
${
detector_id
}
"
echo
"DAQ Ligier:
${
daq_ligier_ip
}
:
${
daq_ligier_port
}
"
echo
"Detector Manager:
${
detector_manager_ip
}
"
echo
"Monitoring Ligier:
${
monitoring_ligier_ip
}
:
${
monitoring_ligier_port
}
"
echo
"Log.io Server:
${
logio_ip
}
:
${
logio_port
}
"
echo
"Webserver: 0.0.0.0:
${
webserver_port
}
"
...
...
This diff is collapsed.
Click to expand it.
scripts/rttc.py
0 → 100644
+
92
−
0
View file @
fe5a5148
#!/usr/bin/env python
# coding=utf-8
# vim: ts=4 sw=4 et
"""
Cable round trip time monitor.
Usage:
rttc.py [options] -d DET_ID
rttc.py (-h | --help)
Options:
-d DET_ID Detector ID.
-l DM_IP The IP of the DetectorManager [default: 127.0.0.1].
-o PLOT_DIR The directory to save the plot [default: plots].
-h --help Show this screen.
"""
from
__future__
import
division
import
os
from
datetime
import
datetime
import
matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib
.
use
(
'
Agg
'
)
import
matplotlib.pyplot
as
plt
import
matplotlib.dates
as
md
import
matplotlib.ticker
as
ticker
from
matplotlib.colors
import
LogNorm
import
numpy
as
np
from
collections
import
deque
,
defaultdict
from
functools
import
partial
import
km3pipe
as
kp
from
km3pipe
import
Pipeline
,
Module
import
km3pipe.style
km3pipe
.
style
.
use
(
'
km3pipe
'
)
from
km3pipe.logger
import
logging
def
main
():
from
docopt
import
docopt
args
=
docopt
(
__doc__
)
data
=
defaultdict
(
partial
(
deque
,
maxlen
=
1000
))
dm_ip
=
args
[
'
-l
'
]
det_id
=
int
(
args
[
'
-d
'
])
plots_path
=
args
[
'
-o
'
]
detector
=
kp
.
hardware
.
Detector
(
det_id
=
det_id
)
dmm
=
kp
.
io
.
daq
.
DMMonitor
(
dm_ip
,
base
=
'
clb/outparams
'
)
params
=
[]
for
du
in
detector
.
dus
:
params
+=
[
'
wr_mu/%d/0
'
%
du
]
+
[
'
wr_delta/%d/0/%i
'
%
(
du
,
i
)
for
i
in
range
(
4
)]
xfmt
=
md
.
DateFormatter
(
'
%Y-%m-%d %H:%M
'
)
session
=
dmm
.
start_session
(
'
rttc_monitoring
'
,
params
)
for
values
in
session
:
for
du
in
detector
.
dus
:
i
=
detector
.
dus
.
index
(
du
)
idx_start
=
i
*
5
idx_stop
=
idx_start
+
5
data
[
du
].
append
((
datetime
.
utcnow
(),
[
v
[
'
value
'
]
for
v
in
values
[
idx_start
:
idx_stop
]]))
for
du
in
detector
.
dus
:
times
=
[]
rttc
=
[]
for
d
in
data
[
du
]:
times
.
append
(
d
[
0
])
wr_mu
,
wr_delta0
,
wr_delta1
,
wr_delta2
,
wr_delta3
=
d
[
1
]
rttc_value
=
wr_mu
-
(
wr_delta0
+
wr_delta1
+
wr_delta2
+
wr_delta3
)
rttc
.
append
(
rttc_value
)
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
16
,
4
))
ax
.
plot
(
times
,
rttc
,
marker
=
"
X
"
,
markersize
=
6
,
linestyle
=
'
None
'
)
ax
.
set_xlabel
(
'
time [UTC]
'
)
ax
.
set_ylabel
(
'
RTTC [ps]
'
)
ax
.
xaxis
.
set_major_formatter
(
xfmt
)
plt
.
savefig
(
os
.
path
.
join
(
plots_path
,
'
rttc_du-%d.png
'
%
du
),
dpi
=
120
,
bbox_inches
=
"
tight
"
)
plt
.
close
(
'
all
'
)
if
__name__
==
'
__main__
'
:
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