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
88389282
Commit
88389282
authored
Sep 17, 2018
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added stddev per wavelength for averaged reference and measurement to result file.
added Sellmeier fits in one plot.
parent
25d3335e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
analyze_sellmeier.py
sw/insitu_alpha/analyze_sellmeier.py
+26
-3
No files found.
sw/insitu_alpha/analyze_sellmeier.py
View file @
88389282
...
...
@@ -458,6 +458,7 @@ def analyze_plot(insitu_file, analyse_single, x, y, name, tolerance, use_itu_cha
returns:
tangent_array -- <numpy.array> keep tangent values in an array in case multiple files are processed
temperature_array -- <numpy.array> keep temperature values in an array in case multiple files are processed
ly -- <numpy.array> Sellmeier fitted values
result_line -- <string> summary line to be added to the result_file
"""
...
...
@@ -868,7 +869,7 @@ def analyze_plot(insitu_file, analyse_single, x, y, name, tolerance, use_itu_cha
print
(
"file probably only contains measurements for a single wavelength"
)
#continue
return
(
tangent_array
,
temperature_array
,
result_line
)
return
(
tangent_array
,
temperature_array
,
ly
,
result_line
)
###########################################################################
#
...
...
@@ -986,6 +987,11 @@ if __name__ == "__main__":
print
(
insitu_file
+
": wrong file type"
)
continue
fig_sell_fits
=
plt
.
figure
(
"Sellmeier fits"
)
axs
=
fig_sell_fits
.
add_subplot
(
111
)
axs
.
set_title
(
"Sellmeier fits"
)
axs
.
set_xlabel
(
'Wavelength [nm]'
)
if
measurementfile
==
True
:
print
(
insitu_file
)
crtt_array
=
dict_to_narray
(
crtt_data
)
...
...
@@ -1009,11 +1015,17 @@ if __name__ == "__main__":
t
=
crtt_array
[
"temp"
]
tangent_array
,
temperature_array
,
result_line
=
analyze_plot
(
insitu_file
,
analyse_single
,
x
,
y
,
name
,
tolerance
,
use_itu_channels
,
ref_name
,
fixed_itu_channel
,
tangent_array
,
temperature_array
)
tangent_array
,
temperature_array
,
sellmeier_fit
,
result_line
=
analyze_plot
(
insitu_file
,
analyse_single
,
x
,
y
,
name
,
tolerance
,
use_itu_channels
,
ref_name
,
fixed_itu_channel
,
tangent_array
,
temperature_array
)
if
not
(
analyse_single
):
numb_of_meas
=
numb_of_meas
+
1
result_file
.
write
(
result_line
)
fixed_lambda
=
itu_conv
.
itu_2_wavelength
(
fixed_itu_channel
)
axs
.
axvline
(
fixed_lambda
*
1e9
,
color
=
'red'
)
axs
.
plot
(
x
,
sellmeier_fit
)
plt
.
draw
()
# After scanning all files in a directory (i.e. not a single file)
# => add statistics:
if
not
(
analyse_single
):
...
...
@@ -1054,6 +1066,17 @@ if __name__ == "__main__":
t
=
temp_array
tangent_array
,
temperature_array
,
result_line
=
analyze_plot
(
insitu_file
,
analyse_single
,
x
,
y
,
name
,
tolerance
,
use_itu_channels
,
ref_name
,
fixed_itu_channel
,
tangent_array
,
temperature_array
)
tangent_array
,
temperature_array
,
sellmeier_fit
,
result_line
=
analyze_plot
(
insitu_file
,
analyse_single
,
x
,
y
,
name
,
tolerance
,
use_itu_channels
,
ref_name
,
fixed_itu_channel
,
tangent_array
,
temperature_array
)
result_file
.
write
(
"
\n
"
)
result_file
.
write
(
"Wavelength, Mean_CRTT, StdDev for CRTT per Averaged Wavelength for Reference setup
\n
"
)
for
i
in
range
(
len
(
x
)):
result_file
.
write
(
str
(
x
[
i
])
+
", "
+
str
(
ref_crtt_array
[
i
])
+
", "
+
str
(
ref_crtt_array_std
[
i
])
+
"
\n
"
)
result_file
.
write
(
"
\n
"
)
result_file
.
write
(
"Wavelength, Mean CRTT, StdDev for CRTT per Averaged Wavelength for Measurement setup
\n
"
)
for
i
in
range
(
len
(
x
)):
result_file
.
write
(
str
(
x
[
i
])
+
", "
+
str
(
crtt_array
[
i
])
+
", "
+
str
(
crtt_array_std
[
i
])
+
"
\n
"
)
sys
.
exit
()
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