No project description provided
Project description
PyPDM
Python3 library for controlling Alphanov's PDM laser sources. Currently supported PDM protocol version is 3.4. Daisy-chain configuration for multiple devices is supported, so it is possible to use many PDMs with only one serial link.
Installation
Clone the repository then use pip3 to install the package.
pip3 install pypdm
Documentation
A quick documentation is available on Read the Docs. A simple usage example is also provided below.
Requirements
This library requires the following packages:
- pyserial
Safety
When a PDM object is deleted, the library may try to switch off the laser source for safety. However, you shall not rely on this behavior and always beware of dangers when using laser equipments! Please always wear laser safety goggles or use any appropriate safety equipment to prevent any harmful accident.
Usage example
Basic laser activation in continuous mode
import pypdm
pdm = pypdm.PDM(1, 'COM0')
# Set offset current in mA.
pdm.offset_current = 30
pdm.activation = True
# Apply new settings to the device.
pdm.apply()
Basic laser configuration for pulsed operation
import pypdm
pdm = pypdm.PDM(1, 'COM0')
# Set pulse power to 50%
pdm.current_source = pypdm.CurrentSource.NUMERIC
pdm.current_percentage = 50
pdm.activation = True
# Apply new settings to the device.
pdm.apply()
List of available properties
import pypdm
pdm = pypdm.PDM(1, 'COM0')
print('Mode:', pdm.mode)
print('Synchronization source:', pdm.sync_source)
print('Delay line type:', pdm.delay_line_type)
print('Frequency (Hz):', pdm.frequency)
print('Pulse width (ps):', pdm.pulse_width)
print('Delay (ps):', pdm.delay)
print('Offset current (mA):', pdm.offset_current)
print('Current (%):', pdm.current_percentage)
print('Current (mA):', pdm.current)
print('Temperature (C°):', pdm.temperature)
print('Maximum current (mA):', pdm.maximum_current)
print('Interlock status:', pdm.interlock_status)
print('Laser activation:', pdm.laser_activation)
Use of two sources in daisy-chain configuration
import pypdm
pdm1 = pypdm.PDM(1, 'COM0')
pdm2 = pypdm.PDM(2, pdm1)
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
Built Distribution
File details
Details for the file pypdm-1.1.tar.gz
.
File metadata
- Download URL: pypdm-1.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ad06d7fe28eac452caf0588e331ff442fe497cffe773e98d4ea122b2dfed42d |
|
MD5 | a2579261fa0ecb6e85484ae805e123f9 |
|
BLAKE2b-256 | 92cc220b07d8c7595f51401956b4e44fbe47d28cc489f4ff99a680db957dfb99 |
File details
Details for the file pypdm-1.1-py3-none-any.whl
.
File metadata
- Download URL: pypdm-1.1-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a43e9364f204d377e767ae9c18d2b8b4450d517b87c0769518e30190e570f11 |
|
MD5 | fa65ff8bbe11e51a9ad8614d28e6a9ee |
|
BLAKE2b-256 | d74d811b5557695d2ca00b442bf37c2c7f8a9328cf8beba7b28cf7222325f6f1 |