Python driver for AA OptoElectronics AOTF device.
Project description
AA OptoElectronics MPDSnCxx AOTF Driver
python driver to control MPDSnCxx AOTF devices.
Installation
To install this package from PyPI, invoke: pip install aaopto-aotf
To install this package from the Github in editable mode, from this directory invoke: pip install -e .
To install this package in editable mode with dependencies for building the docs, invoke: pip install -e .[dev]
Intro and Basic Usage
from aaopto_aotf.aotf import MPDS
aotf = MPDS("COM3")
Before writing values, you must first set the global blanking mode, and each channel's frequency, mode, and whether it is driven by external input or internal (software controlled) input.
from aaopto_aotf.aotf import MPDS, MAX_POWER_DBM
from aaopto_aotf.device_codes import DriverMode, BlankingMode, VoltageRange
aotf.set_blanking(BlankingMode.INTERNAL) # disable blanking control from external input pin.
aotf.set_external_input_voltage_range(VoltageRange.ZERO_TO_FIVE_VOLTS)
# Note: device channels are 1-indexed to be consistent with the datasheet.
for channel in range(1, aotf.num_channels + 1):
aotf.set_frequency(channel, 110.5)
aotf.set_driver_mode(DriverMode.EXTERNAL)
If the driver mode is set to DriverMode.EXTERNAL
, the device will take its output setpoint from the external input pin.
If set to DriverMode.INTERNAL
, you can control the output with software settings:
for channel in range(1, aotf.num_channels + 1):
aotf.set_driver_mode(DriverMode.INTERNAL)
aotf.set_power_dbm(channel, MAX_POWER_DBM)
aotf.enable_channel(channel)
Note that internal mode only enables a simple "On/Off" control scheme, and does not support linear scaling like external mode does vial the external analog input.
At this point, you might want to save the values set above to the current profile.
aotf.save_profile() # Now, calling an aotf.reset() will start with the saved settings.
What's missing?
Here are the minor dangling features that are not implemented.
- changing laser channel profiles at runtime. (These must be changed with the external input pins.)
- automatic sweeping mode
- automatic self-sweeping is a somewhat out-of-the-ordinary feature for most users.
Examples:
Have a look at the examples folder to see other examples and make use of a useful calibration script.
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
Built Distribution
File details
Details for the file aaopto_aotf-0.0.11.tar.gz
.
File metadata
- Download URL: aaopto_aotf-0.0.11.tar.gz
- Upload date:
- Size: 39.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 579bd58ba2409a94e7696d96a2d34a4845905dffaf38611d362a1daca8d21ac4 |
|
MD5 | 93fa0ae7654e0bca8d40ea6f54d63ee2 |
|
BLAKE2b-256 | 861e46bd3ec5ec5a39ecb6906d146fc296258f490663063efd5e9d712da8e380 |
File details
Details for the file aaopto_aotf-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: aaopto_aotf-0.0.11-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01db53479b3c91777089b420774f94a1a204709759035c790a8909a4b8cc600f |
|
MD5 | cb4564322fa2d43859de7b9c45df9ac8 |
|
BLAKE2b-256 | 18553546776bd907fd6bff0313e3646fa8070bd4a1de0d848c151bc914074041 |