Skip to main content

@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​

ParameterType
profileIESProfile

Returns​

IESDiagnostic[]


validateIES()​

function validateIES(text, options?): IESValidationResult;

Nonthrowing parse + validation. Parse errors remain hard errors; metadata omissions are warnings.

Parameters​

ParameterType
textstring
options?IESValidationOptions

Returns​

IESValidationResult


iesKeywordDescription()​

function iesKeywordDescription(keyword): string;

Parameters​

ParameterType
keywordstring

Returns​

string


iesSecondFieldDescription()​

function iesSecondFieldDescription(version): [string, string];

The second number on the ballast line changed meaning between editions.

Parameters​

ParameterType
versionstring

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​

ParameterTypeDescription
textstring-
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​

IESProfile


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​

ParameterTypeDefault value
profileIESProfileundefined
verticalDegreesnumberundefined
horizontalDegreesnumberundefined
tiltDegrees?number0

Returns​

number


summarizeIES()​

function summarizeIES(profile): object;

Parameters​

ParameterType
profileIESProfile

Returns​

NameTypeDefault valueDescription
formatstring'IES LM-63'-
versionstringprofile.version-
metadataRecord<string, string>profile.metadata-
photometricTypenumberprofile.photometricType-
photometricTypeNamestring--
photometrystring--
lightSourcestring--
lampCatalogstring--
luminairestring--
manufacturerstring--
lampCountnumberprofile.lampCount-
lumensPerLampnumberprofile.lumensPerLamp-
inputWattsnumberprofile.inputWatts-
peakCandelanumber--
verticalAnglesnumberprofile.verticalAngles.length-
horizontalAnglesnumberprofile.horizontalAngles.length-
units"meters" | "feet"profile.units-
dimensionsobjectprofile.dimensions-
dimensions.widthnumber--
dimensions.lengthnumber--
dimensions.heightnumber--
hasTiltboolean--
fileGenerationTypenumber | null--
metricsSupportedboolean--
metricsUnsupportedReasonstring | null--
declaredLampFluxLumensnumber | null-Lamp rating × lamp count, not measured luminaire output. Null for absolute photometry.
integratedFluxLumensnumber | null-Estimated luminaire output integrated from the angular intensity table.
luminousEfficacyLumensPerWattnumber | null-Integrated luminaire flux / declared input watts. Null for zero power or unsupported type.
beamAnglesBeamAngles[]-Principal-plane estimates, not a certification of nominal beam axis or global extrema.
metricsTiltDegreesnumber-Lamp tilt applied to the intensity table when computing metrics (default 0°).
downwardFluxLumensnumber | null-Integrated flux below the horizontal (γ = 0…90°).
upwardFluxLumensnumber | null-Integrated flux above the horizontal (γ = 90…180°).
peakIntensityCandelanumber | 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.
nadirCandelanumber | null-Intensity straight down (γ = 0).
lightOutputRationumber | null-Light output ratio: integrated luminaire flux / declared lamp flux. Null without a lamp rating.
downwardLightOutputRationumber | null-Downward luminaire flux / declared lamp flux.
upwardLightOutputRationumber | null-Upward luminaire flux / declared lamp flux.
downwardFluxFractionnumber | 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).
zonalLumensZonalLumens[] | 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​

ParameterTypeDefault value
textstringundefined
file?string''
hint?InputFormatundefined

Returns​

InputFormat


ldtDiagnostics()​

function ldtDiagnostics(profile): PhotometryDiagnostic[];

Parameters​

ParameterType
profileLDTProfile

Returns​

PhotometryDiagnostic[]


validatePhotometry()​

function validatePhotometry(
text,
format,
strict?,
lampSetIndex?
): object;

Parameters​

ParameterTypeDefault value
textstringundefined
formatInputFormatundefined
strict?booleanfalse
lampSetIndex?numberundefined

Returns​

object

NameType
validboolean
profileIESProfile | LDTProfile | null
diagnosticsPhotometryDiagnostic[]

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​

ParameterTypeDefault value
textstringundefined
formatInputFormatundefined
strict?booleanfalse

