A library to controlle the Thorlabs PAX1000 polarimeter
Project description
PAX1000-controller
Python wrapper for the Thorlabs PAX1000 polarimeter using ctypes and the official Thorlabs TLPAX DLL. It provides a minimal, direct interface for device initialization, configuration, and polarization measurements.
The creator of this package/repository is not affiliated with ThorLabs.
Features
- Automatic detection of connected PAX1000 devices
- Configuration of wavelength, scan rate, and measurement mode
- Single-shot polarization measurements
- Access to:
- Azimuth
- Ellipticity
- Full Stokes parameters (S0–S3)
- Degree of polarization (DoP)
- Degree of linear polarization (DoLP)
- Degree of circular polarization (DoCP)
Requirements
- Windows (64-bit)
- Python 3
- Thorlabs PAX1000 polarimeter
- Thorlabs VISA installation
- Thorlabs TLPAX DLL
Default DLL path used in the code:
C:\Program Files\IVI Foundation\VISA\Win64\Bin\TLPAX_64.dll
Python standard libraries used:
- ctypes
- time
- math
- copy
Installation
pip install pax1000_controller
Usage
Basic Example
from pax1000_controller import PAX1000
pax = PAX1000(wavelength=491e-9,
base_scan_rate=60,
measurement_mode=9,
dll_lib_path="C:\Program Files\IVI Foundation\VISA\Win64\Bin\TLPAX_64.dll")
data = pax.measure()
print(data)
pax.close()
Class: PAX1000
Constructor
PAX1000(wavelength=491e-9, scan_rate=60, measurement_mode=9, dll_lib_path="C:\Program Files\IVI Foundation\VISA\Win64\Bin\TLPAX_64.dll")
Parameters:
wavelength(float): Measurement wavelength in metersscan_rate(float): Scan rate in Hzmeasurement_mode(int): PAX1000 measurement modedll_lib_path(str): Path to the TLPAX_64.dll
The constructor:
- Searches for connected PAX1000 devices
- Connects to the first available device
- Applies the provided configuration
Measurement modes:
- 0 – IDLE, no acquisition
- 1 – H512, half rotation, 512-point FFT
- 2 – H1024, half rotation, 1024-point FFT
- 3 – H2048, half rotation, 2048-point FFT
- 4 – F512, full rotation, 512-point FFT
- 5 – F1024, full rotation, 1024-point FFT
- 6 – F2048, full rotation, 2048-point FFT
- 7 – D512, double rotation, 512-point FFT
- 8 – D1024, double rotation, 1024-point FFT
- 9 – D2048, double rotation, 2048-point FFT
measure()
Performs a single polarization measurement.
Returns:
{
"azimuth": float, # degrees
"ellipticity": float, # degrees
"S0": float,
"S1": float,
"S2": float,
"S3": float,
"dop": float, # degree of polarization
"dolp": float, # degree of linear polarization
"docp": float # degree of circular polarization
}
close()
Closes the connection to the device and releases all resources.
pax.close()
Exceptions
-
DeviceNotFound
Raised if no PAX1000 device is detected. -
InitialisationError
Raised if device initialization fails.
Notes
- Only the first detected PAX1000 device is used.
- Returned values are deep-copied to avoid side effects from reused ctypes objects.
- Based on the official Thorlabs ctypes example, adapted for Python 3.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pax1000_controller-0.0.2.tar.gz.
File metadata
- Download URL: pax1000_controller-0.0.2.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3d2c29c6aa70d3eaa940837aab4c5cbcbd2457aafdf388f878b1b8acbbc53e5
|
|
| MD5 |
696032ed1f31231ae0feb91312488e26
|
|
| BLAKE2b-256 |
afb10def4b6bcb2cf33220ac7dc16e03d0a959fca100122e961d4f4f5eac052e
|
File details
Details for the file pax1000_controller-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pax1000_controller-0.0.2-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7ebd8b071ac8b2517f19fe0af09e7546f3b6090c9d40087fc8d6e2ffef91b52
|
|
| MD5 |
5d7746e3c1ab6876a8a375494ce8cc11
|
|
| BLAKE2b-256 |
d6d7a6e01062fe21548c9fdab7a9402960719a323b86856175eec99a0f9c73a6
|