(This is the result of far too much time spent with the five versions of the standard for my recent work on ies2rad. I hope it is of interest.)
Overview of the IES file format
Here we offer a summary of the IESNA LM-63 photometry file format
for the perplexed reader. Dear reader, do remember that this is
our interpretation of the five different versions of the standard.
When our interpretation of the standard conflicts with the official
standard, the official document is to be respected. In conflicts
with practice, do take into account the robustness principle and be
permissive, accepting reasonable deviations from the standard.
LM-63 files are organized as a version tag, followed by a series of
luminaire data sets. The luminaire data sets, in turn, are
organized into a label, a tilt data section, and a photometric data
section. Finally, the data sections are organized into records,
which are made up of lines of numeric values delimited by spaces or
commas. Lines are delimited by CR LF sequences. Records are made
up of one or more lines, and every record must be made up of some
number of complete lines, but there is no delimiter which marks the
end of a record. The first records of the tilt and photometric
data sections have fixed numbers of numeric values; the initial
records contain counts that describe the remaining records.
Ies2rad allows only one luminaire data set per file.
The tilt data section is made up of exactly four records; the second gives
the number of values in the third and fourth records.
The photometric data section begins with two records, which give both the
number of records following and the number of values in each of the
Variations among versions of the standard
The original 1986 version of LM-63 does not have a version tag.
The 1986, 1991, and 1995 versions allow 80 characters for the label
lines and the “TILT=” line which begins the tilt data section, and
132 characters thereafter. (Those counts do not include the CR LF
line terminator.) The 2002 version dispenses with those limits,
allowing 256 characters per line, including the CR LF line
terminator. The 2019 version does not specify a line length at
all. Ies2rad allows lines of up to 256 characters and will accept
CR LF or LF alone as line terminators.
In the 1986 version, the label is a series of free-form lines of up
to 80 characters. In later versions, the label is a series of
lines of beginning with keywords in brackets with interpretation
rules which differ between versions.
Tilt Data Section
The tilt data section begins with a line beginning with “TILT=”,
optionally followed by either a file name or four records of
numerical data. The 2019 version no longer allows a file name to
Photometric Data Section
The main photometric data section contains two header records
followed by a record of vertical angles, a record of horizontal
angles, and one record of candela values for each horizontal angle.
Each record of candela values contains exactly one value for each
vertical angle. Data values in records are separated by spaces or
commas. In keeping with the robustness principle, commas
surrounded by spaces will also be accepted as separators.
The first header record of the photometric data section contains
exactly 10 values. The second contains exactly 3 values. Most of
the data values are floating point numbers; the exceptions are
various counts and enumerators, which are integers: the number of
lamps, the numbers of vertical and horizontal angles, the
photometric type identifier, and the units type identifier. In the
2019 version, a field with information about how the file was
generated has replaced a field unused since 1995; it is a textual
representation of a bit string, but may - we hope! - safely be
interpreted as a floating point number and decoded later.