Returns​

PhotometrySourceDescription


inspectPhotometry()​

function inspectPhotometry(
text,
format,
lampSetIndex?
): PhotometryInspection;

Parameters​

ParameterType
textstring
formatInputFormat
lampSetIndex?number

Returns​

PhotometryInspection


inspectParsedPhotometry()​

function inspectParsedPhotometry(profile, lampSetIndex?): PhotometryInspection;

Inspect a validated native profile without parsing its source text again.

Parameters​

ParameterType
profileIESProfile | LDTProfile
lampSetIndex?number

Returns​

PhotometryInspection


measuredCPlaneIndices()​

function measuredCPlaneIndices(profile, range?): number[];

Indices of the measured planes. Isym=3 wraps C270→C0→C90, as specified by DIAL.

Parameters​

ParameterTypeDescription
profilePick<LDTProfile, "symmetry" | "cAngles">-
range?SourceRangeRange 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​

ParameterTypeDescription
profileLDTProfile-
locate?(key, index?) => SourceRange | undefinedMaps 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​

ParameterTypeDescription
textstring-
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​

LDTProfile


writeLDT()​

function writeLDT(profile): string;

Write native fields without normalization. The conversion layer handles absolute-candela inputs.

Parameters​

ParameterType
profileLDTProfile

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​

ParameterTypeDefault value
profilePhotometricGridundefined
tiltDegrees?number0

Returns​

FluxBreakdown


calculateLuminousFlux()​

function calculateLuminousFlux(profile, tiltDegrees?): number;

Total luminous flux in lumens; see calculateFluxBreakdown.

Parameters​

ParameterTypeDefault value
profilePhotometricGridundefined
tiltDegrees?number0

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​

ParameterTypeDefault value
profileIESProfileundefined
horizontalDegrees?number0
tiltDegrees?number0

Returns​

BeamAngles


computePhotometricMetrics()​

function computePhotometricMetrics(profile, tiltDegrees?): PhotometricMetrics;

Parameters​

ParameterTypeDefault value
profileIESProfileundefined
tiltDegrees?number0

Returns​

PhotometricMetrics


toPhotometricDocument()​

function toPhotometricDocument(input, options?): PhotometricDocument;

Parameters​

ParameterType
inputPhotometricInput
options?PhotometryOptions

Returns​

PhotometricDocument


detectPhotometricFormat()​

function detectPhotometricFormat(text, format?): "ldt" | "ies";

Detect IES by its version/TILT declaration; otherwise choose line-oriented EULUMDAT.

Parameters​

ParameterType
textstring
format?"ldt" | "ies"

Returns​

"ldt" | "ies"


parsePhotometry()​

function parsePhotometry(
text,
format?,
options?
): PhotometricDocument;

Parameters​

ParameterType
textstring
format?"ldt" | "ies"
options?PhotometryOptions

Returns​

PhotometricDocument


toIESProfile()​

function toIESProfile(input, options?): ConversionResult<IESProfile>;

Obtain an IES-compatible profile. Unsupported coordinate transformations throw rather than relabeling data.

Parameters​

ParameterType
inputPhotometricInput
options?PhotometryOptions

Returns​

ConversionResult<IESProfile>


serializeIES()​

function serializeIES(input, options?): ConversionResult<string>;

Serialize to LM-63-2002, with all candela/ballast multipliers folded into values exactly once.

Parameters​

ParameterType
inputPhotometricInput
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​

ParameterType
inputPhotometricInput
options?SerializeLDTOptions

Returns​

ConversionResult<string>

Classes​

IESParseError​

Extends​

  • Error

Constructors​

Constructor​
new IESParseError(
message,
code?,
field?,
range?
): IESParseError;
Parameters​
ParameterTypeDefault valueDescription
messagestringundefined-
code?IESDiagnosticCode'IES_PARSE_ERROR'-
field?stringundefined-
range?SourceRangeundefinedWhere the error was detected in the source text.
Returns​

IESParseError

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​
ParameterType
targetObjectobject
constructorOpt?Function
Returns​

