This program takes as input a set of trees and a set of light rays and determines, for each ray, which trees intersect it. Light rays are defined by an origin point (x, y, z), an azimuth, and an altitude. The calculations used to determine intersection are the same as used by SORTIE for GLI light calculations. The program takes three files as input: a file with a list of GLI rays for which to find intersecting trees, a file with a list of plot trees, and a file with the parameters for the allometric relationships. It returns an output file listing the intersecting trees for each GLI light ray. All files are tab-delimited text (in table format, with table columns separated by tab characters). All files can have any file extension desired. Header rows for input files are ignored; you can have any text you wish in the header row. However, the position of the columns must always be the same.
Deep calculation details on canopy intersection here.
Trees are modeled as cylinders atop one-dimensional lines. These lines, the trunks, do not intersect light rays. The size and shape of the cylindrical canopy is controlled by the allometry equations. All dimensions are calculated, directly or indirectly, from DBH.
The tree file is the list of plot trees. It has a header row at the top and six columns, which must be in the same order as the example below. Example:
TAG is an identifying code for the tree. It is ignored in the code but is written to the output file. SPP is the species name. It can be any combination of letters and/or numbers. DBH is the tree's DBH, in cm. DAMCODE is the tree's damage code, as an integer. It is ignored in the code but is written to the output file. X is the tree's coordinate along the plot X axis, in meters. Y is the tree's coordinate along the plot Y axis, in meters. The X and Y axes can have any orientation relative to true north, as long as the coordinates are consistent with the GLI light ray points as well.
The GLI ray file is the list of light rays for which to find intersecting trees. It has a header row at the top and seven columns, which must be in the same order as the example below. Example:
Alt is the light ray's altitude angle, in degrees. Azimuth is the light ray's azimuth heading, in degrees. The positive Y axis is zero and azimuth increases in a clockwise direction. Subquad is a location identifier for the ray. It is ignored in the code but will be written to the output file. Light is the light ray's light level. It is ignored in the code but will be written to the output file. X is the light ray origin's coordinate along the X plot axis. Y is the light ray origin's coordinate along the Y plot axis. The X and Y coordinates must match the coordinate system of the trees. Height is the light ray origin's height above the ground, in meters.
The allometry input file lists the contants to be used in the allometric relationships, above. The first two rows contain the X and Y plot lengths, respectively, in the second column. Then there is a header row. Then there are six columns of data, which must be in the same order as the example below. Example:
|X plot length:||320|
|Y plot length:||500|
|Spp||Rad Coeff||Rad Exp||MaxHt||HtConst||Depth coeff|
The plot lengths in the first two rows are in meters. No tree or ray coordinate may be outside these dimensions. The Spp column is the species name. It should match the values in the SPP column of the tree input file. If you do not want to add a row for all possible tree species, you can put in a row with "OTHER" as the species name. This is the set of values that will be used for the allometric equations of tree species that are not explicitly defined in this file. If you do not add an "OTHER" row, you must add a row for every species that appears in the tree input file. Rad Coeff is the tree canopy radius coefficient (R) in the canopy radius equation above. Rad Exp is the tree canopy radius exponent (G) in the canopy radius equation above. MaxHt is the maximum species tree height (M) in the height equation above. HtConst is the height constant (H) in the height equation above. Depth coeff is the canopy depth coefficient (D) in the canopy bottom height equation above.
The output file lists each GLI ray and all the trees that intersect it. Each GLI ray gets one row. The number of columns in the row varies according to the number of intercepting trees. Example:
|ALT||AZIMUTH||SUBQUAD||LIGHT||RAY X||RAY Y||RAY HEIGHT||# INTERCEPTORS||TAG||SPP||DBH||DAMCODE|
The first seven columns are the same as the GLI ray input file. The rays should be listed in the same order as in that file, as well. The next column, # INTERCEPTORS, lists the number of intercepting trees for that ray. Each tree is identified by a quadruple of values. The value in the # INTERCEPTORS column is how many quadruples follow. The quadruples are the same as the first four columns in the tree input file.