Skip to main content

Library for the In-situ Marine Optics Dynamic Above-water radiance (L) and irradiance (E) Collector (DALEC).

Project description

pydalec

Library for the Dynamic Above-water radiance(L) and irradiance(E) Collector (DALEC) from In-situ Marine Optics.

GitHub last commit (master) GitHub

Usage example

>>> from pydalec import DALEC
>>> IP:str = '192.168.2.11'  # Replace with your correct IP
>>> dalec = DALEC.connect_tcp(host= IP)
>>> dalec
DALEC at TCPTransport (192.168.2.11:23)
>>> dalec.start_measurements()
>>> dalec.measurement_log[0]
device_id='DALEC',
serial_number='0011',
channel_type='Ed'
utc_time=datetime.datetime(
 2026, 5, 12, 10, 48, 0, 925000, tzinfo=datetime.timezone.utc
),
location=Coordinates(lat=51.2352524, lon=2.931144),
sat_compass_heading=141.43,
solar_azimuth_deg=156.026, solar_zenith_deg=34.893,
gear_position_deg=-76.47,
azimuth_deg=64.96, relative_azimuth_deg=-91.07,
pitch_start_measurement_deg=-3.9, roll_start_measurement_deg=1.8,
telemetry=Telemetry(
    voltage_volts=12.5,
    humidity_mm_hg=17.5,
    temperature_diode_celsius=20.855,
    status_flag=0,
),
int_time=22,
signal_percentage=41.8,
dark_counts=864,
max_counts=27871
spectrum=[3724, 4050, 4455, # Rest of spectrum

CLI connection testing

Useful to quickly validate TCP connectivity and get live measurements from the command line.

>>> pip install pydalec  # or uv, or ...
>>> # Replace with correct IP, and/or add --port xxx to override port
>>> pydalec-test 192.168.2.11
Connected to DALEC at 192.168.2.11:23
Current location: Location(lat=51.2352524°N, lon=2.931144°E)
Current sun zenith: 34.892 deg
Press Enter to start streaming measurements...
Started measurements. Press Ctrl+C to stop.
device_id='DALEC',
serial_number='0011',
channel_type='Ed'
utc_time=datetime.datetime(
 2026, 5, 12, 10, 48, 0, 925000, tzinfo=datetime.timezone.utc
),
location=Coordinates(lat=51.2352524, lon=2.931144),
sat_compass_heading=141.43,
solar_azimuth_deg=156.026, solar_zenith_deg=34.893,
gear_position_deg=-76.47,
azimuth_deg=64.96, relative_azimuth_deg=-91.07,
pitch_start_measurement_deg=-3.9, roll_start_measurement_deg=1.8,
telemetry=Telemetry(
    voltage_volts=12.5,
    humidity_mm_hg=17.5,
    temperature_diode_celsius=20.855,
    status_flag=0,
),
int_time=22,
signal_percentage=41.8,
dark_counts=864,
max_counts=27871
spectrum=[3724, 4050, 4455, # Rest of spectrum

This will:

  • print a "successful connection" message
  • print the current instrument location, if available
  • print the current sun zenith, if available
  • start measurements and stream them to stdout
  • keep running until you stop with Ctrl+C

Logging

By default, pydalec does not configure the root logger so it can be safely used as a library.

For REPL troubleshooting:

>>> from pydalec import enable_debug_logging
>>> enable_debug_logging()
>>> # then use dalec = Dalec.connect_tcp(...)

For CLI troubleshooting:

>>> pydalec-test --debug 192.168.2.11

Release History

See CHANGELOG.md

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

pydalec-0.1.0.tar.gz (297.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydalec-0.1.0-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

Details for the file pydalec-0.1.0.tar.gz.

File metadata

  • Download URL: pydalec-0.1.0.tar.gz
  • Upload date:
  • Size: 297.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pydalec-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ec79fc41d3ed7041f31bba45f0309eeb29ac1ee8cb8b15cd197177254b22859a
MD5 bb880b6dc25df36d6d00509798873329
BLAKE2b-256 ee0bf6b0d3af421e6d14023492b17bd1cedee5ed633ca139f754c0c177c74aed

See more details on using hashes here.

File details

Details for the file pydalec-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pydalec-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 41.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pydalec-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36719b5d54f2f022e8e993464b856041abad35ea45184558d0796eb93e4eddc1
MD5 5420d28b2f977300665150f743299995
BLAKE2b-256 a74ad59dc0f7d259c5af631d79f89d9cbb4b2c587649f05ae7d492a20b0fc863

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