This Thorlabs Polarimeter can be controlled via USB using SCPI communication protocol.
pip install pyvisa
Below we show an example showing how to use pyvisa to obtain data from your polarimeter.
import math
from tlpax import TLPAX
def main():
# Create an instance of the ThorlabsPAX1000 class
resource_name = "USB0::0x1313::0x8031::M00547469::0::INSTR"
polarimeter = TLPAX(resource_name)
# Identify Thorlabs PAX1000
print(polarimeter.identify()) # Expected return is 'THORLABS,PAX1000IR2/M,M00547469,1.0.3'
# Set measurement mode to 9 and enable waveplate rotation
polarimeter.set_averaging_mode(9)
polarimeter.set_waveplate_rotation_state("ON")
# Get measurement
message = polarimeter.get_latest_primary_measurement_data()
message = list(map(float, message.split(',')))
# Convert data to conventional units
mode = message[2]
az = message[9] * 180 / math.pi # in °
ellip = message[10] * 180 / math.pi # in °
DOP = message[11] * 100 # in %
P = message[12] * 1e3 # in mW
print(f"Mode: {mode}\naz: {az}\nellip: {ellip}\nDOP: {DOP}\nP: {P}")
# Compute normalized Stokes parameters
Psi = message[9]
Chi = message[10]
S1 = math.cos(2 * Psi) * math.cos(2 * Chi) # normalized S1
S2 = math.sin(2 * Psi) * math.cos(2 * Chi) # normalized S2
S3 = math.sin(2 * Chi) # normalized S3
print(f"S1: {S1}\nS2: {S2}\nS3: {S3}")
# Disconnect the device
polarimeter.disconnect()
if __name__ == "__main__":
main()
This example code does the following:
This script uses the ThorlabsPAX1000 class to interact with the Thorlabs PAX1000 polarimeter.
Please look up the tutorials section on how to identify the resource_name
.