Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Calibration
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Calibration
Commits
c3bee37a
Commit
c3bee37a
authored
Jun 08, 2018
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write single line output with all valid info (comma separated)
parent
fe5b0ac7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
calc_diff.py
sw/insitu_alpha/calc_diff.py
+9
-7
No files found.
sw/insitu_alpha/calc_diff.py
View file @
c3bee37a
...
...
@@ -55,21 +55,23 @@ def save_plot(out_file, name, nameref, measurement_str, measurement_lst, outlier
outliers <int> number of outliers encountered while processing
"""
measurement_str_shortend
=
measurement_str
.
replace
(
"# Selected ITU channel for "
,
""
)
measurement_str_shortend
=
measurement_str_shortend
.
replace
(
"
\n
"
,
""
)
meas_arr
=
numpy
.
array
(
measurement_lst
)
mean
=
meas_arr
.
mean
()
stdev
=
meas_arr
.
std
(
ddof
=
1
)
out_file
.
write
(
"outliers: "
+
str
(
outliers
)
+
"
\n
"
)
out_file
.
write
(
"mean: "
+
str
(
mean
)
+
"
\n
"
)
out_file
.
write
(
"stdev: "
+
str
(
stdev
)
+
"
\n
"
)
#out_file.write("outliers: " + str(outliers) + "\n")
#out_file.write("mean: " + str(mean) + "\n")
#out_file.write("stdev: " + str(stdev) + "\n")
out_file
.
write
(
str
(
mean
)
+
", "
+
str
(
stdev
)
+
", "
+
str
(
outliers
)
+
", "
+
str
(
measurement_str_shortend
)
+
"
\n
"
)
fig
=
plt
.
figure
(
"PPS_skew_fiberspool - PPS_skew_reference [ps]"
)
ax
=
fig
.
add_subplot
(
111
)
ax
.
set_ylabel
(
'PPS difference [ps]'
)
ax
.
set_title
(
"PPS_skew_fiberspool - PPS_skew_reference [ps]"
)
ax
.
set_xlabel
(
'Link restart number'
)
measurement_str_shortend
=
measurement_str
.
replace
(
"# Selected ITU channel for "
,
""
)
measurement_str_shortend
=
measurement_str_shortend
.
replace
(
"
\n
"
,
""
)
fig_str
=
measurement_str_shortend
+
"
\n
"
+
"file: "
+
name
+
"
\n
"
+
"ref file: "
+
nameref
+
"
\n
"
+
"outliers: "
+
str
(
outliers
)
+
"
\n
"
+
"mean: "
+
str
(
mean
)
+
"
\n
"
+
"stdev: "
+
str
(
stdev
)
ax
.
text
(
0.01
,
0.70
,
fig_str
,
transform
=
ax
.
transAxes
)
ax
.
plot
(
range
(
1
,
len
(
meas_arr
)
+
1
),
meas_arr
,
color
=
'blue'
,
label
=
'data'
)
...
...
@@ -167,7 +169,7 @@ if __name__ == "__main__":
out_file
.
write
(
"# ref file: "
+
nameref
+
"
\n
"
)
out_file
.
write
(
"# date:"
+
time
.
strftime
(
format
(
"
%
d
%
b
%
Y"
),
timestamp
)
+
"
\n
"
)
out_file
.
write
(
"# time:"
+
time
.
strftime
(
format
(
"
%
H:
%
M:
%
S"
),
timestamp
)
+
"
\n
"
)
out_file
.
write
(
"#
diff_delta delay, StdDev
, measurement
\n
"
)
out_file
.
write
(
"#
mean, StdDev, outliers
, measurement
\n
"
)
measurement_str
=
""
first
=
True
...
...
@@ -209,7 +211,7 @@ if __name__ == "__main__":
outliers
=
outliers
+
1
#print(meas_lst[0],ref_lst[0], meas_diff)
out_file
.
write
(
str
(
meas_diff
)
+
", "
+
str
(
meas_std
)
+
", "
+
str
(
measurement_str
))
#
out_file.write(str(meas_diff)+", "+str(meas_std)+", "+str(measurement_str))
# end of files, write last data
save_plot
(
out_file
,
name
,
nameref
,
measurement_str
,
measurement_lst
,
outliers
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment