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
248cb513
Commit
248cb513
authored
Jan 17, 2018
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3d plots for l1 on x-axis, l2 on y-axis. also relative time error (t_err [ps]/link length [ps])
parent
ac27c8a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
10 deletions
+52
-10
analyze_sellmeier.py
sw/insitu_alpha/analyze_sellmeier.py
+52
-10
No files found.
sw/insitu_alpha/analyze_sellmeier.py
View file @
248cb513
...
...
@@ -526,6 +526,9 @@ if __name__ == "__main__":
alpha_sellmeier
.
append
(
alpha_sel
)
alpha_time_error
.
append
(
calc_alpha_error
(
alpha_sel
,
alpha_tan
,
crtt_fixed_lambda
))
# =====================================================
# Plot CRTT versus ITU Channel number
# =====================================================
fig
=
plt
.
figure
(
"CRTT versus ITU Channel number"
)
ax
=
fig
.
add_subplot
(
111
)
ax
.
set_ylabel
(
'CRTT [ps]'
)
...
...
@@ -560,6 +563,10 @@ if __name__ == "__main__":
fig
.
savefig
(
insitu_file
+
".png"
)
if
isfile
:
# Analyze single file => plot
# =====================================================
# Plot alpha as a function of wavelength
# =====================================================
fig_alpha
=
plt
.
figure
(
"alpha as a function of wavelength"
)
ax
=
fig_alpha
.
add_subplot
(
111
)
ax
.
set_title
(
"alpha as a function of wavelength"
)
...
...
@@ -578,7 +585,9 @@ if __name__ == "__main__":
#ax.plot(x_clean, alpha_linear, color='blue', dashes=[5,5,5,5], label='linear')
ax
.
legend
(
loc
=
'lower right'
,
fontsize
=
'medium'
)
# =====================================================
# Plot Time error due to using linear instead of 5-term sellmeier
# =====================================================
fig_alpha_error
=
plt
.
figure
(
"Sellmeier/Linear Error wavelength"
)
ax
=
fig_alpha_error
.
add_subplot
(
111
)
ax
.
set_title
(
"Time error due to using linear instead of 5-term sellmeier"
)
...
...
@@ -597,7 +606,8 @@ if __name__ == "__main__":
ax
.
legend
(
loc
=
'lower right'
,
fontsize
=
'medium'
)
# =====================================================
# 3D Plots
# =====================================================
from
mpl_toolkits.mplot3d
import
axes3d
# Here we are going to make the 3 wavelength error plot:
...
...
@@ -612,23 +622,55 @@ if __name__ == "__main__":
alpha_3wlsel
=
calc_alpha_sellmeier
(
l1
/
1e9
,
fixed_lambda
,
popt
[
0
],
popt
[
1
],
popt
[
2
],
popt
[
3
],
popt
[
4
])
alpha_err
=
alpha_3wlsel
-
alpha_3wl
time_err
=
calc_alpha_error
(
alpha_3wlsel
,
alpha_3wl
,
crtt_fixed_lambda
)
time_err_relative
=
time_err
/
crtt_fixed_lambda
#fig_3wavelength_alpha_err = plt.figure("3 wavelength alpha error")
#ax = fig_3wavelength_alpha_err.add_subplot(111,projection='3d')
#ax.set_xlabel('l1 - fixed_lambda [nm]')
#ax.set_ylabel('l1 - l2 [nm]')
#ax.set_zlabel('alpha error')
#ax.plot_wireframe(l1-fixed_lambda*1e9, l1-l2, alpha_err)
"""
# =====================================================
# Plot 3 wavelength alpha error
# =====================================================
fig_3wavelength_alpha_err = plt.figure("3 wavelength alpha error")
ax = fig_3wavelength_alpha_err.add_subplot(111,projection='3d')
ax.set_xlabel('l1 - fixed_lambda [nm]')
ax.set_ylabel('l1 - l2 [nm]')
ax.set_zlabel('alpha error')
ax.plot_wireframe(l1-fixed_lambda*1e9, l1-l2, alpha_err)
fig_3wavelength_time_err
=
plt
.
figure
(
"3 wavelength time error for link with crtt(lambda_sm) = "
+
str
(
crtt_fixed_lambda
)
+
"[ps]"
)
ax
=
fig_3wavelength_time_err
.
add_subplot
(
111
,
projection
=
'3d'
)
# =====================================================
# Plot 3 wavelength time error (l1-lsm x-axis, l1-l2 y-axis, error z-axis)
# =====================================================
fig_3wavelength_time_err_offset = plt.figure("3 wavelength (relative displayed) time error for link with crtt(lambda_sm) = "+ str(crtt_fixed_lambda) + "[ps]")
ax = fig_3wavelength_time_err_offset.add_subplot(111,projection='3d')
ax.set_xlabel('l1 - fixed_lambda [nm]')
ax.set_ylabel('l1 - l2 [nm]')
ax.set_zlabel('time error [ps]')
ax.plot_wireframe(l1-fixed_lambda*1e9, l1-l2, time_err)
"""
# =====================================================
# Plot 3 wavelength time error (l1 on x-axis, l2 on y-axis, error z-axis)
# =====================================================
fig_3wavelength_time_err
=
plt
.
figure
(
"3 wavelength time error for link with crtt(lambda_sm) = "
+
str
(
crtt_fixed_lambda
)
+
"[ps]"
)
ax
=
fig_3wavelength_time_err
.
add_subplot
(
111
,
projection
=
'3d'
)
ax
.
set_xlabel
(
'l1 [nm]'
)
ax
.
set_ylabel
(
'l2 [nm]'
)
ax
.
set_zlabel
(
'time error [ps]'
)
ax
.
plot_wireframe
(
l1
,
l2
,
time_err
)
"""
# =====================================================
# Plot 3 wavelength relative time error (l1 on x-axis, l2 on y-axis, error z-axis)
# =====================================================
fig_3wavelength_time_err = plt.figure("3 wavelength relative time error")
ax = fig_3wavelength_time_err.add_subplot(111,projection='3d')
ax.set_xlabel('l1 [nm]')
ax.set_ylabel('l2 [nm]')
ax.set_zlabel('relative error [ps time error/ps link length]')
ax.plot_wireframe(l1, l2, time_err_relative)
"""
# =====================================================
# Output (some) alpha values in file
# =====================================================
alpha_file
=
open
(
name
+
".out"
,
"w"
)
alpha_file
.
write
(
"file: "
+
insitu_file
+
"
\n
"
)
alpha_file
.
write
(
"outlier-count: "
+
str
(
outlier_cnt
)
+
"
\n
"
)
...
...
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