# Virtual Laboratory for the Full-Field Goniophotometer of Luminaires
## 3 System Design Process
### Handling of Experimental Data  
The light distribution curve is the spatial light intensity distribution of the luminous flux of the luminaire set to 1000 lm. The distribution range of the light distribution curve of incandescent lamps, inflatable lamps, etc. is close to four spaces. However, as the LED is more directional, the light distribution curve of two spaces are few and far between, generally using polar coordinates to represent them.  
The more popular international standards for luminaire light distribution curve file formats are CIBSE TM-14, CIE102, and IESNA LM-63 [12,13], of which IESNA LM-63 is one of the most popular standards, so this paper chose the IESNA LM-63-2002 version, referred to as the IES file [14].  
In the experimental process, first, the user created a folder in unity, imported the IES file, and wrote its path. Second, the user determined whether the file started with 'IESNA:LM-63-2002' as the IES file, then read the data from 'TILT =' as the beginning to read the data, separated by spaces to take out the data in the IES file, and finally, to read the data in the file for the IES file with the specified path. At the same time, due to the wide range of lamps on the market, the data of the horizontal and vertical angles in the IES file also varied, so the values of the last values of the vertical and horizontal angles in the IES file were confirmed by judging them. When the last horizontal angle was less than 360\({}^{\circ}\) and the last vertical angle was less than 180\({}^{\circ}\), the length was expanded to twice the length of the original, and the value was 2 times the last value minus the corresponding angle. To output to a new sample, if it is greater than that, the data were output directly to the new array, and the light intensity value was taken as its corresponding value.  
After unifying the angles, the user compared the size of the horizontal angle with 180\({}^{\circ}\). If it was less than 180\({}^{\circ}\), the horizontal angle was output in a positive order, and the negative vertical angle was output in reverse order. If it was greater than 180\({}^{\circ}\), the negative horizontal angle was output in the positive order and the vertical angle was output in the reverse order. The output horizontal angle was converted so that the angle was controlled within the range of 270\({}^{\circ}\)-360\({}^{\circ}\) (0\({}^{\circ}\))-90\({}^{\circ}\). Next, the angular values of the vertical and horizontal angles were converted into radians to obtain \(\varphi\) and \(\theta\). The radius was normalised to obtain a real-time 3D coordinate map of the light distribution curve through the spherical coordinate system, the flow chart of which is shown in Figure 9. After the 3D coordinates were determined, the light distribution curve was drawn by connecting the start and end coordinates with the defined width and material through the indicator.  
Figure 9: Flow chart of data processing.  
The actual and virtual light distribution curve plotted by the full-field goniophotometer instrument are shown below in Figure 10. The virtual experiment used one turn of the light distribution curve for each accuracy value to adjust using rotation around the C-axis. The second figure shows the light distribution curve plotted at the initial angle of rotation of the luminaire around the C-axis (i.e., zero degrees) with one rotation of the vertical axis. The third figure shows the light distribution curve when the light distribution curve is rotated around the C-axis to 360\({}^{\circ}\), the combination of which is the realistic light distribution curve. Figure 6d is the 3D light distribution model diagram derived from Tracepro, which is the same as the final light distribution curve.