catalight.equipment.light_sources.diode_control.Diode_Laser

class catalight.equipment.light_sources.diode_control.Diode_Laser

Bases: object

Virtual instance of diode laser.

Virtual object for interfacing with Thorlabs diode driver system via an MCC DAQ device. The DAQ board should be connected to the current control system via BNC cables. A voltage is supplied by the DAQ board to send a current from the current controller to the diode driver, thus emitting a specified power from the laser. The user must perform a calibration of the system prior to using this class!

__init__()

Methods

I_to_P(I)

converts a current to power based on read calibration

P_to_I(P)

Convert a power to current based on read calibration.

__init__()

get_output_current()

Convert DAQ voltage to current measurement.

get_output_power()

Get output power based on current measured and saved calibration.

log_power()

Append (date and current power setpoint) to the log at save_path.

print_output()

Print the output current and power to console.

read_calibration()

Update calibration attr based on module level calibration file.

set_current(I_set)

Set current output of controller.

set_power(P_set)

Send signal to DAQ to reach desired P_set value based on calibration.

shut_down()

Set power of laser to 0 by setting DAQ Voltage to 0.

start_logger([log_frequency, save_path])

Start the data log function to record the laser set point.

stop_logger()

Cancel timer initialized w/ start_logger() and delete it.

time_warning(time_left)

Play audio warning that laser will engage in time_left minutes.

update_calibration(slope, intercept)

Write calibration info to file.

Attributes

I_max

(mA) Max current

P_set

Current laser setpoint

ai_info

Analog input info

ai_range

Analog input range

ao_info

Analog output info

ao_range

Analog output range

bandwidth

Current bandwidth of laser, read-only

bandwidth_range

[min, max] Min/Max bandwidth of tunable laser, read-only

central_wavelength

Current wavelength of laser, read-only

daq_dev_info

DAQ info

is_tunable

Defines whether laser class is tunable.

k_mod

(mA/V) Conversion Factor

wavelength_range

[min, max] Min/Max wavelength of tunable laser, read-only

is_busy

Used to block access from multiple threads

board_num

Location of DAQ in "instacal" software.

property I_max

(mA) Max current

I_to_P(I)

converts a current to power based on read calibration

Parameters:

I (float) – Current you’d like to convert [mA]

Returns:

P – Power [mW]

Return type:

float

property P_set

Current laser setpoint

P_to_I(P)

Convert a power to current based on read calibration.

Parameters:

P (int or float) – Power you’d like to convert [mW]

Returns:

I – Equivalent current [mA]

Return type:

float

_I_max

(mA) Max current of current controller

_k_mod

(mA/V)

property ai_info

Analog input info

property ai_range

Analog input range

property ao_info

Analog output info

property ao_range

Analog output range

property bandwidth

Current bandwidth of laser, read-only

property bandwidth_range

[min, max] Min/Max bandwidth of tunable laser, read-only

board_num

Location of DAQ in “instacal” software.

property central_wavelength

Current wavelength of laser, read-only

property daq_dev_info

DAQ info

get_output_current()

Convert DAQ voltage to current measurement.

Returns:

Current measured by DAQ

Return type:

float or int

get_output_power()

Get output power based on current measured and saved calibration.

Returns:

P – Power [mW] rounded to 3 decimal points

Return type:

float or int

is_busy

Used to block access from multiple threads

is_tunable = False

Defines whether laser class is tunable. Diode is not.

Type:

bool

property k_mod

(mA/V) Conversion Factor

log_power()

Append (date and current power setpoint) to the log at save_path.

print_output()

Print the output current and power to console.

read_calibration()

Update calibration attr based on module level calibration file.

Also prints out calibration date and values to console.

set_current(I_set)

Set current output of controller.

Use this when running calibration. Reads warning messages when changing power

Parameters:

I_set (int or float) – Current setpoint to send to controller (mA)

set_power(P_set)

Send signal to DAQ to reach desired P_set value based on calibration.

The necessary current is sent based on a externally performed calibration. * Raises speaker volume * Sends voice warning * Prints time to complete ramp * ramps from current setpoint to P_set at 650 mA/min to avoid equipment damage * Redefined _P_set along the way, printing status at each step * Calls print_output() on completion

Parameters:

P_set (int or float) – Desired laser output power in mW

shut_down()

Set power of laser to 0 by setting DAQ Voltage to 0.

start_logger(log_frequency=0.1, save_path=None)

Start the data log function to record the laser set point.

Records constantly until stop_logger() is called. Creates self.timer and self.save_path when called.

Parameters:
  • log_frequency (float or int, optional) – (seconds) interval to record data with. The default is 0.1 sec.

  • save_path (str, optional) – Full tile path to save data to. If None, saves in module directory with file name ‘YYYYMMDDlaser_log.txt’. Appends int to end of file name if file name already exists.

stop_logger()

Cancel timer initialized w/ start_logger() and delete it.

time_warning(time_left)

Play audio warning that laser will engage in time_left minutes.

Parameters:

time_left (int or float) – (min) Time to read out until setting laser

update_calibration(slope, intercept)

Write calibration info to file.

Calibration file path is defined at module level on import. Also saves date of calibration. Overwrites previous calibration!

Parameters:
  • slope (float) – Slope of linear calibration (mW/mA)

  • intercept (float) – Y intercept of linear calibration (mA)

property wavelength_range

[min, max] Min/Max wavelength of tunable laser, read-only