Commit 9a06dddb authored by Peter Jansweijer's avatar Peter Jansweijer

added alpha to alpha_SPEC format function in case non SPEC format alpha is read from file

parent b8416829
......@@ -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 Delat Delay file"
"Not a Delta 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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment