Overview
This package can be used to drive a PM100A/D power meter from Thorlabs. It provides an object oriented interface to the SCPI commands using Python properties.
Installation
To install the ThorlabsPM100 driver, download the package and run the command:
python setup.py install
You can also directly move the ThorlabsPM100 to a location that Python can import from (directory in which scripts using ThorlabsPM100 are run, etc.)
Usage
The best way to connect your instrument is with the pyvisa package https://pyvisa.readthedocs.io/en/stable/. On linux, the instrument is automatically detected as a USBTMC device. A simple interface is described in the file usbtmc.py
First you need to create your instrument. Using visa:
import visa
from ThorlabsPM100 import ThorlabsPM100
rm = visa.ResourceManager()
inst = rm.open_resource('USB0::0x0000::0x0000::xxxxxxxxx::INSTR',
term_chars='\n', timeout=1)
power_meter = ThorlabsPM100(inst=inst)
Or using usbtmc (you nedd to have read and write access to the ‘/dev/usbtmc0’):
from ThorlabsPM100 import ThorlabsPM100, USBTMC inst = USBTMC(device="/dev/usbtmc0") power_meter = ThorlabsPM100(inst=inst)
Commands that set or query a value are Python properties of ThorlabsPM100 class. Other command are methods of ThorlabsPM100 class
print power_meter.read # Read-only property print power_meter.sense.average.count # read property power_meter.sense.average.count = 10 # write property power_meter.system.beeper.immediate() # method
Contact
Please send bug reports or feedback to Pierre Cladé.
Vesrion History
1.2.1 : change ‘ask’ to ‘query’
1.1.1 and 1.1.2 : small bug corrections
1.1 : support of Python 3 with 2to3
1.0 : initial release
Documentation
Detailed information about the Thorlabs PM100 driver can be found on the main web site
Source code available on github.
Metadata
Release files for ThorlabsPM100 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ThorlabsPM100-1.2.2.tar.gz | 11.3 kB | Without provenance | Details |
Release files / ThorlabsPM100-1.2.2.tar.gz
| Download URL | ThorlabsPM100-1.2.2.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
881cec8149b17c77d4af0097ee3fdb40eaeb618c876d49f1bc42c87611737967
|
|
BLAKE2b-256 checksum How to use checksums |
0a5eef1769d291e959d19bd8a5a488e899897ff1f657eca39fe8db872fa691dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/20.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Security for ThorlabsPM100 1.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.