Python library for the Artifex Engineering OPM150
Project description
pyopm150
Python library for the Artifex Engineering OPM150
Installation
Install via pip:
pip install pyopm150
Install manually:
git clone https://github.com/artifex-engineering/pyopm150.git
cd pyopm150
pip install .
Usage
from pyopm150 import OPM150, GAIN, UNITS
# List all available devices
devices = OPM150.find_devices() # Get all available devices
print("Available Devices: {}\n\n".format(", ".join(devices) if len(devices) > 0 else "None"))
# Create OPM150 instance
opm = OPM150()
# Connect to first OPM150 device in list
opm.connect(devices[0])
# Set wavelength
opm.opm_set_wavelength(660)
# Set gain
opm.opm_set_gain(GAIN.X1)
# Set unit to use in measurements
opm.set_unit(UNITS.MICROAMPERE)
# Print single measurement
print(format(opm.opm_get_measurement(), '.8f'))
opm.disconnect()
Query current states and device informations
print("Firmware version: {}".format(opm.opm_firmware_version))
print("Serial number: {}".format(opm.opm_serial_number))
print("Date of manufacturing: {}".format(opm.opm_date_of_manufacturing))
print("OPM150 is 100 kHz: {}\n\n".format(opm.opm_is_100khz))
print("Detector serial number: {}".format(opm.opm_detector_serial))
print("Detector min wavelength: {}".format(opm.opm_detector_min_wavelength))
print("Detector max wavelength: {}".format(opm.opm_detector_max_wavelength))
print("Detector is integrating sphere: {}\n\n".format(opm._opm_detector_is_integrating_sphere))
print("Device info:\n{}\n\n".format(opm.opm_get_info()))
print("Current wavelength: {}".format(opm.opm_get_wavelength()))
print("Current gain: {}".format(opm.opm_get_gain()))
print("Current Unit: {}".format(opm.unit))
print("Current filter factor: {}\n\n".format(opm.filter))
nW/cm², µW/cm², mW/cm², W/cm²
opm.set_unit(UNITS.MICROWATTS_PER_SQUARE_CENTIMETER) # Set unit to use in measurements
opm.aperture_in_mm = 7.0 # Set aperture in mm
print("Current Aperture in mm: {}".format(opm.aperture_in_mm)) # Print aperture in mm
measurement_value = opm.opm_get_measurement() # Get measurement value in specified unit
print("Measurement Value: {}{}".format(measurement_value[0], measurement_value[1])) # measurement value in specified unit
Available Units
- Nanoampere (nA): UNITS.NANOAMPERE
- Microampere (µA): UNITS.MICROAMPERE
- Milliampere (mA): UNITS.MILLIAMPERE
- Ampere (A): UNITS.AMPERE
- Nanowatts (nW): UNITS.NANOWATTS
- Microwatts (µW): UNITS.MICROWATTS
- Milliwatts (mW): UNITS.MILLIWATTS
- Watts (W): UNITS.WATTS
- Nanowatts per square centimeter (nW/cm²): UNITS.NANOWATTS_PER_SQUARE_CENTIMETER
- Microwatts per square centimeter (µW/cm²): UNITS.MICROWATTS_PER_SQUARE_CENTIMETER
- Milliwatts per square centimeter (mW/cm²): UNITS.MILLIWATTS_PER_SQUARE_CENTIMETER
- Watts per square centimeter (W/cm²): UNITS.WATTS_PER_SQUARE_CENTIMETER
- Decibel-milliwatts (dBm): UNITS.DECIBEL_MILLIWATTS
Gain levels:
- x1: GAIN.X1
- x10: GAIN.X10
- x100: GAIN.X100
- x1000: GAIN.X1000
- x10000: GAIN.X10000
- Auto: GAIN.AUTO
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
pyopm150-1.0.1.tar.gz
(8.9 kB
view details)
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 pyopm150-1.0.1.tar.gz.
File metadata
- Download URL: pyopm150-1.0.1.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed844925611f39ffbe5513de870faac848d556ab0fe14b5902fa8b0ac5767517
|
|
| MD5 |
200b7fea8e4907b2ab7527fadf479033
|
|
| BLAKE2b-256 |
5468b70d46afa05d951478c52b65cbabeafad59b6c9638de8191f09bfa4b06c3
|
File details
Details for the file pyopm150-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pyopm150-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf61a6d15538d490f6e0385548bfdc41ebeb8bbec1c674298365fce81a972b06
|
|
| MD5 |
4dad88f6d55097a69bcbbf9e95ecb604
|
|
| BLAKE2b-256 |
1683a91ebd7c8c2b758264cdca728d8462b66a3459f5ab38c6c0d653c09c16ef
|