pabopto2bsdf - convert BSDF measurements to a scattering interpolant representation
pabopto2bsdf [ -t ][ -n nproc ][ -s symmetry ][ -g angle | ’A’ ] meas1 meas2 ..
Pabopto2bsdf takes two or more pab-opto Mountain files, each nominally containing different incident beam angles or sampling patterns, and produces a Scattering Interpolant Representation (SIR) on the standard output for further processing. The binary SIR contains a Radial Basis Function fitting each incident BSDF data file and a "transport plan" matrix for each pair of neighboring RBF directions in a spherical Delaunay mesh.
The SIR provides a complete 4-dimensional BSDF description that may be resampled for other formats such as Klems and tensor tree. However, a separate run of pabopto2bsdf is needed to produce an SIR for each incident and scattered hemisphere pair. At most, there will be 4 such hemisphere pairs for front reflection, back reflection, front transmission, and back transmission. Theoretically, only one transmission direction is required, but it is often safest to measure both if they are to be used in a simulation. (See bsdf2klems(1) and bsdf2ttree(1) for details. The bsdf2rad(1) and bsdfview(1) tools are also useful for visualizaing SIR and XML files.)
The pabopto2bsdf -t option reverses the assumed sample orientation front-to-back, and is discussed below under the "#intheta" header entry.
Multi-processing may be used to accelerate the program on systems that support it via the -n option.
BSDF symmetry may be specified with the -s option, which is one of "isotropic", "quadrilateral", "bilateral", "up", or "anisotropic". Any of these may be abbreviated with as little as a single letter, and case is ignored.
Normally, pabopto2bsdf will assume a BSDF symmetry from the incident phi angles provided. If every input data file uses the same incident phi angle, the BSDF is assumed to be "isotropic", or rotationally symmetric. If input phi angles only cover one quarter of the incident hemisphere, then the sample is assumed to have quadrilateral symmetry. Similarly, half-hemisphere coverage implies "bilateral" symmetry, although it is also compatible with "up" symmetry, which must be specified on the command line. The difference is crucial. Similar to quadrilateral symmetry, bilateral symmetry is "mirrored," meaning that the sample material looks identical when viewed in a mirror. However, "up" symmetry means that the sample looks the same when rotated by 180-degree (upside-down), but does not look the same in a mirror. The "up" symmetry was a late addition, and involves rotating and copying the input data, treating the result as anisotropic. It is therefore less efficient, and should only be used when necessary. Finally, if the incident hemisphere is fully covered, the final BSDF is anisotropic.
If a -s symmetry option is specified and it does not agree with the input data provided, an error message is issued and no output is produced. Note that only the "up" and "bilateral" symmetry options have identical input coverage, so this is the only time the -s option must be specified if the default mirroring is not appropriate.
If a -g option is present, it will cull scattered measurements that are nearer to grazing than the given angle in degrees. If the word "auto" (which can be abbreviated as ’a’ or ’A’) is given instead of an angle, then the near-grazing angle will be determined by the lowest incident angle measurement present in the input data. This is sometimes necessary to eliminate noise and edge effects that some measurements exhibit near grazing.
Mountain program, written by Peter Apian-Bennewitz,
stores data taken by his pg2 goniophotometer in separate
BSDF scattering files for each incident angle, beginning
with a header whose lines each start with a pound sign
(’#’). Some header settings require colons and
others do not, as indicated below. The program understands
the following lines from each header and ignores the rest:
A double-quoted string containing the name associated with this sample. If input files contain different sample names, the final sample name read will be the one passed to the SIR output.
The data format, typically one of "theta phi DSF" or "theta phi BSDF". These differ only in their inclusion of a cosine factor. The word "BRDF" or "BTDF" is accepted in place of "BSDF". Any other specification or a format missing generates an error.
The incident theta (polar) angle in degrees, measured from the sample’s surface normal. Theta values should be between 0 and 180, where values less than 90 are considered incident to the "front" side of the sample, and theta values greater than 90 are incident to the "back" side in the standard coordinate system. Notions of "front" and "back" may be reversed using the -t option if desired.
The incident phi (azimuthal) angle in degrees counter-clockwise as seen from the "front" side of the sample.
The incident theta and phi angles are each given in this header line, offered as an alternative to separate "#intheta" and "#inphi" angles. The interpretation is the same as above.
If present, this phi angle that corresponds to the sample "up" orientation. By default, it is assumed to be 0, meaning that "up" is phi=0. To get the standard RADIANCE coordinates for BSDFs, "#upphi" should be set to 90 (degrees).
Two colorimetry values are currently understood: "CIE-Y" and "CIE-XYZ". The default "CIE-Y" colorimetry takes each DSF or BSDF value as photometric. If "CIE-XYZ" is specified, then the DSF or BSDF values must be triplets corresponding to CIE XYZ values. Such files are typically produced by the pabopto2xyz(1) tool rather than Mountain, directly.
The BSDF scattering data follows the header in unspecified order, where each line in the file contains the scattered theta and phi angles measured in the same coordinate system as incident theta and phi, followed by the DSF or BSDF value, which may either be a single photometric quantity for "CIE-Y" colorimetry or a triplet if the colorimetry is "CIE-XYZ". A minimal incident BSDF data file might contain:
#format: theta phi DSF
84.968 125.790 0.009744
84.889 125.610 0.007737
84.805 125.427 0.008569
The above header is equivalent to the more complete version below:
#incident_angle 82.5 180
84.968 125.790 0.009744
84.889 125.610 0.007737
84.805 125.427 0.008569
The ordering of the header and data lines is unimportant, but all header lines must precede all data lines in each input file.
To generate an SIR file from a collection of transmission measurements of a material with 180-degree symmetry using 4 processes:
pabopto2bsdf -n 4 -s up f*_Tvis.txt > front_trans.sir
To combine this with front reflection measurements into a Klems BSDF file:
pabopto2bsdf -n 4 -s up f*_Rvis.txt > front_refl.sir
bsdf2klems front_trans.sir front_refl.sir > Klems_bsdf.xml
If the BSDF is being mirrored and there is no measured theta=0 incident angle data file, this part of the distribution is filled in by a special procedure. This is important because there is no way to extrapolate missing data at normal incidence.
The BSDF is extrapolated past the last measured theta angles towards grazing using a constant value plus a single Gaussian lobe if one can be reasonably fit to the near-grazing data. This lobe will always be in the mirror direction in the case of reflection, or the "through" direction in the case of transmission. The magnitude and width of this lobe is stored in the output header, along with the constant value. Both the lobe and the constant are neutral values, even with CIE-XYZ colorimetry.
While there is no explicit handling of infrared or solar radiometry, any single-channel BSDF will be created the same, and the final XML file generated by bsdf2klems or bsdf2ttree can be edited to specify a different radiometry. The interpolation process in pabopto2bsdf is not affected by this.
The standard BSDF coordinates in RADIANCE have the theta=0 direction corresponding to the front-side surface normal. The phi=0 direction points to the right as seen from the front, and phi=90 degrees corresponds to the "up" orientation for the sample. The same theta and phi are used for incoming and scattered angles, so theta=180 is the opposite side surface normal. This differs from the WINDOW, which use separate coordinate systems for the front and the back. To confusing things further, notions of "front" and "back" are opposite in WINDOW and RADIANCE. In RADIANCE, the normal of a window surface usually faces the interior of a space.
In the genBSDF(1) utility, the world coordinate system follows trigonometric conventions with theta=0 aligning to the Z-axis, the X-axis matches (theta,phi)=(90,0), and the Y-axis corresponds to (theta,phi)=(90,90). The latter is thought of as the "up" direction for the sample. This usually needs to be rotated into position, since most RADIANCE models use the Z-axis as the world "up" direction.
bsdf2klems(1), bsdf2rad(1), bsdf2ttree(1), bsdfview(1), genBSDF(1), pabopto2xyz(1)