## 2 Methodology
### Sun Detection
#### 2.2.2. Dome Detection
(**a**) shows the Sun position estimation at the beginning, and (**b**) shows an example of the trajectory of the Sun given by the Pysolar model (blue dots), as well as the trajectory given by the particle filter (green dots). Figure 2.2 Sun trajectory and distance between trajectories. Figure 2.3 Representative examples of cloudy day conditions. (**a**) shows an image taken at 10:00, while (**b**,**c**) show an image taken at 12:15 and 14:00, respectively. The system attempts to follow the Sun using the computed estimated position until the system is able to segment the Sun. This is done because it is very important to know the position at any moment. However, given that the projected position is just an approximation, we improve it once the system is able to detect the Sun in the segmentation process, as is shown in Figure 2.4

By adding this strategy to the system, it is possible to have an estimation of the position of the Sun in the image regardless of the occlusions generated by the clouds. In Figure 21, the complete trajectory during the evaluated period of time is shown. It can be observed that there are some positions away from the trajectory; this is due to the cloud that was initially generating an occlusion of the Sun begins to move, so there is an instant where the Sun is partially occluded, and as a consequence, the segmentation process considers these two elements as a single one; however, by using the particle filter, the system avoids this abrupt change. To form a better view of the performance of the system, a video in the three scenarios described above, can be seen online at Supplementary Materials [[https://youtu.be/HY2](https://youtu.be/HY2) plwtBR-4]([https://youtu.be/HY2](https://youtu.be/HY2) plwtBR-4). ### Detection Accuracy

In order to test how accurate the system is, a day in which the system can always detect the Sun has been chosen, then, as reference the position given by the segmentation process, the positions generated by both the particle filter and the Pysolar model position have been compared. In Figure 22, the trajectories of the Sun given by the three proposed strategies are shown. Figure 2.5 Trajectory of the Sun during the evaluated period of time detection. Figure 2.6 Sun detection (red dot), estimation (blue dot), and tracking (green dot). In Figure 23, each of the three trajectories have been plotted to clearly show their behavior. It can be observed that the estimated position (position given by the Pysolar model) diverges considerably from the trajectory of the Sun in the image, while the position given by the particle filter remains close. Nevertheless, as was mentioned before, when the system cannot segment the Sun, the only information it has is the result of the position model. To evaluate the system quantitatively, the solar zenith angle (SZA) has been calculated as follows. From each point (\(P_{dome}\) with coordinates \((x,y)\)) of the positions of the Sun in the dome given by the segmentation process, particle filter and Pysolar model, the distance to the center of the dome has been calculated (this distance is denoted as \(d_{p}\) in Figure 24). Figure 2.7 Trajectory of the Sun during a day where we can always detect it. Figure 2.8 Trajectory of the Sun given by the segmentation process (red dots), the particle filter (green dots), and the estimated position (blue dots), during the day. Then, each of these distances is normalized by dividing them by the radius (defined as \(r_{dome}\) in Figure 24) of the dome. Thus, it is possible to compute the solar zenith angle on a unit sphere according to the following expression,

Figure 2.9

By doing this for the \(N\) Sun's positions given by the segmentation process, the particle filter and the Pysolar model, the set of plots shown in the Figure 25 results. Using the SZA of the segmentation process as the reference, the error from the SZA for both the particle filter and Pysolar model have been calculated.