void

Inherited from​

Error.captureStackTrace

prepareStackTrace()​
static prepareStackTrace(err, stackTraces): any;
Parameters​
ParameterType
errError
stackTracesCallSite[]
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​
ParameterTypeDescription
messagestring-
range?SourceRangeWhere the error was detected in the source text, when parsing.
Returns​

LDTParseError

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​
ParameterType
targetObjectobject
constructorOpt?Function
Returns​

void

Inherited from​

Error.captureStackTrace

prepareStackTrace()​
static prepareStackTrace(err, stackTraces): any;
Parameters​
ParameterType
errError
stackTracesCallSite[]
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​

PropertyTypeDescription
codeIESDiagnosticCode-
severity"warning" | "error" | "info"-
messagestring-
field?string-
range?SourceRangeSource location, when the diagnostic came from parsing text (not from a profile built in memory).

IESValidationOptions​

Properties​

PropertyTypeDescription
strict?booleanWarnings make valid=false. Their original severity remains unchanged; info never fails validation.

IESValidationResult​

Properties​

PropertyType
validboolean
profileIESProfile | null
diagnosticsIESDiagnostic[]

IESTilt​

Embedded LM-63 lamp tilt correction. Angles are degrees; factors are dimensionless.

Properties​

PropertyType
geometrynumber
anglesnumber[]
factorsnumber[]

IESProfile​

Properties​

PropertyTypeDescription
versionstring-
metadataRecord<string, string>-
lampCountnumber-
lumensPerLampnumber-
candelaMultipliernumber-
photometricTypenumber-
units"meters" | "feet"-
dimensionsobject-
dimensions.widthnumber-
dimensions.lengthnumber-
dimensions.heightnumber-
ballastFactornumber-
ballastLampPhotometricFactornumberRaw second field: multiplier in 1986/1991, reserved in 1995/2002, generation code in 2019.
fileGenerationType?numberLM-63-2019 provenance code, not an intensity multiplier. Absent in earlier editions.
inputWattsnumber-
verticalAnglesnumber[]-
horizontalAnglesnumber[]-
candelaValuesnumber[][]Horizontal-major values in candela, with candela and ballast multipliers applied.
tiltIESTilt | null-

PhotometryDiagnostic​

Extends​

Properties​

PropertyTypeDescriptionInherited from
severity"warning" | "error" | "info"-IESDiagnostic.severity
messagestring-IESDiagnostic.message
field?string-IESDiagnostic.field
range?SourceRangeSource location, when the diagnostic came from parsing text (not from a profile built in memory).IESDiagnostic.range
codestring--

PhotometrySourceDescription​

Properties​

PropertyTypeDescription
validboolean-
profileIESProfile | LDTProfile | null-
diagnosticsPhotometryDiagnostic[]-
fieldsSourceField[]Described source tokens and lines in document order. Partial when the text is invalid.

PhotometryInspection​

Extends​

  • Omit<CoreSummary, "lampCount" | "lumensPerLamp" | "inputWatts" | "peakCandela">

Properties​

