catalight.equipment.light_sources.template.Template_Laser

class catalight.equipment.light_sources.template.Template_Laser

Bases: object

Vi

__init__()

Methods

__init__()

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_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

P_set

Current laser setpoint

bandwidth_range

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

is_tunable

Defines whether laser class is tunable.

wavelength_range

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

is_busy

Used to block access from multiple threads

property P_set

Current laser setpoint

property bandwidth_range

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

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.

Type:

bool

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_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