Skip to main content

pyopm150

License PyPI - Status PyPI - Version

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(660) # Initial wavelength

# 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
measurement = opm.opm_get_measurement()
print(f"{measurement[0]:.8f} {measurement[1]}")

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

Error Codes

  • PORT_NOT_OPEN: 1
  • NO_PORT_SELECTED: 2
  • CANNOT_OPEN_DEVICE: 3
  • PORT_ERROR: 4
  • COMMUNICATION_ERROR: 5
  • TIMEOUT: 6
  • NO_DETECTOR_CONNECTED: 7
  • NOT_ENOUGH_POWER: 8
  • INVALID_GAIN: 9
  • WAVELENGTH_OUT_OF_RANGE: 10
  • FAILED_TO_SET_WAVELENGTH: 11
  • FAILED_TO_SET_GAIN: 12
  • DEVICE_ALREADY_OPENED: 13

Release files for pyopm150 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyopm150 2.0.0
File Size Uploaded Provenance Actions
pyopm150-2.0.0.tar.gz 10.6 kB Without provenance Details for pyopm150-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyopm150 2.0.0
File Interpreter ABI Platform Actions
pyopm150-2.0.0-py3-none-any.whl Python 3 none any Details for pyopm150-2.0.0-py3-none-any.whl

Total release size: 20.3 kB

Release files / pyopm150-2.0.0.tar.gz

Download URL pyopm150-2.0.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d79029ba313bbf3922532c65b70f4d31ddc02453bbec151f4133399d61417cbb
BLAKE2b-256 checksum
How to use checksums
46d9c54497c8b47ebbc0f49e31487c1b688a713e30018284e35cbf4bd2018a6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / pyopm150-2.0.0-py3-none-any.whl

Download URL pyopm150-2.0.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95cc8926875a9448fbcb1ae28293381bbdd277e35e490e09c47675d3ee218a97
BLAKE2b-256 checksum
How to use checksums
694b4d4349f20a7a16cd71c90cd4d18d4b801f103c8a9cc3b1fb32dfa4a222ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for pyopm150 2.0.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page