PropertyTypeDefault valueDescriptionInherited from
formatstring'IES LM-63'-Omit.format
versionstringprofile.version-Omit.version
metadataRecord<string, string>profile.metadata-Omit.metadata
photometricTypenumberprofile.photometricType-Omit.photometricType
photometricTypeNamestring...-Omit.photometricTypeName
photometrystring...-Omit.photometry
lightSourcestring...-Omit.lightSource
lampCatalogstring...-Omit.lampCatalog
luminairestring...-Omit.luminaire
manufacturerstring...-Omit.manufacturer
verticalAnglesnumberprofile.verticalAngles.length-Omit.verticalAngles
horizontalAnglesnumberprofile.horizontalAngles.length-Omit.horizontalAngles
units"meters" | "feet"profile.units-Omit.units
dimensionsobjectprofile.dimensions-Omit.dimensions
dimensions.widthnumberundefined--
dimensions.lengthnumberundefined--
dimensions.heightnumberundefined--
hasTiltboolean...-Omit.hasTilt
fileGenerationTypenumber | null...-Omit.fileGenerationType
sourceFormatInputFormatundefined--
lampCountnumber | nullundefined--
lumensPerLampnumber | nullundefined--
inputWattsnumber | nullundefined--
peakCandelanumber | nullundefined--
selectedLampSetIndexnumber | nullundefined--
lampSetsPhotometricLampSet[]undefined--
declaredLuminaireFluxLumensnumber | nullundefined--
diagnosticsPhotometryDiagnostic[]undefined--
metricsSupportedbooleanundefined-Omit.metricsSupported
metricsUnsupportedReasonstring | nullundefined-Omit.metricsUnsupportedReason
declaredLampFluxLumensnumber | nullundefinedLamp rating × lamp count, not measured luminaire output. Null for absolute photometry.Omit.declaredLampFluxLumens
integratedFluxLumensnumber | nullundefinedEstimated luminaire output integrated from the angular intensity table.Omit.integratedFluxLumens
luminousEfficacyLumensPerWattnumber | nullundefinedIntegrated luminaire flux / declared input watts. Null for zero power or unsupported type.Omit.luminousEfficacyLumensPerWatt
beamAnglesBeamAngles[]undefinedPrincipal-plane estimates, not a certification of nominal beam axis or global extrema.Omit.beamAngles
metricsTiltDegreesnumberundefinedLamp tilt applied to the intensity table when computing metrics (default 0°).Omit.metricsTiltDegrees
downwardFluxLumensnumber | nullundefinedIntegrated flux below the horizontal (γ = 0…90°).Omit.downwardFluxLumens
upwardFluxLumensnumber | nullundefinedIntegrated flux above the horizontal (γ = 90…180°).Omit.upwardFluxLumens
peakIntensityCandelanumber | nullundefinedLargest tabulated intensity after lamp tilt. Named apart from the summary's raw-table peakCandela.Omit.peakIntensityCandela
peakDirection| { horizontalDegrees: number; verticalDegrees: number; } | nullundefinedFirst tabulated direction holding PhotometricMetrics.peakIntensityCandela.Omit.peakDirection
nadirCandelanumber | nullundefinedIntensity straight down (γ = 0).Omit.nadirCandela
lightOutputRationumber | nullundefinedLight output ratio: integrated luminaire flux / declared lamp flux. Null without a lamp rating.Omit.lightOutputRatio
downwardLightOutputRationumber | nullundefinedDownward luminaire flux / declared lamp flux.Omit.downwardLightOutputRatio
upwardLightOutputRationumber | nullundefinedUpward luminaire flux / declared lamp flux.Omit.upwardLightOutputRatio
downwardFluxFractionnumber | nullundefinedDownward flux fraction (DFF): downward / total luminaire flux.Omit.downwardFluxFraction
cieFluxCode| [number | null, number | null, number | null, number | null, number | null] | nullundefinedCIE 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
zonalLumensZonalLumens[] | nullundefinedIntegrated flux in standard polar zones.Omit.zonalLumens

LDTLampSet​

EULUMDAT fields follow DIAL's published format description, independently implemented here.

Properties​

PropertyTypeDescription
lampCountnumberNegative for absolute photometry; positive for relative photometry.
descriptionstring-
totalLumensnumber-
colorTemperaturestring-
colorRenderingstring-
wattsnumber-

LDTDimensions​

Properties​

PropertyType
widthnumber
lengthnumber
heightnumber

LDTProfile​

Properties​

PropertyTypeDescription
format"ldt"-
identificationstring-
typeIndicator1 | 2 | 3-
symmetry0 | 1 | 2 | 3 | 4-
cPlaneSpacingnumber-
gammaSpacingnumber-
reportNumberstring-
luminaireNamestring-
luminaireNumberstring-
fileNamestring-
dateUserstring-
luminaireLDTDimensionsNative millimeters; the luminous area is distinct from the luminaire body.
luminousAreaobject-
luminousArea.widthnumber-
luminousArea.lengthnumber-
luminousArea.heights[number, number, number, number]-
downwardFluxFractionnumber-
lightOutputRationumber-
conversionFactornumber-
measurementTiltnumber-
lampSetsLDTLampSet[]-
directRatiosnumber[]-
cAnglesnumber[]Full C grid, including angles whose intensities are reconstructed using symmetry.
gammaAnglesnumber[]-
intensitiesnumber[][]Native cd/klm, measured planes only, in the order specified by Isym.

