forked from dnanderson/polarizationOptimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestLaser.py
31 lines (25 loc) · 826 Bytes
/
testLaser.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from TSL550 import TSL550
import time
address = "COM4"
laser = TSL550.TSL550(address,baudrate=19200)
#laser.device.close()
#quit()
laser.on()
print(laser.printStatus())
lambda_start = 1550
lambda_stop = 1551
duration = 2
trigger_num_points = 1000
trigger_sweep_rate = 1000
trigger_step = (lambda_stop - lambda_start) / duration * (trigger_sweep_rate) * (1/trigger_num_points)
print(trigger_step)
print(laser.printStatus())
laser.closeShutter()
laser.sweep_set_mode(continuous=True, twoway=True, trigger=False, const_freq_step=False)
laser.trigger_enable_output()
print(laser.trigger_set_mode("Step"))
print(laser.trigger_set_step(0.001))
laser.sweep_wavelength(start=lambda_start,stop=lambda_stop,duration=duration,number=1)
time.sleep(5)
print(laser.wavelength_logging_number())
print(len(laser.wavelength_logging()))