You are reading the documentation for the main branch, which may contain unreleased changes. The most recent release is v0.1.0.
pnpq.devices.polarization_controller_thorlabs_mpc module#
- class pnpq.devices.polarization_controller_thorlabs_mpc.AbstractPolarizationControllerThorlabsMPC#
Bases:
ABC- abstractmethod get_params()#
Get the parameters of the device represented by this instance.
- Returns:
The set of parameters in a dictionary.
- Return type:
- abstractmethod get_status(chan_ident)#
Fetch the status of a single channel.
- Parameters:
chan_ident (ChanIdent) – The motor channel to fetch status for.
- Returns:
The message returned by the device.
- Return type:
- abstractmethod get_status_all()#
Fetch the latest status of all channels on the device.
- Returns:
A tuple of updates, one for each channel.
- Return type:
tuple[AptMessage_MGMSG_MOT_GET_USTATUSUPDATE, …]
- abstractmethod home(chan_ident)#
Move the device to home position.
The home position can be customized using the
set_params()function.- Parameters:
chan_ident (ChanIdent) – The motor channel to set to home.
- Return type:
None
- abstractmethod identify(chan_ident)#
Identifies the device represented by this instance by flashing the LED light on the device.
- Parameters:
chan_ident (ChanIdent) – The motor channel to identify.
- Return type:
None
- abstractmethod jog(chan_ident, jog_direction)#
Jogs the device forward or backwards in small steps. Experimentally, jog steps of 50 or greater seem to work the best.
The specific number of steps per jog can be set via the
set_params()function.- Parameters:
chan_ident (ChanIdent) – The motor channel to jog.
jog_direction (JogDirection) – The direction the paddle should move in.
- Return type:
None
- abstractmethod move_absolute(chan_ident, position)#
Move the device to an absolute position.
- Parameters:
chan_ident (ChanIdent) – The motor channel to move.
position (Quantity) – The angle to move the device. The unit must be in
mpc320_stepor in a compatible angle unit. The move position must be within 0 and 170 degrees (or equivalent).
- Return type:
None
- abstractmethod set_channel_enabled(chan_ident, enabled)#
Enables or disables the specified motor channel. End users will not typically use this command. Instead, commands that require a channel to be enabled will automatically enable the channel before executing, and disable the channel when complete.
- Parameters:
chan_ident (ChanIdent) – The motor channel to enable.
enabled (bool) – Set to
Trueto enable the channel, orFalseto disable.
- Return type:
None
- abstractmethod set_params(velocity=None, home_position=None, jog_step_1=None, jog_step_2=None, jog_step_3=None)#
Update the parameters of the device.
All parameters of this function are optional. Only fields with values are updated on the device.
- Parameters:
velocity (None | Quantity) – The rotational velocity. Applies to all channels. Unit must be convertible to
mpc320_velocity.home_position (None | Quantity) – The position where the device will move to when the
home()function is called. Unit must be convertible tompc320_step.jog_step_1 (None | Quantity) – The amount which the jog function will move for channel 1. Unit must be convertible to
mpc320_step.jog_step_2 (None | Quantity) – The amount which the jog function will move for channel 2. Unit must be convertible to
mpc320_step.jog_step_3 (None | Quantity) – The amount which the jog function will move for channel 3. Unit must be convertible to
mpc320_step.
- Return type:
None
- class pnpq.devices.polarization_controller_thorlabs_mpc.PolarizationControllerParams(*args, **kwargs)#
Bases:
UserDict[str,Quantity]- Parameters:
args (Any)
kwargs (Any)
- class pnpq.devices.polarization_controller_thorlabs_mpc.PolarizationControllerThorlabsMPC(*, connection: pnpq.apt.connection.AbstractAptConnection, available_channels: frozenset[pnpq.apt.protocol.ChanIdent] = frozenset())#
Bases:
AbstractPolarizationControllerThorlabsMPC- Parameters:
connection (AbstractAptConnection)
available_channels (frozenset[ChanIdent])
- connection: AbstractAptConnection#
- get_params()#
Get the parameters of the device represented by this instance.
- Returns:
The set of parameters in a dictionary.
- Return type:
- get_status(chan_ident)#
Fetch the status of a single channel.
- Parameters:
chan_ident (ChanIdent) – The motor channel to fetch status for.
- Returns:
The message returned by the device.
- Return type:
- get_status_all()#
Fetch the latest status of all channels on the device.
- Returns:
A tuple of updates, one for each channel.
- Return type:
tuple[AptMessage_MGMSG_MOT_GET_USTATUSUPDATE, …]
- home(chan_ident)#
Move the device to home position.
The home position can be customized using the
set_params()function.- Parameters:
chan_ident (ChanIdent) – The motor channel to set to home.
- Return type:
None
- identify(chan_ident)#
Identifies the device represented by this instance by flashing the LED light on the device.
- Parameters:
chan_ident (ChanIdent) – The motor channel to identify.
- Return type:
None
- jog(chan_ident, jog_direction)#
Jogs the device forward or backwards in small steps. Experimentally, jog steps of 50 or greater seem to work the best.
The specific number of steps per jog can be set via the
set_params()function.- Parameters:
chan_ident (ChanIdent) – The motor channel to jog.
jog_direction (JogDirection) – The direction the paddle should move in.
- Return type:
None
- log = <BoundLoggerLazyProxy(logger=None, wrapper_class=None, processors=None, context_class=None, initial_values={}, logger_factory_args=())>#
- move_absolute(chan_ident, position)#
Move the device to an absolute position.
- Parameters:
chan_ident (ChanIdent) – The motor channel to move.
position (Quantity) – The angle to move the device. The unit must be in
mpc320_stepor in a compatible angle unit. The move position must be within 0 and 170 degrees (or equivalent).
- Return type:
None
- set_channel_enabled(chan_ident, enabled)#
Enables or disables the specified motor channel. End users will not typically use this command. Instead, commands that require a channel to be enabled will automatically enable the channel before executing, and disable the channel when complete.
- Parameters:
chan_ident (ChanIdent) – The motor channel to enable.
enabled (bool) – Set to
Trueto enable the channel, orFalseto disable.
- Return type:
None
- set_params(velocity=None, home_position=None, jog_step_1=None, jog_step_2=None, jog_step_3=None)#
Update the parameters of the device.
All parameters of this function are optional. Only fields with values are updated on the device.
- Parameters:
velocity (None | Quantity) – The rotational velocity. Applies to all channels. Unit must be convertible to
mpc320_velocity.home_position (None | Quantity) – The position where the device will move to when the
home()function is called. Unit must be convertible tompc320_step.jog_step_1 (None | Quantity) – The amount which the jog function will move for channel 1. Unit must be convertible to
mpc320_step.jog_step_2 (None | Quantity) – The amount which the jog function will move for channel 2. Unit must be convertible to
mpc320_step.jog_step_3 (None | Quantity) – The amount which the jog function will move for channel 3. Unit must be convertible to
mpc320_step.
- Return type:
None
- class pnpq.devices.polarization_controller_thorlabs_mpc.PolarizationControllerThorlabsMPC220(*, connection: pnpq.apt.connection.AbstractAptConnection, available_channels: frozenset[pnpq.apt.protocol.ChanIdent] = frozenset({<ChanIdent.CHANNEL_1: 1>, <ChanIdent.CHANNEL_2: 2>}))#
Bases:
PolarizationControllerThorlabsMPC- Parameters:
connection (AbstractAptConnection)
available_channels (frozenset[ChanIdent])
- class pnpq.devices.polarization_controller_thorlabs_mpc.PolarizationControllerThorlabsMPC320(*, connection: pnpq.apt.connection.AbstractAptConnection, available_channels: frozenset[pnpq.apt.protocol.ChanIdent] = frozenset({<ChanIdent.CHANNEL_1: 1>, <ChanIdent.CHANNEL_2: 2>, <ChanIdent.CHANNEL_3: 4>}))#
Bases:
PolarizationControllerThorlabsMPC- Parameters:
connection (AbstractAptConnection)
available_channels (frozenset[ChanIdent])