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

Adds function to convert a delay stage motor position into time

parent 8dbf69dd
No related branches found
No related tags found
1 merge request!44Pos to delay
def positionToDelay(data, key, origin=0, invert = False, reflections=1):
''' converts a motor position in mm into optical delay in picosecond
Inputs:
data: dataset containing delay stage motor position
key: key of the delay stage
origin: motor position of time zero in mm
invert: bool, inverts the sign of delay if True
reflections: number of bounces in the delay stage
Output:
delay in picosecond
'''
c_ = 299792458 *1e-9 # speed of light in mm/ps
x = -1 if invert else 1
return 2*reflections*(data[key]-origin)*x/c_
\ No newline at end of file
......@@ -2,3 +2,4 @@ from ToolBox.Load import *
from ToolBox.xgm import *
from ToolBox.XAS import *
from ToolBox.knife_edge import *
from ToolBox.Laser_utils import *
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