BeamAngles​

Properties​

PropertyTypeDescription
horizontalDegreesnumberOpposed-plane cut C-h / C-(h+180); full angle around the cut's peak, in degrees.
peakDirectionDegreesnumber-
peakCandelanumber-
beamAngleDegreesnumber | nullNearest measured 50%-peak crossings bracketing the dominant lobe; null if not both present.
fieldAngleDegreesnumber | nullNearest measured 10%-peak crossings bracketing the dominant lobe; null if not both present.
beamAngleStatusBeamAngleStatus-
fieldAngleStatusBeamAngleStatus-
beamLeftDegrees?numberSigned vertical angle of the 50% crossing below the peak (negative = opposite C-plane). Absent when not bracketed.
beamRightDegrees?numberSigned vertical angle of the 50% crossing above the peak. Absent when not bracketed.
fieldLeftDegrees?numberSigned vertical angle of the 10% crossing below the peak. Absent when not bracketed.
fieldRightDegrees?numberSigned vertical angle of the 10% crossing above the peak. Absent when not bracketed.

PhotometricMetrics​

Properties​

PropertyTypeDescription
metricsSupportedboolean-
metricsUnsupportedReasonstring | null-
declaredLampFluxLumensnumber | nullLamp rating × lamp count, not measured luminaire output. Null for absolute photometry.
integratedFluxLumensnumber | nullEstimated luminaire output integrated from the angular intensity table.
luminousEfficacyLumensPerWattnumber | nullIntegrated luminaire flux / declared input watts. Null for zero power or unsupported type.
beamAnglesBeamAngles[]Principal-plane estimates, not a certification of nominal beam axis or global extrema.
metricsTiltDegreesnumberLamp tilt applied to the intensity table when computing metrics (default 0°).
downwardFluxLumensnumber | nullIntegrated flux below the horizontal (γ = 0…90°).
upwardFluxLumensnumber | nullIntegrated flux above the horizontal (γ = 90…180°).
peakIntensityCandelanumber | nullLargest tabulated intensity after lamp tilt. Named apart from the summary's raw-table peakCandela.
peakDirection| { horizontalDegrees: number; verticalDegrees: number; } | nullFirst tabulated direction holding PhotometricMetrics.peakIntensityCandela.
nadirCandelanumber | nullIntensity straight down (γ = 0).
lightOutputRationumber | nullLight output ratio: integrated luminaire flux / declared lamp flux. Null without a lamp rating.
downwardLightOutputRationumber | nullDownward luminaire flux / declared lamp flux.
upwardLightOutputRationumber | nullUpward luminaire flux / declared lamp flux.
downwardFluxFractionnumber | nullDownward flux fraction (DFF): downward / total luminaire flux.
cieFluxCode| [number | null, number | null, number | null, number | null, number | null] | nullCIE 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).
zonalLumensZonalLumens[] | nullIntegrated flux in standard polar zones.

ZonalLumens​

Properties​

PropertyTypeDescription
fromDegreesnumber-
toDegreesnumber-
lumensnumber-
percentOfLampnumber | nullPercentage of declared lamp flux; null without a lamp rating.
percentOfLuminairenumber | nullPercentage of integrated luminaire flux; null when the luminaire emits nothing.

FluxBreakdown​

Properties​

PropertyTypeDescription
totalnumber-
downwardnumberFlux below the horizontal, γ = 0…90°.
upwardnumberFlux above the horizontal, γ = 90…180°.
cumulativenumber[]cumulative[g] is the flux from γ = 0 to γ = g degrees, g = 0…180.

ConversionWarning​

Properties​

