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
d1726297
Commit
d1726297
authored
Apr 05, 2019
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added stddev to time_error function
parent
7ce67bc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
5 deletions
+47
-5
analyze_sellmeier.py
sw/insitu_alpha/analyze_sellmeier.py
+47
-5
No files found.
sw/insitu_alpha/analyze_sellmeier.py
View file @
d1726297
...
...
@@ -292,9 +292,9 @@ def calc_alpha_sellmeier_stddev(l, l_stddev, fixed_lambda, fixed_lambda_stddev,
perr -- <float> std-dev for Sellmeier terms
returns:
alpha -- <float> alpha value for lambda l when using fixed_lambda
as return channel
alpha
-- <float> std-dev of alpha value
alpha
-- <float> alpha value for lambda l when using fixed_lambda
as return channel
alpha
_stddev
-- <float> std-dev of alpha value
"""
...
...
@@ -352,6 +352,45 @@ def calc_alpha_error(alpha1, alpha2, crtt_fixed_lambda):
############################################################################
def
calc_alpha_error_stddev
(
alpha1
,
alpha1_stddev
,
alpha2
,
alpha2_stddev
,
crtt_fixed_lambda
,
crtt_fixed_lambda_stddev
):
"""
calc_alpha_error calculates the timing error between the PPS-ses of Master
and Slave that will be the result of an "imperfect" alpha2 with respect to a
"perfect" alpha1.
The timing error scales linear with the round trip time (i.e. the length of
your fiber)
alpha1 -- <float> alpha to be considered the correct value
alpha1_stddev -- <float> stddev for alpha1
alpha2 -- <float> alpha for which timing error needs to be calculated
alpha2_stddev -- <float> stddev for alpha2
crtt_fixed_lambda -- <float> crtt value at the fixed wavelenght.
note that this is the virtual crtt for which
master2slave and slave2master wavelengths would be
equal. It can be estimated by extrapolating the crtt
array.
crtt_fixed_lambda_stddev -- <float> stddev for crtt_fixed_lambda
returns:
t_err, t_err_stddev -- <float> PPS time error
"""
# Calculate the (mean) value of t_err
t_err
=
calc_alpha_error
(
alpha1
,
alpha2
,
crtt_fixed_lambda
)
# Calculate the stddev contribution to t_err of each of the parameters alpha1, alpha2 and crtt_fixed_lambda
t_err_stddev_alpha1
=
calc_alpha_error
(
alpha1
+
alpha1_stddev
,
alpha2
,
crtt_fixed_lambda
)
-
t_err
t_err_stddev_alpha2
=
calc_alpha_error
(
alpha1
,
alpha2
+
alpha2_stddev
,
crtt_fixed_lambda
)
-
t_err
t_err_stddev_crtt_fixed_lambda
=
calc_alpha_error
(
alpha1
,
alpha2
,
crtt_fixed_lambda
+
crtt_fixed_lambda_stddev
)
-
t_err
# Calculate the RMS stddev of alpha
t_err_stddev
=
numpy
.
sqrt
(
t_err_stddev_alpha1
**
2
+
t_err_stddev_alpha2
**
2
+
t_err_stddev_crtt_fixed_lambda
**
2
)
return
(
t_err
,
t_err_stddev
)
############################################################################
def
line
(
x
,
a
,
b
):
return
a
*
x
+
b
...
...
@@ -628,7 +667,9 @@ def analyze_plot(insitu_file, analyse_single, x, y, name, tolerance, use_itu_cha
alpha_tangent
.
append
(
alpha_tan
)
#alpha_tangent.append(calc_alpha_tangent(i/1e9, clean_y, dispersion, fixed_lambda))
alpha_sellmeier
.
append
(
alpha_sel
)
alpha_time_error
.
append
(
calc_alpha_error
(
alpha_sel
,
alpha_tan
,
crtt_fixed_lambda
))
#alpha_time_error.append(calc_alpha_error(alpha_sel, alpha_tan, crtt_fixed_lambda))
time_err
,
time_err_stddev
=
calc_alpha_error_stddev
(
alpha_sel
,
alpha_stddev_sel
,
alpha_tan
,
0
,
crtt_fixed_lambda
,
l_stddev
)
alpha_time_error
.
append
(
time_err
)
# =====================================================
# Plot CRTT versus ITU Channel number
...
...
@@ -757,7 +798,8 @@ def analyze_plot(insitu_file, analyse_single, x, y, name, tolerance, use_itu_cha
alpha_3wl
=
calc_alpha_l1
(
l1
/
1e9
,
l2
/
1e9
,
crtt_l1
,
crtt_l2
,
fixed_lambda
)
alpha_3wlsel
,
alpha_stddev_3wlsel
=
calc_alpha_sellmeier_stddev
(
l1
/
1e9
,
l_stddev
,
fixed_lambda
,
fixed_lambda_stddev
,
popt
,
perr
)
alpha_err
=
alpha_3wlsel
-
alpha_3wl
time_err
=
calc_alpha_error
(
alpha_3wlsel
,
alpha_3wl
,
crtt_fixed_lambda
)
#time_err = calc_alpha_error(alpha_3wlsel, alpha_3wl, crtt_fixed_lambda)
time_err
,
time_err_stddev
=
calc_alpha_error_stddev
(
alpha_3wlsel
,
alpha_stddev_3wlsel
,
alpha_3wl
,
0
,
crtt_fixed_lambda
,
l_stddev
)
time_err_relative
=
time_err
/
crtt_fixed_lambda
#pdb.set_trace()
...
...
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