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
9a06dddb
Commit
9a06dddb
authored
Apr 05, 2018
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added alpha to alpha_SPEC format function in case non SPEC format alpha is read from file
parent
b8416829
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
pps_diff.py
sw/insitu_alpha/pps_diff.py
+21
-2
No files found.
sw/insitu_alpha/pps_diff.py
View file @
9a06dddb
...
...
@@ -303,6 +303,23 @@ def delta_delay(scope, num_avg = 1):
return
############################################################################
def
spec_alpha
(
alpha
):
"""
returns the value of alpha as it is used by the SPEC
(see also White Rabbit Calibration procudeure:
http://www.ohwr.org/attachments/4092/WR_Calibration-v1.1-20151109.pdf
equation 11.
alpha -- <float> alpha value
returns:
alpha -- <float> alpha according to SPEC
"""
return
(
2
**
40
*
(((
alpha
+
1
)
/
(
alpha
+
2
))
-
0.5
))
############################################################################
def
file_to_array
(
filename
):
"""
...
...
@@ -315,7 +332,7 @@ def file_to_array(filename):
[itu-ch, SPEC_alpha_3wl],
:
False
"Not a Del
at
Delay file"
"Not a Del
ta
Delay file"
"""
# create empty list
...
...
@@ -338,7 +355,9 @@ def file_to_array(filename):
# Values of interest on one line are:
# # lambda-1[nm], ITU-ch, SPEC_alpha_3wl(lambda-1)
pair
=
float
(
line_lst
[
1
]),
float
(
line_lst
[
2
])
# pair = float(line_lst[1]),float(line_lst[2])
# # lambda-1[nm], ITU-ch, alpha_sel(lambda-1)
pair
=
float
(
line_lst
[
1
]),
int
(
round
(
spec_alpha
(
float
(
line_lst
[
2
]))))
pairs
.
append
(
pair
)
arr_pair
=
numpy
.
array
(
pairs
)
...
...
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