Skip to main content

Python library for reading and writing EULUMDAT (.ldt) photometric files

Project description

pyldt

PyPI PyPI - Python Version License: MIT DOI

A Python library for reading and writing EULUMDAT (.ldt) photometric files — the standard format for luminaire intensity distribution data used in lighting design and photometric testing.

Developed in an ISO 17025 accredited photometry laboratory.


Features

  • Parse any valid EULUMDAT file into a clean Python object model
  • Full symmetry expansion (ISYM 0–4) into a complete [mc × ng] intensity matrix
  • Edit header fields (luminaire name, lamp data, photometric factors, geometry, …)
  • Save back to a valid EULUMDAT file with correct ISO-8859-1 encoding
  • Optional symmetry compression on write
  • Safe file naming: auto-increments filename (_1, _2, …) if destination exists
  • No dependencies beyond the Python standard library

Installation

pip install eulumdat-py

For development or to access the examples:

git clone https://github.com/123VincentB/pyldt.git
cd pyldt
pip install -e .

Quick start

from pyldt import LdtReader, LdtWriter

# Read
ldt = LdtReader.read("luminaire.ldt")
print(ldt.header.luminaire_name)
print(f"I(C=0°, γ=0°) = {ldt.intensities[0][0]:.1f} cd/klm")

# Edit a header field
ldt.header.date_user = "2026-01-01 / modified"

# Save (adds _1 suffix if file already exists)
saved = LdtWriter.write(ldt, "luminaire_modified.ldt")
print(f"Saved to: {saved}")

Examples

File Description
examples/01_basic_usage.md Accessing header fields, lamp data and intensity values
examples/01_basic_usage.py Runnable script for the above
examples/02_polar_diagram.md Plotting the polar intensity diagram (4 C-planes)
examples/02_polar_diagram.py Runnable script for the above (requires matplotlib)

Run any example from the repository root:

python examples/01_basic_usage.py
python examples/02_polar_diagram.py

Project structure

pyldt/
├── pyldt/
│   ├── __init__.py      ← Public API
│   ├── model.py         ← LdtHeader, Ldt dataclasses
│   ├── parser.py        ← LdtReader
│   └── writer.py        ← LdtWriter
├── examples/
│   ├── 01_basic_usage.md
│   ├── 01_basic_usage.py
│   ├── 02_polar_diagram.md
│   └── 02_polar_diagram.py
├── tests/
│   ├── test_parser.py
│   └── samples/         ← .ldt test files (10 real manufacturer files)
├── docs/
│   └── eulumdat_format.md
├── CHANGELOG.md
├── LICENSE
└── README.md

EULUMDAT format

EULUMDAT is the standard file format for luminaire photometric data, defined by the LiTG (Deutsche Lichttechnische Gesellschaft, 1990). It is widely used in Europe alongside IES files (North America).

Key concepts:

  • C-planes: vertical planes through the luminaire vertical axis (azimuth, 0–360°)
  • γ-angles: elevation angles within each C-plane (0° = nadir, 90° = horizontal, 180° = zenith)
  • ISYM: symmetry code that allows the file to store only a subset of C-planes
  • Intensities: tabulated in cd/klm (candela per kilolumen of lamp flux)

See docs/eulumdat_format.md for a detailed field-by-field description.


Symmetry types (ISYM)

ISYM Description C-planes stored
0 No symmetry All mc planes
1 Full rotational symmetry 1 plane
2 Symmetry about C0–C180 mc/2 + 1 planes
3 Symmetry about C90–C270 mc/2 + 1 planes
4 Quadrant symmetry mc/4 + 1 planes

LdtReader.read() always returns a fully expanded matrix regardless of ISYM.


License

MIT — see LICENSE.


Context

This library was developed as a practical tool in the context of ISO 17025 accredited photometric testing. It is shared as open-source in the hope that it will be useful to others working with EULUMDAT files in Python.

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

eulumdat_py-1.0.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

eulumdat_py-1.0.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file eulumdat_py-1.0.0.tar.gz.

File metadata

  • Download URL: eulumdat_py-1.0.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for eulumdat_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b41605476a5eeb2e77999e207bd197e4d70fb946e5ced1bbe4f9c5e30fcfa32a
MD5 c9eca76b793e6ddf4b131ef4093ab712
BLAKE2b-256 6c0e56666392b934b401f02fa398f199d4421e362125c5eb19694e0fa311a0b1

See more details on using hashes here.

File details

Details for the file eulumdat_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: eulumdat_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for eulumdat_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ec3a1dfeb0fc99f2a512b520abcec72dbe5b42ffb2ea3264fe9915de6add999
MD5 980323050d03b875036a2e9f230c4734
BLAKE2b-256 b3511a6cfe035f6f848dc38e2521498d3da34f7eea77ef4b33ea75442bd5cba2

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