25 lines
505 B
Python
Executable File
25 lines
505 B
Python
Executable File
#!/usr/bin/env python
|
|
import epics
|
|
from epics import caput
|
|
import numpy as np
|
|
|
|
# config
|
|
#STAGEpv = epics.PV('SLAAR11-LMOT-M452:MOTOR_1.VAL') # global globi
|
|
stagePV = epics.PV('SLAAR11-LMOT-M424:MOT.VAL')
|
|
|
|
c = 299792458
|
|
|
|
def mm2fs(d):
|
|
# d in mm, output in fs
|
|
return np.around(2*d*10**(-3)/c*10**15, decimals=5)
|
|
|
|
def fs2mm(t):
|
|
# t in fs, output in mm
|
|
return np.around(c*t/2*10**(-12), decimals=5)
|
|
|
|
t0 = 168.760
|
|
|
|
while True:
|
|
stagePV.put(t0 - fs2mm(200))
|
|
stagePV.put(t0 + fs2mm(500))
|