def test(self): current_path = os.getcwd() bitstreams_path = os.path.join(current_path, 'bitstreams') host = os.getenv('HOST', '192.168.1.100') client = KClient(host) assert client.is_connected ssh = ZynqSSH(host, 'koheron') ssh.load_pl(os.path.join(bitstreams_path, 'oscillo.bit')) driver = Oscillo(client, current_mode='pwm') current = 30 #mA driver.set_laser_current(current) driver.start_laser() assert driver.get_laser_power() > 400
from lase.core import KClient # Driver to use from lase.drivers import Oscillo # Modules to import import numpy as np import matplotlib.pyplot as plt import time # Connect to Lase host = '192.168.1.4' # Lase IP address client = KClient(host) driver = Oscillo(client) # Replace with appropriate driver # Enable laser driver.start_laser() # Set laser current current = 15 #mA driver.set_laser_current(current) # Modulation on DAC amp_mod = 0.2 freq_mod = 1e6 driver.dac[1,:] = amp_mod*np.sin(2*np.pi*freq_mod*driver.sampling.t) driver.set_dac() # Signal on ADC
#!/usr/bin/env python # -*- coding: utf-8 -*- import initExample from lase.core import KClient from lase.drivers import Oscillo import matplotlib.pyplot as plt import time # Connect to Lase host = '192.168.1.12' client = KClient(host) driver = Oscillo(client) # Enable laser driver.start_laser() laser_current = [0, 5, 10, 15, 20, 25, 30, 35, 40] #mA laser_power = [] for current in laser_current: driver.set_laser_current(current) time.sleep(0.1) laser_power.append(driver.get_laser_power()) plt.plot(laser_current, laser_power) plt.xlabel('Laser current (mA)') plt.ylabel('Laser power (u.a.)') plt.show()