Skip to main content

Luminance table generation from EULUMDAT (.ldt) photometric files — extension to eulumdat-py

Project description

eulumdat-luminance

PyPI version Python License: MIT DOI

Luminance table generation from EULUMDAT (.ldt) photometric files — extension to eulumdat-py.

Features

  • Luminance table (cd/m²) computed from intensity distribution and luminous area geometry
  • UGR grid (C: 0°–345° in 15° steps, γ: 65°–85° in 5° steps) with automatic bilinear interpolation when the native LDT resolution does not match
  • Full native grid mode for detailed photometric analysis
  • Polar luminance diagram (SVG + PNG/JPG): all 24 C-planes visible simultaneously, one curve per γ angle, blue gradient palette, optional threshold circle
  • Print-ready output via PolarStyle.for_print(width_cm, dpi) — exact physical dimensions for PDF/Word documents
  • CSV and JSON export

Installation

pip install eulumdat-luminance

Dependencies

  • eulumdat-py — EULUMDAT parser
  • numpy, scipy
  • vl-convert-python — SVG rasterisation
  • Pillow — JPG conversion

Quick start

from pyldt import LdtReader
from eulumdat_luminance import LuminanceCalculator, LuminancePlot, PolarStyle

ldt    = LdtReader.read("luminaire.ldt")
result = LuminanceCalculator.compute(ldt)

print(f"{result.luminaire_name}{result.maximum:.0f} cd/m²")

plot = LuminancePlot(result)
plot.polar("polar.svg")
plot.polar("polar.png")

# Print-ready: 8 cm wide at 300 dpi
plot.polar("polar_print.png", style=PolarStyle.for_print(width_cm=8, dpi=300))

Running the tests

# All tests (numerical validation + diagram generation)
pytest

# Numerical tests only (fast, ~10 s)
pytest tests/test_calculator.py

# Visual diagram generation only
pytest tests/test_diagrams.py

# Verbose with print output
pytest -v -s

# Filter by sample
pytest -k sample_04

# Filter by test type
pytest -k "svg"                  # SVG generation only
pytest -k "png"                  # PNG generation only
pytest -k "for_print"            # print/PDF sizing tests
pytest -k "Relux"                # Relux numerical validation (30 tests)
pytest -k "not Smoke"            # exclude smoke tests

# Coverage
pytest --cov=eulumdat_luminance tests/test_calculator.py

License

MIT

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_luminance-1.0.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

eulumdat_luminance-1.0.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file eulumdat_luminance-1.0.1.tar.gz.

File metadata

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

File hashes

Hashes for eulumdat_luminance-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9343e46bb35f950587decde159290e2790a1a0e6a168c4fd2b527464c24fd9d7
MD5 cde23b7f0be8be8416c19cb5ae62af59
BLAKE2b-256 c158f76c6e9bd725ec7218bc7b53887d9794c9a53197a1cfb96c4dd952fbdae4

See more details on using hashes here.

File details

Details for the file eulumdat_luminance-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for eulumdat_luminance-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e692a389e9f8643119231d8821d2143fa707f1e68f2370ea379705a9e06dfc8d
MD5 d3922744bb1019f8fb83ec2577130ff1
BLAKE2b-256 c72131910b36cac4a228f0905c8dbdb51879e4bb0597c2b4c8faa46f58b59283

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