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
4bbb7ed4
Commit
4bbb7ed4
authored
Apr 08, 2019
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed residual text and corrected _err.out header lines
parent
ac635714
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
analyze_sellmeier.py
sw/insitu_alpha/analyze_sellmeier.py
+7
-6
No files found.
sw/insitu_alpha/analyze_sellmeier.py
View file @
4bbb7ed4
...
...
@@ -546,7 +546,7 @@ def alpha_err_writeln(alpha_err_file, l1, l1_stddev, l2, l2_stddev, l_fix, l_fix
crtt_l2_str
=
"{0:.0f}"
.
format
(
crtt_l2
)
crtt_l2_stddev_str
=
"{0:.0f}"
.
format
(
crtt_l2_stddev
)
alpha_sel
,
alpha_stddev_sel
=
calc_alpha_sellmeier_stddev
(
l1
/
1e9
,
l1_stddev
,
l_fix
,
l_fix_stddev
,
popt
,
perr
)
alpha_sel_str
=
"{0:.
5
e}"
.
format
(
alpha_sel
)
alpha_sel_str
=
"{0:.
3
e}"
.
format
(
alpha_sel
)
alpha_stddev_sel_str
=
"{0:.3e}"
.
format
(
alpha_stddev_sel
)
time_error_due_stddev
,
time_error_due_stddev_stddev
=
calc_alpha_error_stddev
(
alpha_sel
,
0
,
alpha_sel
+
alpha_stddev_sel
,
0
,
crtt_fixed_lambda
,
crtt_fixed_lambda_stddev
)
time_error_due_stddev_str
=
"{0:.3e}"
.
format
(
time_error_due_stddev
)
...
...
@@ -797,11 +797,11 @@ def analyze_plot(insitu_file, analyse_single, x, y, name, tolerance, use_itu_cha
#lns2 = ax.plot(x_clean, ly_lin_clean, "-", color = 'blue', dashes=[5,5,5,5], label='linear fit') # final clean linear fit in [nm]
ax2
=
ax
.
twinx
()
ax2
.
set_ylabel
(
'
data versus fit err
[ps]'
)
ax2
.
set_ylabel
(
'
Residual
[ps]'
)
# Calcualte standard deviation of data to fit error and format string
stdev_str
=
"{0:.3f}"
.
format
(
data_vs_fit_err_clean
.
std
(
ddof
=
1
))
lns3
=
ax2
.
plot
(
x_clean
,
data_vs_fit_err_clean
,
color
=
'grey'
,
label
=
'
data vs. 5-term Sellmeier fit error
\n
StDev: '
+
stdev_str
+
'[ps]'
)
lns3
=
ax2
.
plot
(
x_clean
,
data_vs_fit_err_clean
,
color
=
'grey'
,
label
=
'
Residual
\n
(i.e. data vs. 5-term Sellmeier fit)
\n
StDev: '
+
stdev_str
+
'[ps]'
)
#lns=lns+lns1+lns2+lns3
lns
=
lns
+
lns1
+
lns3
# Removed linear fit from legend
...
...
@@ -997,7 +997,8 @@ def analyze_plot(insitu_file, analyse_single, x, y, name, tolerance, use_itu_cha
#for i in rng_sel:
# alpha_err_file.write(str(l2[i[0]][0]) + "\t" + str(l2[i[1]][0]) + "\n")
alpha_err_file
.
write
(
"l1[nm]
\t
l2[nm]
\t
crtt_(l1)[ps]
\t
crtt_stddev(l1)[ps]
\t
crtt(l2)[ps]
\t
crtt_stddev_(l2)[ps]
\t
alpha_sel(l1)
\t
alpha_stddev_sel(l1)
\t
time_error_due_alpha_stddev_sel(l1)[ps]
\t
alpha_3wl(l1)
\t
alpha_3wl_stddev(l1)
\t
SPEC_alpha_3wl(l1)
\t
time_err[ps]
\t
time_err_stddev[ps]
\t
time_relative_err[t_err ps/link_length ps]
\n
"
)
alpha_err_file_header
=
"l1[nm]
\t
l2[nm]
\t
crtt_(l1)[ps]
\t
crtt_stddev(l1)[ps]
\t
crtt(l2)[ps]
\t
crtt_stddev_(l2)[ps]
\t
alpha_sel(l1)
\t
alpha_stddev_sel(l1)
\t
time_error_due_alpha_stddev_sel(l1)[ps]
\t
alpha_3wl(l1)
\t
alpha_3wl_stddev(l1)
\t
SPEC_alpha_3wl(l1)
\t
time_err[ps]
\t
time_err_stddev[ps]
\t
time_relative_err[t_err ps/link_length ps]
\n
"
alpha_err_file
.
write
(
alpha_err_file_header
)
alpha_ddelay_file
.
write
(
"# lambda-1[nm]
\t
ITU-ch
\t
SPEC_alpha_3wl(l1)
\t
lambda-2[nm]
\t\t
time_err[ps]
\n
"
)
for
i
in
rng_sel
:
...
...
@@ -1018,7 +1019,7 @@ def analyze_plot(insitu_file, analyse_single, x, y, name, tolerance, use_itu_cha
# fixed selection along the array:
rng_sel
=
([[
0
,
16
],[
0
,
32
],[
0
,
49
],[
16
,
0
],[
16
,
32
],[
16
,
49
],[
32
,
0
],[
32
,
16
],[
32
,
49
],[
49
,
0
],[
49
,
16
],[
49
,
32
]])
alpha_err_file
.
write
(
"l1[nm]
\t
l2[nm]
\t
crtt_(l1)[ps]
\t
crtt(l2)[ps]
\t
alpha_sel(l1)
\t
alpha_3wl(l1)
\t
SPEC_alpha_3wl(l1)
\t
time_err[ps]
\t
time_relative_err[t_err ps/link_length ps]
\n
"
)
alpha_err_file
.
write
(
alpha_err_file_header
)
alpha_ddelay_file
.
write
(
"# lambda-1[nm]
\t
ITU-ch
\t
SPEC_alpha_3wl(l1)
\t
lambda-2[nm]
\t\t
time_err[ps]
\n
"
)
for
i
in
rng_sel
:
lambda1
=
l2
[
i
[
0
]][
0
]
...
...
@@ -1033,7 +1034,7 @@ def analyze_plot(insitu_file, analyse_single, x, y, name, tolerance, use_itu_cha
alpha_err_file
.
write
(
"============================
\n
"
)
alpha_err_file
.
write
(
"all possible combinations and their results:
\n
"
)
alpha_err_file
.
write
(
"
l1[nm]
\t
l2[nm]
\t
crtt_(l1)[ps]
\t
crtt(l2)[ps]
\t
alpha_sel(l1)
\t
alpha_3wl(l1)
\t
SPEC_alpha_3wl(l1)
\t
time_err[ps]
\t
time_relative_err[t_err ps/link_length ps]
\n
"
)
alpha_err_file
.
write
(
"
alpha_err_file_header
"
)
for
l1_idx
in
range
(
len
(
x_clean
)):
for
l2_idx
in
range
(
len
(
x_clean
)):
lambda1
=
l1
[
l1_idx
][
l2_idx
]
...
...
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