Skip to main content

No project description provided

Project description

By: chiesa Date: March 31, 2020 Copyright Alpes Lasers SA, Neuchatel, Switzerland

Driver for the Alpes Lasers S-2 pulser. Visit https://www.alpeslasers.ch/ for more informations.

Usage

See also the examples folder in the sdeux package.

import os

from sdeux.auto_detect import init_driver
from sdeux.communication import RETRY_NO, RETRY_SOME
from sdeux.serial_handler import S2SerialHandler

th = None

port = os.path.expanduser('~/tty.AL-S2')

retry_policy = RETRY_SOME  # on communication errors, retries up to 3 times until a timeout of 3 seconds

# retry_policy = RETRY_NO   # on communications errors, raise an exception directly


def print_status(s2_instance):
    print_status = 'Measured current (A): {:.5f}\n'.format(s2_instance.measured_current) + \
                   'Measured voltage (V): {:.5f}\n'.format(s2_instance.measured_voltage) + \
                   'Target voltage (V): {:.5f}\n'.format(s2_instance.applied_voltage) + \
                   'Laser temperature (degC): {:.5f}\n'.format(s2_instance._info.laser_temperature) + \
                   'Overcurrent Limit (A): {:.5f}\n'.format(s2_instance.current_limit) + \
                   'MCU temperature (degC): {:.5f}\n'.format(s2_instance._info.MCU_temperature) + \
                   'Pulse Mode: {}\n'.format(s2_instance.pulsing_mode) + \
                   'Board Status: {}\n'.format(s2_instance.status_label)
    print(print_status)


try:
    th = S2SerialHandler(port)
    th.open()
    s2 = init_driver(th)
    s2.set_up()
    s2.retry_policy = retry_policy
    print_status(s2)

finally:
    if th:
        th.close()

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

sdeux-2025.3.1.tar.gz (265.2 kB view details)

Uploaded Source

File details

Details for the file sdeux-2025.3.1.tar.gz.

File metadata

  • Download URL: sdeux-2025.3.1.tar.gz
  • Upload date:
  • Size: 265.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.9

File hashes

Hashes for sdeux-2025.3.1.tar.gz
Algorithm Hash digest
SHA256 a5b1e83284957c3e524e68704153d36356382ae3d7c3680505e051c915c14637
MD5 7f4205773399b38e2782b04e71fc4421
BLAKE2b-256 6e8c4607fdb834b9361c04f2c43b5d34fefb0713c9e6dc7b984ec22440ba786d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page