Skip to content
Snippets Groups Projects
Commit ac69b994 authored by Laurent Mercadier's avatar Laurent Mercadier
Browse files

simplified positionToDelay function

parent 7563f222
No related branches found
No related tags found
1 merge request!44Pos to delay
def positionToDelay(data, key, origin=0, invert = False, reflections=1): def positionToDelay(pos, origin=0, invert = False, reflections=1):
''' converts a motor position in mm into optical delay in picosecond ''' converts a motor position in mm into optical delay in picosecond
Inputs: Inputs:
data: dataset containing delay stage motor position pos: array-like delay stage motor position
key: key of the delay stage
origin: motor position of time zero in mm origin: motor position of time zero in mm
invert: bool, inverts the sign of delay if True invert: bool, inverts the sign of delay if True
reflections: number of bounces in the delay stage reflections: number of bounces in the delay stage
...@@ -12,7 +11,7 @@ def positionToDelay(data, key, origin=0, invert = False, reflections=1): ...@@ -12,7 +11,7 @@ def positionToDelay(data, key, origin=0, invert = False, reflections=1):
''' '''
c_ = 299792458 *1e-9 # speed of light in mm/ps c_ = 299792458 *1e-9 # speed of light in mm/ps
x = -1 if invert else 1 x = -1 if invert else 1
return 2*reflections*(data[key]-origin)*x/c_ return 2*reflections*(pos-origin)*x/c_
def degToRelPower(x, theta0=0): def degToRelPower(x, theta0=0):
''' converts a half-wave plate position in degrees into relative power ''' converts a half-wave plate position in degrees into relative power
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment