Skip to main content

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 import PAX1000

pax = PAX1000(
    wavelength=491e-9,
    scan_rate=60,
    measurement_mode=9
)

data = pax.measure()
print(data)

pax.close()

Class: PAX1000

Constructor

PAX1000(wavelength=491e-9, scan_rate=60, measurement_mode=9)

Parameters:

  • wavelength (float): Measurement wavelength in meters
  • scan_rate (float): Scan rate in Hz
  • measurement_mode (int): PAX1000 measurement mode

The constructor:

  • Searches for connected PAX1000 devices
  • Connects to the first available device
  • Applies the provided configuration

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pax1000_controller-0.0.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pax1000_controller-0.0.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file pax1000_controller-0.0.1.tar.gz.

File metadata

  • Download URL: pax1000_controller-0.0.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pax1000_controller-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8f746cc735b87d6c61a1f9d9e1371620b3c41b8cbdd14ac9bb7be3bffb2c53de
MD5 fba2280023004dfee2ba1755bf203e92
BLAKE2b-256 2b70e252ffb54a8a8565b993c9018a888f4bc978d296455ed1299e0630e97bbc

See more details on using hashes here.

File details

Details for the file pax1000_controller-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pax1000_controller-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee25f00c16c4fb87a46397d448df6ac7f68defdadca32245ee2057a3edbfb184
MD5 16e969b3a151c815d078b839305aea65
BLAKE2b-256 6c0b7c1a418485acb5cf8c3e420b13aba713750cbd65c329b97945f6c577ef34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page