spectral_metrics
Calculate human-centric lighting metrics from spectral power distribution, including CCT/DUV, melanopic DER, melanopic/photopic ratio, and EML to EDI conversions.
Instructions
Derived HCL quantities from an SPD: cct/duv, mel-DER, mel/photopic ratio, and EML<->EDI.
spd accepts a .spd file path, 2-column text, or a list of [wavelength, value].
The two modes below are mutually exclusive, so the eml_edi key has a DIFFERENT shape in each:
spd= -> {cct_duv, mel_der, mel_photopic_ratio, eml_edi:{mel_edi, eml}}. Here
eml_ediis the SPD's melanopic EDI + its EML equivalent. NOTE: theeml_ediblock is ABSOLUTE/scale-dependent (see itsscale_note); the other metrics are scale-invariant.metric('all' | one key) selects a single block.eml_edi_value= -> scalar EML<->mel-EDI conversion only (no SPD needed): {eml_edi:{input, direction, result}}. eml_edi_direction= 'medi_to_eml' (default) or 'eml_to_medi'. (Spec 7.1 row 5 EML<->EDI.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spd | No | ||
| metric | No | all | |
| eml_edi_value | No | ||
| eml_edi_direction | No | medi_to_eml |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||