PropertyType
codestring
category"metadata" | "geometry" | "photometry"
messagestring

ConversionResult​

Type Parameters​

Type Parameter
T

Properties​

PropertyType
valueT
warningsConversionWarning[]

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​

Properties​

PropertyTypeDescriptionInherited from
lampCountnumberNegative for absolute photometry; positive for relative photometry.LDTLampSet.lampCount
descriptionstring-LDTLampSet.description
colorTemperaturestring-LDTLampSet.colorTemperature
colorRenderingstring-LDTLampSet.colorRendering
wattsnumber-LDTLampSet.watts
totalLumensnumber | nullNull when absolute flux cannot be integrated in an unsupported coordinate system.-

PhotometricDocument​

Properties​

PropertyTypeDescription
sourceFormat"ldt" | "ies"-
selectedLampSetIndexnumber | null-
profileIESProfile-
lampSetsPhotometricLampSet[]-
geometryobject-
geometry.luminaireLDTDimensions | null-
geometry.luminousOpeningLDTDimensions-
geometry.luminousHeights[number, number, number, number] | null-
sourceIESProfile | LDTProfileNative fields are retained, including fields the target format cannot represent.

PhotometryOptions​

Extended by​

Properties​

PropertyTypeDescription
lampSetIndex?numberRequired for multiple LDT lamp configurations; alternatives are never implicitly summed.

SerializeLDTOptions​

Extends​

Properties​

PropertyTypeDescriptionInherited from
lampSetIndex?numberRequired for multiple LDT lamp configurations; alternatives are never implicitly summed.PhotometryOptions.lampSetIndex
luminousFlux?numberExplicit normalization flux when the IES document does not supply usable lamp lumens.-
tiltDegrees?numberBake 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​

PropertyType
linenumber
startnumber
endnumber

SourceField​

A described piece of source text, for hover help and outlines.

Extends​

Properties​

PropertyTypeDescriptionInherited from
linenumber-SourceRange.line
startnumber-SourceRange.start
endnumber-SourceRange.end
namestringShort label. Every element of a repeated array shares one name, such as "Vertical angles".-
descriptionstring--

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​

NameType
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​

NameType
lampCountreadonly ["Number of lamps", "Number of lamps in the luminaire"]
lumensPerLampreadonly ["Lumens per lamp", "Rated lumens per lamp; -1 means absolute photometry"]
candelaMultiplierreadonly ["Candela multiplier", "Multiplier applied to every candela value"]
verticalCountreadonly ["Number of vertical angles", "Count of vertical angles in the table"]
horizontalCountreadonly ["Number of horizontal angles", "Count of horizontal angles in the table"]
photometricTypereadonly ["Photometric type", "1 = Type C, 2 = Type B, 3 = Type A"]
unitsreadonly ["Units type", "Units for the luminous opening: 1 = feet, 2 = meters"]
widthreadonly ["Width", "Width of the luminous opening; negative values describe round shapes"]
lengthreadonly ["Length", "Length of the luminous opening; negative values describe round shapes"]
heightreadonly ["Height", "Height of the luminous opening; negative values describe round shapes"]
ballastFactorreadonly ["Ballast factor", "Multiplier applied to every candela value"]
inputWattsreadonly ["Input watts", "Total input power of the luminaire in watts"]
tiltreadonly ["TILT", "Lamp tilt data: NONE, INCLUDE (embedded below) or an external file name"]
tiltGeometryreadonly ["Lamp-to-luminaire geometry", "1 = vertical base-up/down, 2 = horizontal, 3 = horizontal tilted"]
tiltCountreadonly ["Number of tilt angles", "Count of tilt angle and multiplying factor pairs"]
tiltAnglereadonly ["Tilt angles", "Lamp tilt angle in degrees"]
tiltFactorreadonly ["Tilt multiplying factors", "Candela multiplier at the corresponding tilt angle"]
verticalAnglereadonly ["Vertical angles", "Vertical angle"]
horizontalAnglereadonly ["Horizontal angles", "Horizontal angle"]
candelareadonly ["Candela values", "Candela"]

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.