Luminance table generation from EULUMDAT (.ldt) photometric files — extension to eulumdat-py
Project description
eulumdat-luminance
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
result.at(c_deg, g_deg)— bilinear interpolation at arbitrary (C, γ) anglesresult.projected_area(c_deg, g_deg)— projected luminous area (m²) at arbitrary angles, required byeulumdat-ugrfor solid-angle computation- 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²")
# Interpolate luminance at arbitrary (C, γ)
lum = result.at(c_deg=12.0, g_deg=67.0) # float, cd/m²
# Projected luminous area at arbitrary (C, γ) — used by eulumdat-ugr
area = result.projected_area(c_deg=0.0, g_deg=65.0) # float, m²
plot = LuminancePlot(result)
plot.polar("polar.svg")
plot.polar("polar.png")
# Print-ready: 10 cm at 150 dpi, fonts equivalent to Arial 9pt
plot.polar("polar_report.png", style=PolarStyle.for_print(width_cm=10, dpi=150, font_scale=2.11))
Example output
Sample 04 — linear luminaire 1480 × 63 mm, 12 334 lm — PolarStyle.for_print(width_cm=10, dpi=150, font_scale=2.11)
Running the tests
# All tests (numerical validation + diagram generation)
pytest
# Numerical tests only (fast)
pytest tests/test_calculator.py
# Diagram generation only
pytest tests/test_polar_diagram.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 sizing test (8 cm / 300 dpi)
pytest -k "word" # Word/PDF report test (10 cm / 150 dpi)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eulumdat_luminance-1.2.0.tar.gz.
File metadata
- Download URL: eulumdat_luminance-1.2.0.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eeb9597a5e8d1bc031aba76b873a8b0384f041aab3faca225d15601be635e5e
|
|
| MD5 |
3019a1331db40d641ac1ee6f28d48b7f
|
|
| BLAKE2b-256 |
14541788bffbda71a46915e79f7a80bfe08107242cd71ff20919a2f51548d12d
|
File details
Details for the file eulumdat_luminance-1.2.0-py3-none-any.whl.
File metadata
- Download URL: eulumdat_luminance-1.2.0-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9f25870301e9f182af0709cf1aba177cafe6ed1ef3c4518c50b2360c1d408bf
|
|
| MD5 |
7cf59b3dda4c5f7634ac25005691ff00
|
|
| BLAKE2b-256 |
1044c9576e33fb7c7e967bbea1e5d4312dc611958636fbdb7ca10a789fce8e96
|