diff --git a/Laser_utils.py b/Laser_utils.py index 157f387cf390107d52bf686ff7b5cbb05b0779ec..55e44a39839904268223b15df6cb537af77727e9 100644 --- a/Laser_utils.py +++ b/Laser_utils.py @@ -1,8 +1,7 @@ -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 Inputs: - data: dataset containing delay stage motor position - key: key of the delay stage + pos: array-like delay stage motor position 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 @@ -12,7 +11,7 @@ def positionToDelay(data, key, origin=0, invert = False, reflections=1): ''' c_ = 299792458 *1e-9 # speed of light in mm/ps 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): ''' converts a half-wave plate position in degrees into relative power