Index
pychilaslasers.laser_components
Laser hardware components package.
This package provides classes for controlling and interfacing with various laser hardware components including diode, TEC and heating elements. It offers both low-level component access and high-level abstractions for laser control operations.
Modules:
-
LaserComponent
–Base class for all laser hardware components
-
Diode
–Laser diode control and monitoring
-
TEC
–Temperature control functionality
-
heaters
–Phase section, ring heaters, and tunable coupler
Authors: SDU
Classes
Diode(laser: Laser)
Bases: LaserComponent
Laser diode component for current control.
Parameters:
-
laser
(Laser
) –The laser instance to control.
Attributes:
-
state
(bool
) –The current on/off state of the laser diode.
-
current
(float
) –The drive current level in milliamps.
-
value
(float
) –Alias for the drive current (inherited from LaserComponent).
-
min_value
(float
) –Minimum current (always 0.0 mA).
-
max_value
(float
) –Maximum current.
-
unit
(str
) –Current unit (mA).
Sets up the laser diode component by querying the hardware for its maximum current and configuring the component with appropriate current range and units.
Parameters:
-
laser
(Laser
) –The laser instance to control.
Source code in src/pychilaslasers/laser_components/diode.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
Attributes
state: bool
property
writable
Get the current on/off state of the laser diode.
Returns:
-
bool
–True if the laser diode is ON, False if OFF.
current: float
property
writable
Returns the current drive current in milliamps.
Returns:
-
float
–The current drive current in milliamps.
value: float
property
writable
Get the current drive current value.
Alias for the current
property to implement the LaserComponent interface.
Returns:
-
float
–The current drive current in milliamps.
Functions
get_value() -> float
Alias for the value
property getter.
Returns:
-
float
–The current drive current in milliamps.
Source code in src/pychilaslasers/laser_components/diode.py
110 111 112 113 114 115 116 117 |
|
set_value(val: float) -> None
Alias for the value
property setter.
Parameters:
-
val
(float
) –The desired drive current in milliamps.
Raises:
-
ValueError
–If current is not a number or is outside the valid range.
Source code in src/pychilaslasers/laser_components/diode.py
119 120 121 122 123 124 125 126 127 128 129 |
|
get_current() -> float
Alias for the current
property getter.
Returns:
-
float
–The current drive current in milliamps.
Source code in src/pychilaslasers/laser_components/diode.py
131 132 133 134 135 136 137 138 |
|
set_current(current_ma: float) -> None
Alias for the current
property setter.
Parameters:
-
current_ma
(float
) –The desired drive current in milliamps.
Raises:
-
ValueError
–If current is not a number or is outside the valid range.
Source code in src/pychilaslasers/laser_components/diode.py
140 141 142 143 144 145 146 147 148 149 150 |
|
turn_on() -> None
Turn the laser diode ON.
Alias for setting state
to True.
Source code in src/pychilaslasers/laser_components/diode.py
152 153 154 155 156 157 |
|
turn_off() -> None
Turn the laser diode OFF.
Alias for setting state
to False.
Source code in src/pychilaslasers/laser_components/diode.py
159 160 161 162 163 164 |
|
Heater(laser: Laser)
Bases: LaserComponent
Base class for laser heater components.
Provides common functionality for all heater types including value setting and channel management.
Attributes:
-
channel
(HeaterChannel
) –The heater channel identifier.
-
value
(float
) –The current heater drive value.
-
min_value
(float
) –Minimum heater value.
-
max_value
(float
) –Maximum heater value.
-
unit
(str
) –Heater value unit.
Sets up the heater with its operating limits and units by querying the laser hardware.
Parameters:
-
laser
(Laser
) –The laser instance to control.
Source code in src/pychilaslasers/laser_components/heaters/heaters.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
Attributes
channel: HeaterChannel
abstractmethod
property
Get the heater channel identifier.
Must be implemented by subclasses to specify which heater channel this component controls.
Returns:
-
HeaterChannel
–The channel identifier for this heater.
value: float
property
writable
Get the current heater drive value.
Returns:
-
float
–The current heater drive value.
Functions
get_value() -> float
Alias for the value
property getter.
Returns:
-
float
–The current heater drive value.
Source code in src/pychilaslasers/laser_components/heaters/heaters.py
110 111 112 113 114 115 116 117 |
|
set_value(value: float) -> None
Alias for the value
property setter.
Parameters:
-
value
(float
) –The heater drive value to set.
Raises:
-
ValueError
–If value is not a number or outside valid range.
Source code in src/pychilaslasers/laser_components/heaters/heaters.py
119 120 121 122 123 124 125 126 127 128 129 |
|
LargeRing(laser: Laser)
Bases: Heater
Large ring heater component.
Source code in src/pychilaslasers/laser_components/heaters/heaters.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
Attributes
channel: HeaterChannel
property
Get the large ring channel.
PhaseSection(laser: Laser)
Bases: Heater
Phase section heater component.
Source code in src/pychilaslasers/laser_components/heaters/heaters.py
162 163 164 165 166 167 168 169 |
|
Attributes
anti_hyst: bool
property
writable
Get the anti-hysteresis flag.
channel: HeaterChannel
property
Get the phase section channel.
Functions
SmallRing(laser: Laser)
Bases: Heater
Small ring heater component.
Source code in src/pychilaslasers/laser_components/heaters/heaters.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
Attributes
channel: HeaterChannel
property
Get the small ring channel.
TunableCoupler(laser: Laser)
Bases: Heater
Tunable coupler heater component.
Source code in src/pychilaslasers/laser_components/heaters/heaters.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
Attributes
channel: HeaterChannel
property
Get the tunable coupler channel.
LaserComponent(laser: Laser)
Bases: ABC
Abstract base class for all laser hardware components.
This class defines the common interface that all laser components must implement. It provides standardized access to component values, operating ranges, and units of measurement.
Attributes:
-
value
(float
) –The current value of the component (implementation-dependent).
-
min_value
(float
) –The minimum allowable value for this component.
-
max_value
(float
) –The maximum allowable value for this component.
-
unit
(str
) –The unit of measurement for this component's values.
Note
Subclasses should initialize self._min, self._max and self._unit during construction.
Source code in src/pychilaslasers/laser_components/laser_component.py
47 48 49 |
|
Attributes
value: float
abstractmethod
property
Returns the current value of the component in appropriate units.
min_value: float
property
Returns the minimum value that can be safely set for this component.
max_value: float
property
Returns the maximum value that can be safely set for this component.
unit: str
property
Returns the unit string (e.g., "mA", "°C", "V") for this component.
TEC(laser: Laser)
Bases: LaserComponent
Temperature control component for laser thermal management.
This component automatically retrieves its operating range limits from the laser hardware and provides input validation.
Attributes:
-
target
(float
) –The target temperature in Celsius.
-
temp
(float
) –The current measured temperature in Celsius.
-
value
(float
) –Alias for the current temperature (inherited from LaserComponent).
-
min_value
(float
) –Minimum allowable temperature target.
-
max_value
(float
) –Maximum allowable temperature target.
-
unit
(str
) –Temperature unit (Celsius).
Sets up the component by querying the laser hardware for its temperature operating limits and configuring the component with appropriate units and ranges.
Parameters:
-
laser
(Laser
) –The laser instance to control.
Source code in src/pychilaslasers/laser_components/tec.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
Attributes
target: float
property
writable
Get the current target temperature in Celsius.
temp: float
property
Get the current measured temperature reading in Celsius.
value: float
property
Get the current temperature value.
Note
This is an alias for the temp
property.
Functions
get_value() -> float
Return the current measured temperature in Celsius.
Returns:
-
float
–The current measured temperature in Celsius.
Source code in src/pychilaslasers/laser_components/tec.py
100 101 102 103 104 105 106 107 |
|
set_value(val: float) -> None
Set the target temperature of the TEC.
Parameters:
-
val
(float
) –The desired target temperature in Celsius.
Raises:
-
ValueError
–If target is not a number or is outside the valid range.
Source code in src/pychilaslasers/laser_components/tec.py
109 110 111 112 113 114 115 116 117 118 119 |
|
get_temp() -> float
Return the current measured temperature in Celsius.
Returns:
-
float
–The current measured temperature in Celsius.
Source code in src/pychilaslasers/laser_components/tec.py
121 122 123 124 125 126 127 128 |
|
get_target_temp() -> float
Return the current target temperature in Celsius.
Returns:
-
float
–The current target temperature in Celsius.
Source code in src/pychilaslasers/laser_components/tec.py
130 131 132 133 134 135 136 137 |
|
set_target(target: float) -> None
Set the target temperature of the TEC.
Parameters:
-
target
(float
) –The desired target temperature in Celsius.
Raises:
-
ValueError
–If target is not a number or is outside the valid range.
Source code in src/pychilaslasers/laser_components/tec.py
139 140 141 142 143 144 145 146 147 148 149 |
|