@ies-tools/core
Functions
diagnoseIES()
function diagnoseIES(profile): IESDiagnostic[];
Policy/metadata diagnostics for an already parsed file. This is not a full LM-63 certification.
Profiles returned by parseIES get source ranges; metadata omissions point at the format line.
Parameters
| Parameter | Type |
|---|---|
profile | IESProfile |
Returns
validateIES()
function validateIES(text, options?): IESValidationResult;
Nonthrowing parse + validation. Parse errors remain hard errors; metadata omissions are warnings.
Parameters
| Parameter | Type |
|---|---|
text | string |
options? | IESValidationOptions |
Returns
iesKeywordDescription()
function iesKeywordDescription(keyword): string;
Parameters
| Parameter | Type |
|---|---|
keyword | string |
Returns
string
iesSecondFieldDescription()
function iesSecondFieldDescription(version): [string, string];
The second number on the ballast line changed meaning between editions.
Parameters
| Parameter | Type |
|---|---|
version | string |
Returns
[string, string]
parseIES()
function parseIES(text, fields?): IESProfile;
Parse LM-63-1986, IESNA91, LM-63-1995, LM-63-2002 and LM-63-2019. External TILT files are rejected. Errors carry the source range of the offending token or line.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | - |
fields? | SourceField[] | Optional sink that receives a described SourceField for every header line and token as it is read, including those read before an error. Prefer describePhotometrySource. |
Returns
sampleIntensity()
function sampleIntensity(
profile,
verticalDegrees,
horizontalDegrees,
tiltDegrees?
): number;
Sample Type C luminous intensity in candela using bilinear interpolation and LM-63 symmetries. Vertical 0° points down; horizontal angles wrap around the luminaire. Missing hemispheres are dark. Tilt correction is applied at the supplied luminaire tilt angle (default 0°).
Parameters
| Parameter | Type | Default value |
|---|---|---|
profile | IESProfile | undefined |
verticalDegrees | number | undefined |
horizontalDegrees | number | undefined |
tiltDegrees? | number | 0 |
Returns
number
summarizeIES()
function summarizeIES(profile): object;
Parameters
| Parameter | Type |
|---|---|
profile | IESProfile |
Returns
| Name | Type | Default value | Description |
|---|---|---|---|
format | string | 'IES LM-63' | - |
version | string | profile.version | - |
metadata | Record<string, string> | profile.metadata | - |
photometricType | number | profile.photometricType | - |
photometricTypeName | string | - | - |
photometry | string | - | - |
lightSource | string | - | - |
lampCatalog | string | - | - |
luminaire | string | - | - |
manufacturer | string | - | - |
lampCount | number | profile.lampCount | - |
lumensPerLamp | number | profile.lumensPerLamp | - |
inputWatts | number | profile.inputWatts | - |
peakCandela | number | - | - |
verticalAngles | number | profile.verticalAngles.length | - |
horizontalAngles | number | profile.horizontalAngles.length | - |
units | "meters" | "feet" | profile.units | - |
dimensions | object | profile.dimensions | - |
dimensions.width | number | - | - |
dimensions.length | number | - | - |
dimensions.height | number | - | - |
hasTilt | boolean | - | - |
fileGenerationType | number | null | - | - |
metricsSupported | boolean | - | - |
metricsUnsupportedReason | string | null | - | - |
declaredLampFluxLumens | number | null | - | Lamp rating × lamp count, not measured luminaire output. Null for absolute photometry. |
integratedFluxLumens | number | null | - | Estimated luminaire output integrated from the angular intensity table. |
luminousEfficacyLumensPerWatt | number | null | - | Integrated luminaire flux / declared input watts. Null for zero power or unsupported type. |
beamAngles | BeamAngles[] | - | Principal-plane estimates, not a certification of nominal beam axis or global extrema. |
metricsTiltDegrees | number | - | Lamp tilt applied to the intensity table when computing metrics (default 0°). |
downwardFluxLumens | number | null | - | Integrated flux below the horizontal (γ = 0…90°). |
upwardFluxLumens | number | null | - | Integrated flux above the horizontal (γ = 90…180°). |
peakIntensityCandela | number | null | - | Largest tabulated intensity after lamp tilt. Named apart from the summary's raw-table peakCandela. |
peakDirection | | { horizontalDegrees: number; verticalDegrees: number; } | null | - | First tabulated direction holding PhotometricMetrics.peakIntensityCandela. |
nadirCandela | number | null | - | Intensity straight down (γ = 0). |
lightOutputRatio | number | null | - | Light output ratio: integrated luminaire flux / declared lamp flux. Null without a lamp rating. |
downwardLightOutputRatio | number | null | - | Downward luminaire flux / declared lamp flux. |
upwardLightOutputRatio | number | null | - | Upward luminaire flux / declared lamp flux. |
downwardFluxFraction | number | null | - | Downward flux fraction (DFF): downward / total luminaire flux. |
cieFluxCode | | [number | null, number | null, number | null, number | null, number | null] | null | - | CIE flux code N1–N5 as rounded percentages. N1–N3: flux within γ = 41.4°, 60°, 75.5° as % of downward flux. N4, N5: downward and total flux as % of lamp flux (null without a lamp rating). |
zonalLumens | ZonalLumens[] | null | - | Integrated flux in standard polar zones. |
inputFormat()
function inputFormat(
text,
file?,
hint?
): InputFormat;
Explicit hint wins, then conventional extension; extensionless sources use content detection.
Parameters
| Parameter | Type | Default value |
|---|---|---|
text | string | undefined |
file? | string | '' |
hint? | InputFormat | undefined |
Returns
ldtDiagnostics()
function ldtDiagnostics(profile): PhotometryDiagnostic[];
Parameters
| Parameter | Type |
|---|---|
profile | LDTProfile |
Returns
validatePhotometry()
function validatePhotometry(
text,
format,
strict?,
lampSetIndex?
): object;
Parameters
| Parameter | Type | Default value |
|---|---|---|
text | string | undefined |
format | InputFormat | undefined |
strict? | boolean | false |
lampSetIndex? | number | undefined |
Returns
object
| Name | Type |
|---|---|
valid | boolean |
profile | IESProfile | LDTProfile | null |
diagnostics | PhotometryDiagnostic[] |
describePhotometrySource()
function describePhotometrySource(
text,
format,
strict?
): PhotometrySourceDescription;
Validate source text and describe every header line, keyword, angle and intensity it contains, for
editor hover help and outlines. Never throws for malformed photometry: parse errors become diagnostics
and fields covers the text read before the error. Diagnostics carry source ranges.
Parameters
| Parameter | Type | Default value |
|---|---|---|
text | string | undefined |
format | InputFormat | undefined |
strict? | boolean | false |
Returns
inspectPhotometry()
function inspectPhotometry(
text,
format,
lampSetIndex?
): PhotometryInspection;
Parameters
| Parameter | Type |
|---|---|
text | string |
format | InputFormat |
lampSetIndex? | number |
Returns
inspectParsedPhotometry()
function inspectParsedPhotometry(profile, lampSetIndex?): PhotometryInspection;
Inspect a validated native profile without parsing its source text again.
Parameters
| Parameter | Type |
|---|---|
profile | IESProfile | LDTProfile |
lampSetIndex? | number |
Returns
measuredCPlaneIndices()
function measuredCPlaneIndices(profile, range?): number[];
Indices of the measured planes. Isym=3 wraps C270→C0→C90, as specified by DIAL.
Parameters
| Parameter | Type | Description |
|---|---|---|
profile | Pick<LDTProfile, "symmetry" | "cAngles"> | - |
range? | SourceRange | Range attached to errors, such as the Isym line. |
Returns
number[]
validateLDT()
function validateLDT(profile, locate?): void;
Throws LDTParseError. locate is supplied by the parser so errors point into the source.
Parameters
| Parameter | Type | Description |
|---|---|---|
profile | LDTProfile | - |
locate? | (key, index?) => SourceRange | undefined | Maps a field key and index to its source range; supplied by the parser. |
Returns
void
parseLDT()
function parseLDT(text, fields?): LDTProfile;
Parse the line-oriented EULUMDAT format. The numeric angle/intensity tail may also use packed rows. Errors carry the source range of the offending line or token.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | - |
fields? | SourceField[] | Optional sink that receives a described SourceField for every line field and tail token as it is read, including those read before an error. Prefer describePhotometrySource. |
Returns
writeLDT()
function writeLDT(profile): string;
Write native fields without normalization. The conversion layer handles absolute-candela inputs.
Parameters
| Parameter | Type |
|---|---|
profile | LDTProfile |
Returns
string
calculateFluxBreakdown()
function calculateFluxBreakdown(profile, tiltDegrees?): FluxBreakdown;
Integrate Type C I(θ,φ) sin(θ) dθ dφ in lumens, exactly for the sampler's piecewise-bilinear model, splitting measured intervals at whole degrees to also return the 1° cumulative zonal flux. Uses each actual angular interval, mirrors axial/quadrant/bilateral data, and closes a missing azimuth seam once. Duplicate 0°/360° rows are endpoints, never extra angular bins. Unmeasured vertical ranges are dark. Multipliers already present in candelaValues are not applied again.
Parameters
| Parameter | Type | Default value |
|---|---|---|
profile | PhotometricGrid | undefined |
tiltDegrees? | number | 0 |
Returns
calculateLuminousFlux()
function calculateLuminousFlux(profile, tiltDegrees?): number;
Total luminous flux in lumens; see calculateFluxBreakdown.
Parameters
| Parameter | Type | Default value |
|---|---|---|
profile | PhotometricGrid | undefined |
tiltDegrees? | number | 0 |
Returns
number
getBeamAngles()
function getBeamAngles(
profile,
horizontalDegrees?,
tiltDegrees?
): BeamAngles;
Estimate widths of the dominant lobe in a complete opposed-plane cut, using measured knots.
Parameters
| Parameter | Type | Default value |
|---|---|---|
profile | IESProfile | undefined |
horizontalDegrees? | number | 0 |
tiltDegrees? | number | 0 |
Returns
computePhotometricMetrics()
function computePhotometricMetrics(profile, tiltDegrees?): PhotometricMetrics;
Parameters
| Parameter | Type | Default value |
|---|---|---|
profile | IESProfile | undefined |
tiltDegrees? | number | 0 |
Returns
toPhotometricDocument()
function toPhotometricDocument(input, options?): PhotometricDocument;
Parameters
| Parameter | Type |
|---|---|
input | PhotometricInput |
options? | PhotometryOptions |
Returns
detectPhotometricFormat()
function detectPhotometricFormat(text, format?): "ldt" | "ies";
Detect IES by its version/TILT declaration; otherwise choose line-oriented EULUMDAT.
Parameters
| Parameter | Type |
|---|---|
text | string |
format? | "ldt" | "ies" |
Returns
"ldt" | "ies"
parsePhotometry()
function parsePhotometry(
text,
format?,
options?
): PhotometricDocument;
Parameters
| Parameter | Type |
|---|---|
text | string |
format? | "ldt" | "ies" |
options? | PhotometryOptions |
Returns
toIESProfile()
function toIESProfile(input, options?): ConversionResult<IESProfile>;
Obtain an IES-compatible profile. Unsupported coordinate transformations throw rather than relabeling data.
Parameters
| Parameter | Type |
|---|---|
input | PhotometricInput |
options? | PhotometryOptions |
Returns
serializeIES()
function serializeIES(input, options?): ConversionResult<string>;
Serialize to LM-63-2002, with all candela/ballast multipliers folded into values exactly once.
Parameters
| Parameter | Type |
|---|---|
input | PhotometricInput |
options? | PhotometryOptions |
Returns
ConversionResult<string>
serializeLDT()
function serializeLDT(input, options?): ConversionResult<string>;
Serialize native LDT unchanged, or convert IES absolute candela into LDT cd/klm with explicit loss warnings.
Parameters
| Parameter | Type |
|---|---|
input | PhotometricInput |
options? | SerializeLDTOptions |
Returns
ConversionResult<string>
Classes
IESParseError
Extends
Error
Constructors
Constructor
new IESParseError(
message,
code?,
field?,
range?
): IESParseError;
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
message | string | undefined | - |
code? | IESDiagnosticCode | 'IES_PARSE_ERROR' | - |
field? | string | undefined | - |
range? | SourceRange | undefined | Where the error was detected in the source text. |
Returns
Overrides
Error.constructor
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
Error.captureStackTrace
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Error.prepareStackTrace
Properties
code
readonly code: IESDiagnosticCode = 'IES_PARSE_ERROR';
field?
readonly field?: string;
range?
readonly range?: SourceRange;
Where the error was detected in the source text.
stackTraceLimit
static stackTraceLimit: number;
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Error.stackTraceLimit
cause?
cause?: unknown;
Inherited from
Error.cause
name
name: string;
Inherited from
Error.name
message
message: string;
Inherited from
Error.message
stack?
stack?: string;
Inherited from
Error.stack
LDTParseError
Extends
Error
Constructors
Constructor
new LDTParseError(message, range?): LDTParseError;
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | - |
range? | SourceRange | Where the error was detected in the source text, when parsing. |
Returns
Overrides
Error.constructor
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
Error.captureStackTrace
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Error.prepareStackTrace
Properties
code
readonly code: "LDT_PARSE_ERROR" = 'LDT_PARSE_ERROR';
range?
readonly range?: SourceRange;
Where the error was detected in the source text, when parsing.
stackTraceLimit
static stackTraceLimit: number;
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Error.stackTraceLimit
cause?
cause?: unknown;
Inherited from
Error.cause
name
name: string;
Inherited from
Error.name
message
message: string;
Inherited from
Error.message
stack?
stack?: string;
Inherited from
Error.stack
Interfaces
IESDiagnostic
Properties
| Property | Type | Description |
|---|---|---|
code | IESDiagnosticCode | - |
severity | "warning" | "error" | "info" | - |
message | string | - |
field? | string | - |
range? | SourceRange | Source location, when the diagnostic came from parsing text (not from a profile built in memory). |
IESValidationOptions
Properties
| Property | Type | Description |
|---|---|---|
strict? | boolean | Warnings make valid=false. Their original severity remains unchanged; info never fails validation. |
IESValidationResult
Properties
| Property | Type |
|---|---|
valid | boolean |
profile | IESProfile | null |
diagnostics | IESDiagnostic[] |
IESTilt
Embedded LM-63 lamp tilt correction. Angles are degrees; factors are dimensionless.
Properties
| Property | Type |
|---|---|
geometry | number |
angles | number[] |
factors | number[] |
IESProfile
Properties
| Property | Type | Description |
|---|---|---|
version | string | - |
metadata | Record<string, string> | - |
lampCount | number | - |
lumensPerLamp | number | - |
candelaMultiplier | number | - |
photometricType | number | - |
units | "meters" | "feet" | - |
dimensions | object | - |
dimensions.width | number | - |
dimensions.length | number | - |
dimensions.height | number | - |
ballastFactor | number | - |
ballastLampPhotometricFactor | number | Raw second field: multiplier in 1986/1991, reserved in 1995/2002, generation code in 2019. |
fileGenerationType? | number | LM-63-2019 provenance code, not an intensity multiplier. Absent in earlier editions. |
inputWatts | number | - |
verticalAngles | number[] | - |
horizontalAngles | number[] | - |
candelaValues | number[][] | Horizontal-major values in candela, with candela and ballast multipliers applied. |
tilt | IESTilt | null | - |
PhotometryDiagnostic
Extends
Omit<IESDiagnostic,"code">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
severity | "warning" | "error" | "info" | - | IESDiagnostic.severity |
message | string | - | IESDiagnostic.message |
field? | string | - | IESDiagnostic.field |
range? | SourceRange | Source location, when the diagnostic came from parsing text (not from a profile built in memory). | IESDiagnostic.range |
code | string | - | - |
PhotometrySourceDescription
Properties
| Property | Type | Description |
|---|---|---|
valid | boolean | - |
profile | IESProfile | LDTProfile | null | - |
diagnostics | PhotometryDiagnostic[] | - |
fields | SourceField[] | Described source tokens and lines in document order. Partial when the text is invalid. |
PhotometryInspection
Extends
Omit<CoreSummary,"lampCount"|"lumensPerLamp"|"inputWatts"|"peakCandela">
Properties
| Property | Type | Default value | Description | Inherited from |
|---|---|---|---|---|
format | string | 'IES LM-63' | - | Omit.format |
version | string | profile.version | - | Omit.version |
metadata | Record<string, string> | profile.metadata | - | Omit.metadata |
photometricType | number | profile.photometricType | - | Omit.photometricType |
photometricTypeName | string | ... | - | Omit.photometricTypeName |
photometry | string | ... | - | Omit.photometry |
lightSource | string | ... | - | Omit.lightSource |
lampCatalog | string | ... | - | Omit.lampCatalog |
luminaire | string | ... | - | Omit.luminaire |
manufacturer | string | ... | - | Omit.manufacturer |
verticalAngles | number | profile.verticalAngles.length | - | Omit.verticalAngles |
horizontalAngles | number | profile.horizontalAngles.length | - | Omit.horizontalAngles |
units | "meters" | "feet" | profile.units | - | Omit.units |
dimensions | object | profile.dimensions | - | Omit.dimensions |
dimensions.width | number | undefined | - | - |
dimensions.length | number | undefined | - | - |
dimensions.height | number | undefined | - | - |
hasTilt | boolean | ... | - | Omit.hasTilt |
fileGenerationType | number | null | ... | - | Omit.fileGenerationType |
sourceFormat | InputFormat | undefined | - | - |
lampCount | number | null | undefined | - | - |
lumensPerLamp | number | null | undefined | - | - |
inputWatts | number | null | undefined | - | - |
peakCandela | number | null | undefined | - | - |
selectedLampSetIndex | number | null | undefined | - | - |
lampSets | PhotometricLampSet[] | undefined | - | - |
declaredLuminaireFluxLumens | number | null | undefined | - | - |
diagnostics | PhotometryDiagnostic[] | undefined | - | - |
metricsSupported | boolean | undefined | - | Omit.metricsSupported |
metricsUnsupportedReason | string | null | undefined | - | Omit.metricsUnsupportedReason |
declaredLampFluxLumens | number | null | undefined | Lamp rating × lamp count, not measured luminaire output. Null for absolute photometry. | Omit.declaredLampFluxLumens |
integratedFluxLumens | number | null | undefined | Estimated luminaire output integrated from the angular intensity table. | Omit.integratedFluxLumens |
luminousEfficacyLumensPerWatt | number | null | undefined | Integrated luminaire flux / declared input watts. Null for zero power or unsupported type. | Omit.luminousEfficacyLumensPerWatt |
beamAngles | BeamAngles[] | undefined | Principal-plane estimates, not a certification of nominal beam axis or global extrema. | Omit.beamAngles |
metricsTiltDegrees | number | undefined | Lamp tilt applied to the intensity table when computing metrics (default 0°). | Omit.metricsTiltDegrees |
downwardFluxLumens | number | null | undefined | Integrated flux below the horizontal (γ = 0…90°). | Omit.downwardFluxLumens |
upwardFluxLumens | number | null | undefined | Integrated flux above the horizontal (γ = 90…180°). | Omit.upwardFluxLumens |
peakIntensityCandela | number | null | undefined | Largest tabulated intensity after lamp tilt. Named apart from the summary's raw-table peakCandela. | Omit.peakIntensityCandela |
peakDirection | | { horizontalDegrees: number; verticalDegrees: number; } | null | undefined | First tabulated direction holding PhotometricMetrics.peakIntensityCandela. | Omit.peakDirection |
nadirCandela | number | null | undefined | Intensity straight down (γ = 0). | Omit.nadirCandela |
lightOutputRatio | number | null | undefined | Light output ratio: integrated luminaire flux / declared lamp flux. Null without a lamp rating. | Omit.lightOutputRatio |
downwardLightOutputRatio | number | null | undefined | Downward luminaire flux / declared lamp flux. | Omit.downwardLightOutputRatio |
upwardLightOutputRatio | number | null | undefined | Upward luminaire flux / declared lamp flux. | Omit.upwardLightOutputRatio |
downwardFluxFraction | number | null | undefined | Downward flux fraction (DFF): downward / total luminaire flux. | Omit.downwardFluxFraction |
cieFluxCode | | [number | null, number | null, number | null, number | null, number | null] | null | undefined | CIE flux code N1–N5 as rounded percentages. N1–N3: flux within γ = 41.4°, 60°, 75.5° as % of downward flux. N4, N5: downward and total flux as % of lamp flux (null without a lamp rating). | Omit.cieFluxCode |
zonalLumens | ZonalLumens[] | null | undefined | Integrated flux in standard polar zones. | Omit.zonalLumens |
LDTLampSet
EULUMDAT fields follow DIAL's published format description, independently implemented here.
Properties
LDTDimensions
Properties
| Property | Type |
|---|---|
width | number |
length | number |
height | number |
LDTProfile
Properties
| Property | Type | Description |
|---|---|---|
format | "ldt" | - |
identification | string | - |
typeIndicator | 1 | 2 | 3 | - |
symmetry | 0 | 1 | 2 | 3 | 4 | - |
cPlaneSpacing | number | - |
gammaSpacing | number | - |
reportNumber | string | - |
luminaireName | string | - |
luminaireNumber | string | - |
fileName | string | - |
dateUser | string | - |
luminaire | LDTDimensions | Native millimeters; the luminous area is distinct from the luminaire body. |
luminousArea | object | - |
luminousArea.width | number | - |
luminousArea.length | number | - |
luminousArea.heights | [number, number, number, number] | - |
downwardFluxFraction | number | - |
lightOutputRatio | number | - |
conversionFactor | number | - |
measurementTilt | number | - |
lampSets | LDTLampSet[] | - |
directRatios | number[] | - |
cAngles | number[] | Full C grid, including angles whose intensities are reconstructed using symmetry. |
gammaAngles | number[] | - |
intensities | number[][] | Native cd/klm, measured planes only, in the order specified by Isym. |
BeamAngles
Properties
| Property | Type | Description |
|---|---|---|
horizontalDegrees | number | Opposed-plane cut C-h / C-(h+180); full angle around the cut's peak, in degrees. |
peakDirectionDegrees | number | - |
peakCandela | number | - |
beamAngleDegrees | number | null | Nearest measured 50%-peak crossings bracketing the dominant lobe; null if not both present. |
fieldAngleDegrees | number | null | Nearest measured 10%-peak crossings bracketing the dominant lobe; null if not both present. |
beamAngleStatus | BeamAngleStatus | - |
fieldAngleStatus | BeamAngleStatus | - |
beamLeftDegrees? | number | Signed vertical angle of the 50% crossing below the peak (negative = opposite C-plane). Absent when not bracketed. |
beamRightDegrees? | number | Signed vertical angle of the 50% crossing above the peak. Absent when not bracketed. |
fieldLeftDegrees? | number | Signed vertical angle of the 10% crossing below the peak. Absent when not bracketed. |
fieldRightDegrees? | number | Signed vertical angle of the 10% crossing above the peak. Absent when not bracketed. |
PhotometricMetrics
Properties
| Property | Type | Description |
|---|---|---|
metricsSupported | boolean | - |
metricsUnsupportedReason | string | null | - |
declaredLampFluxLumens | number | null | Lamp rating × lamp count, not measured luminaire output. Null for absolute photometry. |
integratedFluxLumens | number | null | Estimated luminaire output integrated from the angular intensity table. |
luminousEfficacyLumensPerWatt | number | null | Integrated luminaire flux / declared input watts. Null for zero power or unsupported type. |
beamAngles | BeamAngles[] | Principal-plane estimates, not a certification of nominal beam axis or global extrema. |
metricsTiltDegrees | number | Lamp tilt applied to the intensity table when computing metrics (default 0°). |
downwardFluxLumens | number | null | Integrated flux below the horizontal (γ = 0…90°). |
upwardFluxLumens | number | null | Integrated flux above the horizontal (γ = 90…180°). |
peakIntensityCandela | number | null | Largest tabulated intensity after lamp tilt. Named apart from the summary's raw-table peakCandela. |
peakDirection | | { horizontalDegrees: number; verticalDegrees: number; } | null | First tabulated direction holding PhotometricMetrics.peakIntensityCandela. |
nadirCandela | number | null | Intensity straight down (γ = 0). |
lightOutputRatio | number | null | Light output ratio: integrated luminaire flux / declared lamp flux. Null without a lamp rating. |
downwardLightOutputRatio | number | null | Downward luminaire flux / declared lamp flux. |
upwardLightOutputRatio | number | null | Upward luminaire flux / declared lamp flux. |
downwardFluxFraction | number | null | Downward flux fraction (DFF): downward / total luminaire flux. |
cieFluxCode | | [number | null, number | null, number | null, number | null, number | null] | null | CIE flux code N1–N5 as rounded percentages. N1–N3: flux within γ = 41.4°, 60°, 75.5° as % of downward flux. N4, N5: downward and total flux as % of lamp flux (null without a lamp rating). |
zonalLumens | ZonalLumens[] | null | Integrated flux in standard polar zones. |
ZonalLumens
Properties
FluxBreakdown
Properties
ConversionWarning
Properties
| Property | Type |
|---|---|
code | string |
category | "metadata" | "geometry" | "photometry" |
message | string |
ConversionResult
Type Parameters
| Type Parameter |
|---|
T |
Properties
| Property | Type |
|---|---|
value | T |
warnings | ConversionWarning[] |
PhotometricLampSet
A common absolute-candela distribution plus original fields needed for honest interchange.
profile is directly compatible with all existing IESProfile sampling/viewer consumers.
Geometry here is meters; native source geometry remains in its original units.
Extends
Omit<LDTLampSet,"totalLumens">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
lampCount | number | Negative for absolute photometry; positive for relative photometry. | LDTLampSet.lampCount |
description | string | - | LDTLampSet.description |
colorTemperature | string | - | LDTLampSet.colorTemperature |
colorRendering | string | - | LDTLampSet.colorRendering |
watts | number | - | LDTLampSet.watts |
totalLumens | number | null | Null when absolute flux cannot be integrated in an unsupported coordinate system. | - |
PhotometricDocument
Properties
| Property | Type | Description |
|---|---|---|
sourceFormat | "ldt" | "ies" | - |
selectedLampSetIndex | number | null | - |
profile | IESProfile | - |
lampSets | PhotometricLampSet[] | - |
geometry | object | - |
geometry.luminaire | LDTDimensions | null | - |
geometry.luminousOpening | LDTDimensions | - |
geometry.luminousHeights | [number, number, number, number] | null | - |
source | IESProfile | LDTProfile | Native fields are retained, including fields the target format cannot represent. |
PhotometryOptions
Extended by
Properties
| Property | Type | Description |
|---|---|---|
lampSetIndex? | number | Required for multiple LDT lamp configurations; alternatives are never implicitly summed. |
SerializeLDTOptions
Extends
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
lampSetIndex? | number | Required for multiple LDT lamp configurations; alternatives are never implicitly summed. | PhotometryOptions.lampSetIndex |
luminousFlux? | number | Explicit normalization flux when the IES document does not supply usable lamp lumens. | - |
tiltDegrees? | number | Bake a fixed lamp-tilt correction; the full IES TILT curve cannot be represented in LDT. | - |
SourceRange
A single-line location in photometric source text. line is 0-based; start and end are UTF-16
column offsets with end exclusive, as used by editors such as VS Code. Lines are split on CRLF, CR or
LF; a leading byte-order mark is not counted.
Extended by
Properties
| Property | Type |
|---|---|
line | number |
start | number |
end | number |
SourceField
A described piece of source text, for hover help and outlines.
Extends
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
line | number | - | SourceRange.line |
start | number | - | SourceRange.start |
end | number | - | SourceRange.end |
name | string | Short label. Every element of a repeated array shares one name, such as "Vertical angles". | - |
description | string | - | - |
Type Aliases
IESDiagnosticCode
type IESDiagnosticCode =
| "IES_PARSE_ERROR"
| "IES_MISSING_TILT"
| "IES_UNSUPPORTED_HEADER"
| "IES_EXTERNAL_TILT"
| "IES_INVALID_NUMBER"
| "IES_INVALID_COUNT"
| "IES_TABLE_LIMIT"
| "IES_INVALID_RANGE"
| "IES_INVALID_ANGLES"
| "IES_INVALID_COVERAGE"
| "IES_NEGATIVE_CANDELA"
| "IES_SCALED_OVERFLOW"
| "IES_TRAILING_DATA"
| "IES_REQUIRED_METADATA"
| "IES_UNSUPPORTED_COORDINATES"
| "IES_PARTIAL_VERTICAL_COVERAGE"
| "IES_HORIZONTAL_SEAM_MISMATCH"
| "IES_RESERVED_FIELD"
| "IES_FILE_GENERATION_TYPE";
InputFormat
type InputFormat = "ies" | "ldt";
PhotometricGrid
type PhotometricGrid = Pick<IESProfile,
| "photometricType"
| "verticalAngles"
| "horizontalAngles"
| "candelaValues"> & object;
Absolute candela on a horizontal-major angular grid. No metadata or lamp rating is required.
Type Declaration
| Name | Type |
|---|---|
tilt? | IESTilt | null |
BeamAngleStatus
type BeamAngleStatus = "ok" | "no-light" | "no-crossing" | "multiple-lobes";
PhotometricInput
type PhotometricInput =
| IESProfile
| LDTProfile
| PhotometricDocument;
Variables
IES_KEYWORDS
const IES_KEYWORDS: Readonly<Record<string, string>>;
LM-63 keywords. Keywords starting with _ are user-defined.
IES_FORMAT_LINE
const IES_FORMAT_LINE: Readonly<Record<string, string>>;
IES_HEADER
const IES_HEADER: object;
[name, description] for the numeric IES header in file order, excluding the edition-dependent second ballast field.
Type Declaration
LDT_SYMMETRY
const LDT_SYMMETRY: string;
LDT_LINES
const LDT_LINES: readonly (readonly [string, string, string])[];
EULUMDAT line fields in file order, as [profile key, name, description]. Lamp sets and arrays follow.
LDT_LAMP_SET_LINES
const LDT_LAMP_SET_LINES: readonly (readonly [string, string, string])[];
[profile key, name suffix, description] for each lamp set's six lines.
LDT_ROOM_INDICES
const LDT_ROOM_INDICES: readonly [0.6, 0.8, 1, 1.25, 1.5, 2, 2.5, 3, 4, 5];
Room indices k for the ten direct ratios.