Skip to main content

Practical photometric calculations on EULUMDAT data

Project description

eulumdat-analysis

PyPI PyPI - Python Version License: MIT

Practical photometric calculations on EULUMDAT data.

Part of the eulumdat-* Python ecosystem built on eulumdat-py.
Developed in an ISO 17025 accredited photometry laboratory.


Features

  • half_angle — half-angle at half maximum (HAHM) per C-plane, with CubicSpline interpolation
  • resample — resample a Ldt to a coarser angular resolution (linear interpolation, ISO 17025 traceable)
  • rotate — azimuthal rotation of the intensity matrix by an arbitrary multiple of the angular step
  • luminous_flux — total flux in lm/klm by trapezoidal integration (CIE 190 method)
  • luminous_flux_range — flux integrated over an arbitrary gamma window [g_min, g_max] in lm/klm
  • lorl_computed — LORL in % computed from the intensity matrix
  • dff_computed — downward flux fraction in % computed from the intensity matrix
  • check_photometric_consistency — compare matrix-computed LORL and DFF against header declared values
  • Handles all ISYM symmetry types including full rotational symmetry (ISYM=1)
  • Automatically rejects multi-peak distributions (secondary peak prominence > 5 % of I_max)
  • Returns None for undefined cases — never raises unhandled exceptions

Installation

pip install eulumdat-analysis

For development:

git clone https://github.com/123VincentB/eulumdat-analysis.git
cd eulumdat-analysis
pip install -e ".[dev]"

Quick start

from pyldt import LdtReader
from ldt_analysis import half_angle, resample, rotate, luminous_flux, lorl_computed, dff_computed, check_photometric_consistency

ldt = LdtReader.read("luminaire.ldt")

# Half-angle at half maximum per C-plane
result = half_angle(ldt, [0.0, 90.0, 180.0, 270.0])
print(result)
# {0.0: 35.4, 90.0: 36.1, 180.0: 35.8, 270.0: 36.0}

# Resample a raw 2.5°×1° measurement to standard 15°×5°
ldt_raw = LdtReader.read("luminaire_raw.ldt")   # 144 C-planes × 181 γ-angles
ldt_15x5 = resample(ldt_raw)                    # → 24 C-planes × 37 γ-angles

# Flux and photometric consistency check (CIE 190)
flux = luminous_flux(ldt)                        # e.g. 865.3 lm/klm
lorl = lorl_computed(ldt)                        # e.g. 86.53 %
dff  = dff_computed(ldt)                         # e.g. 99.8 %
report = check_photometric_consistency(ldt)
# {"lorl_header": 87.0, "lorl_computed": 86.53, "lorl_delta": -0.47, ...}

Examples

File Description
examples/01_basic_usage.md half_angle — basic usage, return values, FWHM
examples/02_resample.md resample — resolution resampling, guards, preserved fields
examples/03_luminous_flux_range.md luminous_flux_range — flux over arbitrary gamma window, edge cases
examples/04_rotate.md rotate — azimuthal rotation, valid angles, edge cases

Project structure

eulumdat-analysis/
├── src/
│   └── ldt_analysis/
│       ├── __init__.py
│       ├── half_angle.py
│       ├── resample.py
│       ├── rotate.py
│       └── flux.py
├── examples/
│   ├── 01_basic_usage.md
│   ├── 02_resample.md
│   ├── 03_luminous_flux_range.md
│   └── 04_rotate.md
├── tests/
│   ├── test_half_angle.py
│   ├── test_resample.py
│   ├── test_rotate.py
│   └── test_flux.py
├── CHANGELOG.md
├── LICENSE
└── README.md

Dependencies

  • eulumdat-py ≥ 1.0.0 — EULUMDAT parser
  • scipy ≥ 1.7 — CubicSpline interpolation and Brent root-finding

half_angle — return values

Case Return value
Normal beam float — crossing angle in degrees
C-plane not found in file (±0.01°) None
I_max = 0 (dark or inactive plane) None
Intensity never drops to half-max within [γ_max, 90°] None
Multi-peak distribution None

resample — return values

Case Return value
Success Ldt — new object at target resolution
c_step <= 0 or g_step <= 0 None
Source has fewer than 2 C-planes or γ-angles None
Target finer than source None

eulumdat-* ecosystem

New to the ecosystem? eulumdat-quickstart — a step-by-step guide covering all 8 packages with working examples.

Package Description
eulumdat-py Read / write EULUMDAT files
eulumdat-symmetry Symmetrise and detect ISYM
eulumdat-plot Polar intensity diagram (SVG/PNG)
eulumdat-luminance Luminance table and polar diagram
eulumdat-ugr UGR catalogue (CIE 117/190)
eulumdat-analysis Beam half-angle, flux integration, photometric consistency — this package
eulumdat-report Full photometric datasheet (HTML/PDF)
eulumdat-ies LDT ↔ IES LM-63-2002 conversion

License

MIT — see LICENSE.


Context

This package 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_analysis-1.4.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

eulumdat_analysis-1.4.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file eulumdat_analysis-1.4.0.tar.gz.

File metadata

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

File hashes

Hashes for eulumdat_analysis-1.4.0.tar.gz
Algorithm Hash digest
SHA256 16400868e2ef46d1dcfa704d82009226ea3bff418a995d6eac38ab2d2fe22c5a
MD5 408441d9b20c4da408f539989fb65547
BLAKE2b-256 31e1f9962b8395654d307867c97ddbed33a6063b03fbe7e515ddbf22128717b0

See more details on using hashes here.

File details

Details for the file eulumdat_analysis-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for eulumdat_analysis-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 964d7d349cbb9636330595b34c25d6f5aa6e206036fd10cf7c9663460d9e0818
MD5 14ba3c14e66f2e31a7c693905bee9b45
BLAKE2b-256 12771e948b02c8570e65a602dfe2a0aefa431a0b022b7246dca2b2a8c0ca3eae

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