hardware_interfaces.polarizer module¶
-
class
Polarizer(device_name: str, channel: str, waiting_time: float = 500, default_position: bool = False, parallel_electrical_state: bool = True, name: str = 'XYZ Polarizer')[source]¶ Bases:
objectThis class can be used to change polarization of a polarizer from parallel to perpendicular by applying 5V or 0V to their inputs.
It is assumed that a National Instruments nidaqmx capable device is used to provide the output voltage. For this a digital output port is used. By default, applying 5V means parallel polarization, while perpendicular polarization implies 0 V. The time it takes for a polarizer to rotate is around 10 ms. Waiting 500 ms should be enough to ensure that the process of rotating finishes.
- Parameters
device_name (str) –
Name of device on which the appropriate voltage-out port is located. The name can be found and configured in the National Instruments Software: ‘Measurement and Automation Explorer’ (MAX). The device name should also be displayed in a pop-up when plugging in the device.
E.g.: “Dev0”, “Dev1” etc.
channel (str) –
Name of channel, that is used to send signal.
E.g.: “do0”, “do1”, “PFI0”, “PFI1” etc.
waiting_time (float, optional) – Time in milliseconds to wait for the polarizer to turn. Defaults to 50 ms.
default_position (bool, optional) – Set to True if default state is parallel. Set to False if default state is perpendicular. Defaults to False.
parallel_electrical_state (bool, optional) – Set to True if to set parallel polarization a digital high signal (5V) needs to be sent. Set to False if to set parallel polarization polarizer a digital low (0V) needs to be applied. Defaults to True.
name (str, optional) – Name / Identifier to give to this polarizer. This is relevant for log statements, especially when there is more than one polarizer in the setup. Defaults to “XYZ polarizer”.
-
task¶ Represents a DAQmx Task object, through which all communication with device is managed.
- Type
object
-
current_position¶ True when polarizer is parallel. False when polarizer is perpendicular.
- Type
bool
-
channel¶ DAQmx channel object representing the output channel.
- Type
object
References
-
set_parallel()[source]¶ Sets polarizer to parallel polarization. Then waits for specified waiting time.