Energy Conversion and Management: X 20 (2023) 100412 Available online 28 June 2023 2590-1745/© 2023 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by- nc-nd/4.0/). A practical method for considering shading on photovoltaics systems energy yield Victor Vega-Garita a,*, Veronica Alpizar-Gutierrez a, Joel Alpízar-Castillo b a University of Costa Rica, Electrical Engineering Department, Costa Rica b Delft University of Technology, Electrical Sustainable Energy, The Netherlands A R T I C L E I N F O Keywords: PV-modeling PV-designing method Shading analysis Skyline A B S T R A C T Along with the widespread adoption of solar energy, it is fundamental to develop methods and tools that help practitioners during the design phase of photovoltaic (PV) systems. Currently, multiple commercial software can quantify a particular location’s annual energy yield while including the horizon’s shading effect (e.g., mountains, buildings, and trees). To do so, precise information about the PV system’s surroundings is necessary. This in- formation is gathered by specialized equipment or by having access to satellite imagery. Therefore, to offer a more practical approach, we propose a method that requires only a cellphone camera, a fixed point for taking a panoramic photograph, and a compass. Once the panoramic image is taken, the obstacles’ width, height, and altitude are calculated, and the skyline is built. With this information, the method correlates the position of the sun with meteorological data to include the effect of shading on direct irradiation. The method was tested using one–year meteorological data to determine the best orientation of a PV system. The image processing method and the general method were validated by getting PV power generation data and aerial images and comparing them to the method’s predictions. Therefore, we introduce a method that, with low computational complexity, facilitates the study of shading on the performance of PV systems. 1. Introduction 1.1. General introduction The transition from a fossil fuel-based economy to a cleaner one is the biggest issue of our time. Energy generation systems must change from centralized plants fed by coal, diesel, or gasoline to plants based on clean energy sources such as solar, wind, or hydroelectric energy. This transition is already happening, as the last year’s new additions to the electricity grid have come from renewable energy in larger quantities compared to the new additions coming from fossil fuels [1]. The use of solar energy to produce electricity is already a feasible replacement option from the technical and economic point of view [2]. This is why solar energy and wind energy projects have been replacing coal-fired plants [3]. In 2021, PV electricity generation increased by 18% [4] compared to the previous year. However, the installed capacity must increase even faster. For this reason, it is fundamental to have easy- to-use engineering designing tools available that help achieve energy transition goals. 1.2. Design tools for PV systems Fig. 1 depicts the inputs needed by PV designing tools and their outputs. Usually, a PV system design tool outputs the sizing of the PV system, i.e., the number of PV modules, power rating of suitable in- verters, and optimal energy capacity of the batteries, in case of PV–battery systems as in [5]. Moreover, PV design tools usually provide an indication of the more beneficial PV system based on financial ana- lyses, where metrics such as payback time and levelized cost of energy are estimated. Similarly, the electrical design, considering cabling, protections, and others to build the PV systems, are results that these tools can provide. Regarding the inputs to the designing tools, a PV system’s location (latitude and longitude) is pivotal as the sun’s trajectory over a year is location-related. Once the coordinates are known, this information is used to obtain the meteorological data that represents the conditions of the place where the PV system is to be installed. The irradiance (G), ambient temperature (Ta), wind speed (u), and cloud cover are the most common variables that influence the performance of a PV system [6]. Another input taken into account is the electrical load profile. It is * Corresponding author. E-mail address: victor.vegagarita@ucr.ac.cr (V. Vega-Garita). Contents lists available at ScienceDirect Energy Conversion and Management: X journal homepage: www.sciencedirect.com/journal/energy-conversion-and-management-x https://doi.org/10.1016/j.ecmx.2023.100412 mailto:victor.vegagarita@ucr.ac.cr www.sciencedirect.com/science/journal/25901745 https://www.sciencedirect.com/journal/energy-conversion-and-management-x https://doi.org/10.1016/j.ecmx.2023.100412 https://doi.org/10.1016/j.ecmx.2023.100412 https://doi.org/10.1016/j.ecmx.2023.100412 http://crossmark.crossref.org/dialog/?doi=10.1016/j.ecmx.2023.100412&domain=pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ http://creativecommons.org/licenses/by-nc-nd/4.0/ Energy Conversion and Management: X 20 (2023) 100412 2 related to the energy consumed by the user. Knowing the electrical load profile is essential as, typically, the objective behind PV systems is to provide a big part of the required energy. Thereby, it indicates the number of PV panels needed. Also, the surroundings of the PV system site have to be included as input into the designing tool, as mountains, trees, buildings, and other objects might block the direct light coming from the sun, reducing the amount of energy that can be converted into electricity. Sometimes the effect of the PV systems horizon is not included in the performance analysis. Consequently, systems produce less energy on the field than predicted, resulting in undersized PV systems. 1.3. Horizon study methods Various methods are available to include the effect of the horizon on the PV system’s performance. They can be categorized into the following three groups: a. Aerial imagery: includes the different techniques currently used for getting images from above the ground. Airborne LiDAR (light detection and ranging) measurements is a technique from which it is possible to obtain digital surfaces representing the topography of the sites being studied [7]. With this information, a solar calculator, and meteorological data, it is possible to study the solar energy potential of a particular area [8]. The LiDAR method allows for studying relatively large surfaces, which is very important for defining the potential of solar generation in urban areas. Although LiDAR can be used for analyzing large surfaces, the level of detail provided by this technique usually is not enough to study individual buildings [9]. Also, satellite imagery from Google Earth © has been taken as an input in [10], where it was found that edges recognition was complex due to the problems when trying to identify sunny sides or dark sides of roofs as the images can be taken under not favorable illumination conditions. b. 3D modeling: this approach consists of constructing a 3D repre- sentation of the site where the PV systems will be located. For doing so, multiple approaches have been followed, such as the previously mentioned LiDAR via 3D point cloud data of the surveyed elements [11]. Alternatively, 3D reconstructions can be obtained from geographical databases of city models, also called 3D-GIS [12]. A building information modeling (BIM) has been adopted in [13], i.e., the location, shape, and obstacles referred to a building to utilize or reuse the information generated during the planning and design faces of a construction project. It can correlate the dimensions of a building with the photovoltaic generation. Moreover, 3D modeling software such as Trimble Sketchup © has been coupled to a PV database to perform an economic study to evaluate its economic feasibility [14]. c. Hemispherical capturing devices: this category includes devices that can get a 360◦ view of the surroundings. For this purpose, one alternative is to manufacture half of a sphere made or covered by a metal that reflects the light to a camera, as the device called Hori- catcher © [15]. A camera captures the image from the horizon mirror, which is later digitally processed and fed into software to include shadowing effects. Similarly, the Solar Pathfinder © in- corporates the effect of shadows for the other months of the year, as the solar position plays a vital role during summer, where the sun lasts longer and higher in the sky compared to winter where the opposite behavior is observed [16]. In this method, there is no image processing of the picture taken, and the analysis is done manually, which means it can not be included in a model directly. This can be seen as a drawback of the method. Lastly, another company has developed the Sun eye ©. It consists of a device with a fish eye camera that could get a complete view of the surroundings to determine the shading patterns of the installation site. At the same time, the image can be expressed in terms of azimuth and sun elevation to create a shading profile [17]. The methods mentioned previously have been demonstrated to be effective for estimating solar potential or performing shading analysis. Nevertheless, everyone is appropriate according to the purpose of the analysis being carried out. For instance, studies based on high-resolution LiDAR are used to study the solar energy potential of specific areas, resulting in very good estimations, as reported in [18]. However, the input data for these studies usually is challenging to find or expensive [19]. In contrast, satellite imagery is more common and highly avail- able, allowing more extended coverage than LiDAR [20]. Similarly, 3D- GIS is considered by [12] as a more appropriate method than LiDAR for urban environments. 3D modeling for cities or small regions is difficult to reproduce, and the complexity of the analysis increases considerably when coupled with ray-casting. This technique could be insightful when quantifying solar energy potential, but it is often computationally demanding, restricting its usage for analyzing vast areas [21]. Typically, these methods are developed for already existing buildings; however, some researchers have created tools that enable the analysis of solar energy potential for recently constructed buildings or to be erected [22]. Additionally, hemispherical capturing devices are the best option for site–specific shading analysis of particular houses or buildings. For instance, the effect of trees, near buildings, and other landscape features can be included precisely in PV designing software. The main disad- vantage of the hemispherical capturing devices is the access to special- ized proprietary equipment –as introduced in SubSection 1.3 c.. To overcome this need, approaches using widely-available smartphones to gather images that are later processed by specialized algorithms have been reported in the literature. In [23], a smartphone was coupled with a fish–eye lens, from which, after digital processing, a shading correc- tion factor is extracted. Similarly, a commercially available smartphone was utilized to capture images as a low-cost technique in [24]. Also, a smartphone-based shade analysis was presented in [25], where a panoramic image (360◦) was the base to produce a shading diagram after the pre-processing, segmentation, and extraction steps. Once these steps were carried on, the sun position was imported and correlated with the image. The procedure to arrive at the images’ alti- tude and azimuth were vaguely discussed, and the issues caused by the clouds and other features on the images needed to be covered. More- over, how the data from the horizon line is linked to PV power estima- tions is still being determined. Moreover, information retrieved from a smartphone sensor (such as orientation) was an input to generate an image from which it was possible to determine the altitude and azimuth of the objects that are part of an image [26]. However, how the sensors’ data was processed and used to construct the horizon line is unclear. Additionally, the Fig. 1. Diagram of a generic PV designing tool. V. Vega-Garita et al. Energy Conversion and Management: X 20 (2023) 100412 3 method uses partial images, and the total shading effect of the buildings and obstacles can only partially be incorporated into the simulations. Therefore, in this paper, we proposed a detailed approach that ac- counts for the losses of PV generation due to shading by using a pano- ramic image (360◦) taken by a cellphone, from which a skyline is extracted and fed as an input to a model to accurately estimate the en- ergy yield of a specific PV system orientation. Also, the method can be used to find the best PV tilt and azimuth to obtain the highest possible energy yield for a particular skyline. 1.4. Contributions As a consequence, this research paper contributes towards: 1. elaborating a simple method to incorporate the effect of shading over the performance of PV systems using a simple cellphone panoramic image; 2. assessing the reduction of energy generation due to shading on PV systems via a skyline analysis; 3. proposing a validated method to evaluate the best orientation of PV systems in cases where multiple obstacles reduce the PV energy yield. 2. The proposed method The method introduced in this article connects different models with the final objective of estimating the power generation of a PV system under shading conditions that result in the highest energy yield. To accomplish that, meteorological data, location information, and a panoramic image of the installation site are used as inputs. At the same time, the sun path is calculated to identify the moments during the day when the direct light is blocked by the obstacles identified during the digital image processing stage. The interrelation of the different stages is graphically depicted in Fig. 2 and explained in more detail below. 2.1. Inputs to the model The inputs to the models can be divided into three categories: loca- tion and orientation of the PV system, surroundings of the panoramic image, and meteorological data. 2.1.1. Location and orientation of the studied PV system The PV system’s latitude, longitude, and time zone are needed for calculating the sun’s position, which is expressed in terms of altitude as and azimuth As every time step. We used the solar calculator [27]. In this case, we used a latitude of 9.9369◦ and a longitude of − 84.0460◦ that represents the location of the Escuela de Ingeniería Eléctrica, EIE, of the University of Costa Rica, while the time zone is coordinated universal time minus six hours (UTC − 6). The goal of the proposed method is to find the inclination (amop ) and azimuth (Amop ) of the PV array that results in the highest energy yield; therefore, the model iteratively changes both values (Am and am) to find the combination that gives the highest irra- diation over the plane of array (Gm) annually. 2.1.2. Surrounding image A panoramic image of the PV system surroundings is later processed to estimate the buildings’ physical dimensions (see Fig. 4a). It is important to point out that the image was taken with a cellphone standing on a tripod to get a uniform view of the horizon. The used cellphone had a focal distance of 18 mm (dfocal) with a 35 mm sensor height (hsensor), and it was located 120 cm from the roof (and at 5 m from the ground, Hc,m) in a completely horizontal position. Also, the image started with the cellphone completely facing north, for which a digital compass was used. 2.1.3. Meteorological data To include the interdependency between the climate conditions and solar energy generation, meteorological data for one year was retrieved using the software Meteonorm ©. Variables such as direct normal irra- diance (DNI), diffuse horizontal irradiance (DHI), global horizontal irradiance (GHI), ambient temperature (Tamb), and wind speed (Ws) were gathered and used to calculate the temperature of the PV module, and at the end, the PV power output of the system (see Section 2.3). 2.2. Digital image processing In general terms, it is necessary to extract the height (Hest) of the obstacle, width (West) of the obstacle, and the distance from the camera to the obstacle (d), as illustrated in Fig. 3a. These variables are later expressed in terms of azimuth (Ao) and altitude angles (ao). With that information, it is possible to construct the skyline defined by the ob- stacles, helping to establish the times when the sun is under the skyline, causing a decrease in the total irradiance received by the PV system. 2.2.1. Obstacles sizing Firstly, it is important to remember that the information extracted from images is expressed in pixels. Therefore, a correlation between pixels and the real dimensions of the objects must be done, as introduced in the following equation: Ho,m Ho,p = Hc,m Hc,p , (1) where, Ho,m is the height of the reference object in meters, Ho,p is the height of the reference object in pixels, Hc,m is the height of the camera in meters, and Hc,p is the height of the camera in pixels. In this case, the reference object closest to where the image was taken was the A/C condenser in Fig. 4a, which has a height of 85 cm. As described in Section ??, the highest position (Hh,p) of the objects Fig. 2. Proposed method to determine the optimum orientation of a PV system for obtaining the maximum energy yield considering shading from obstacles. V. Vega-Garita et al. Energy Conversion and Management: X 20 (2023) 100412 4 can be extracted using image processing, so with this information and with a ground reference (Hg), the height of the object in pixels is calculated as follows: Ho,p = Hg − Hh,p. (2) The horizon line (LH) can be estimated using LH = Href,l,point − Hc,p, (3) Hdif,p = |LH − Hg|, (4) being Href,l,point the lowest point of the reference object in pixels (lowest part of the A/C condenser), Hc,p is the height of the camera in pixels, Hdif,p is the difference between the horizon line and the lowest point of the object of interest in pixels Hg. The distance from the camera to an object can be calculated using the focal distance of the camera (dfocal), the height of the camera from the ground in meters (Hc,m), the total height of the image in pixels (Hi,p), the camera sensor size in mm (hsensor), as presented in the following equation and reported in [28]: Fig. 4. Image processing steps followed to get a segmented image representing a skyline. V. Vega-Garita et al. Energy Conversion and Management: X 20 (2023) 100412 5 d = dfocalHc,mHi,p hsensorHdif,p . (5) Once the distance from the camera to the obstacles is known, the height of the obstacles can be estimated. The objects height (Hest) is calculated as follows: Hest = Hc,m +m tan(ρ)d, (6) α = arctan ( Hc,m d ) , (7) ρ = ⃒ ⃒Hdif,p − Ho,p ⃒ ⃒ Hdif,p α, (8) where m is a conditional variable that can take as a value 1 when Hdif,p > Ho,p or − 1 if Hdif,p < Ho,p, ρ corresponds to the angle described by the distance between the horizon line and the highest point of the object of interest, while α is the angle between the horizon line and the lowest point of the object of interest, as shown in Fig. 3b. The width of the obstacles (West) is estimated following the scheme introduced in Fig. 3c and calculated using West = Xf − Xi = Hc,m ( 1 tan(β) − 1 tan(δ) ) , (9) as illustrated in Fig. 3c, δ is the angle related to the width of the object in pixels (Wo,p), and α is the angle associated with distance in pixels from the left edge of the image to the beginning of the object (Wo,p,i). Finally, the altitude can be defined after extracting the height, width, and depth of the obstacles. The altitude of any object of interest in an image is given by ao = arctan ⎛ ⎜ ⎝ Hest ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅ W2 est + d2 √ ⎞ ⎟ ⎠. (10) For estimating the azimuth of the image, the 360◦ are divided by the total amount of pixels, making it possible to correlate pixel numbers and cardinal points. Thus, 0◦ is related to the north and the 360◦, being a reference for the starting and ending points of the panoramic image. Therefore, half of the totality of pixels corresponds to the south, while the first quarter, from left to right in Fig. 4d, is assigned to the east and the third quarter to the west. 2.2.2. Skyline construction Edge detection is crucial in digital image processing. It allows one to filter out the features that are not interesting in an image. However, this task is complex, as physical edges often do not necessarily result in an edge in a processed image. For this reason, in this paper, we used a gradient detection technique that helps identify edges while using the Sobel method for noise reduction, as suggested in [29]. Doing so pro- duces a binary mask (Fig. 4b). Then, a closing morphological operation using a rectangular element shape is performed to maintain the usual rectangular form of buildings. Once the surfaces are closed, the part of the image where holes are detected is filtered out (Euler number is 1). As a consequence, the effect of the clouds is removed (Fig. 4c). The skyline results from the pixels with the highest values in terms of height, as depicted in Fig. 4d. Eq. 10 is used to convert pixels corre- sponding to the height into altitude. Then, the conversion from width in pixels to azimuth is calculated, establishing the relationship between the total pixels in axis x and the cardinal points associated with the pano- ramic image. By doing so, Fig. 4e can be constructed, and the profile defined by the obstacles can now be correlated to the sun’s path for a specific study period. In this manner, the times when the buildings block the sun are determined. To demonstrate the method, the solstices and equinoxes for the Fig. 3. (a) General scheme showing the three basic variables needed to construct the skyline, (b) scheme of the angles (α and ρ) and distances to obtain the height of the object, (c) scheme of the angles (δ and β) and distances to obtain the width of the object. V. Vega-Garita et al. Energy Conversion and Management: X 20 (2023) 100412 6 selected site are depicted, showing, as expected, the lower altitude during the winter (December) and the highest in summer (July), as the location of analysis is slightly above the equator. These results also explain the sun’s movement from the east side to the west side, passing through the north (21/12/2020) during the summer solstice instead of passing through the south, as happens with the other dates and illus- trated in Fig. 4e. The equinoxes, however, are similar in altitude and azimuth for the time frame chosen. 2.3. PV modeling The PV modeling model considers the sun’s position every time step as thoroughly documented in [27]. This information is fed into an iterative process in which the orientation (tilt and azimuth) is changed to find the combination that gives the highest energy yield for the given annual meteorological data. It is fundamental to state that the obstacles profile is considered at this stage. For getting the annual energy yield, the irradiance over the PV module (Eq. 11f) must be integrated over a year, according to Eq. 11g. The set of equations we used to model the PV generation and arrive at Em and Gm is as follows cos(θ) = cos(am)cos(as)cos(Am − As)+ sin(am)sin(as), (11a) Gdirect = GNIcos(θ) Sfactor, (11b) Vsky,factor = (1+ cos(θm)) / 2, (11c) Gdiffuse = DHI Vsky,factor, (11d) Greflected = GHI α (1 − Vsky,factor), (11e) Gm = Gdirect +Gdiffused +Greflected, (11f) Em = ∫ tf ti Gm dt, (11g) where cosθ is the angle of incidence, Gdirect is the direct light, Sfactor is the shading factor (Sfactor = 1 when no shading, and Sfactor = 0 when shading), Vsky,factor is the sky view factor Gdiffused light, and Greflected is the reflected light from the surroundings (e.g., buildings and windows), and α is the albedo coefficient that depends on the location of the PV system analyzed (considered 0.2 in this paper). Once the irradiance over the module is obtained, knowing the area of the module, and the efficiency, the power of the PV module can be calculated as PPV = GmAPVηpv. (12) In Eq. 12, ηPV is the efficiency of the PV module. In this paper, the efficiency and its relationship to module temperature are captured by the thermal model proposed by Duffie and Beckman, which takes as inputs the ambient temperature and wind speed. This iterative model considers the heat losses by convection from the PV modules to the environment [30]. It gives the module temperature (Tm) that is later utilized to calculate the PV module efficiency as a function of temper- ature and irradiance by using the following expression: ηPV = ηSTC(1+ β(Tm − TSTC)), (13) being ηSTC the efficiency at standard test conditions, β is a constant normally reported as − 0.0035/◦C for crystalline silicon, and TSTC the module temperature at standard test conditions. 3. Results In this Section, we validate the proposed digital image processing method by comparing measured and estimated dimensions. Also, there is an analysis of the optimal location of a PV system, taking into account the influence of the skyline. Finally, we verify the results given by the proposed method by analyzing PV generation data and aerial images. Fig. 5. Image processing validation using two objects of known dimensions. Table 1 Dimensions of the chosen objects compared to the estimations made by the digital image processing method. Object Depth Height Width Real Estimated % Error Real Estimated % Error Real Estimated % Error (m) (m) (m) (m) (m) (m) 1 14.90 14.77 0.87 2.1 2.09 0.48 2.06 2.04 0.97 2 1.38 1.39 0.72 1.13 1.11 1.77 0.13 0.12 7.69 V. Vega-Garita et al. Energy Conversion and Management: X 20 (2023) 100412 7 3.1. Validation of the digital image processing method As indicated in Fig. 5, two objects were chosen to compare the measured width (W), height (H), and depth (d) to the values calculated by the digital image processing method. Object 1 is a post relatively close to where the image was taken, while object 1 is the red door far away into the building crossing the street. Table 1 shows the objects’ real (measured) dimensions, estimated values, and errors for all dimensions of interest. It can be seen that the error is typically below 2%, except for the case where the width of the post (object 2) is estimated. In that case, the error is 7,69 % because the object is in the order of cm, and the camera resolution might introduce a more significant error than wider objects. Based on these results, it can be said that the digital image processing method proposed was validated. 3.2. Optimal orientation of the PV system without shading analysis In this Section, we analyzed the optimum tilt and azimuth of the PV systems that ensure maximum solar radiation over one year. We chose the best combination using an iterative method after changing the tilt and azimuth. Although this article is about shading analysis, deter- mining the optimum orientation with a clean skyline is the benchmark. In Fig. 6a, it can be seen that an azimuth of 200◦ and a PV system tilt of 10.5◦ gives the highest energy per unit of area (1852 kWh/m2). Although the EIE building is not optimally oriented (facing east and with a tilt of 10.5◦), the energy generation is just 2,2% lower than the maximum incident energy, as can also be seen in Fig. 6a. There, it is observed that when module tilting increases, the irradiation reduces; similarly, as the modules are placed far from the south (either to the west or east), the annual energy received by the modules decreases. This is expected as the trends show a typical behavior of a PV system placed north of the equator. 3.3. Optimal position including shading analysis As observed in Fig. 4e, it is essential to include the effect of shading on the module orientation to quantify the amount of direct irradiation lost due to shading provoked by the buildings located at the left and right of the image. This shading fundamentally occurs when the sun is Fig. 6. (a) Optimum orientation of the PV system without shading analysis, and (b) optimum orientation of the PV system after performing a shading analysis at the Escuela de Ingeniería Eléctrica, EIE. Fig. 7. (a) Power generation of the reference PV module for the 21st of June (2020, 2021, and 2022), aerial images for the 21st of June 2022, (b) at 8:00 am, and (c) at 11:30 am. V. Vega-Garita et al. Energy Conversion and Management: X 20 (2023) 100412 8 mainly found to the north (see the black dotted path on the image). Consequently, the energy per unit of area must be lower than what was reported as an optimum in Section 3.2. In fact, not considering the effect of the horizon on energy generation results in an overestimation of 27.3% compared to an analysis that considers the horizon’s impact. The optimum orientation is 190◦ with a PV system tilt of 5.5◦, which yields 1346 kWh/m2 per year. Interestingly, in this case, the orientation of the PV system of the EIE results only in 1% less annual irradiation. From Fig. 6b, it can be seen that the influence of the azimuth on irradiation is relatively small for tilts below 30◦. This results in yearly irradiation close to the optimum, less than 10% in all cases compared to the optimum point. Although the influence of azimuth is not so marked on places close to the equator, as in this case, it is even lower because the obstacles are mainly placed to the north. 3.4. General model verification In order to verify the results obtained by the proposed method, we gather power generation data from a reference PV module (see Fig. 7a) for the same day in three different years (21st of June 2020, 2021, and 2022) and performed a comparison with the expected behavior expressed in Fig. 4e. Also, images taken from a drone, Figs. 7b and 7c, were used to confirm the data shown in Fig. 7a. Firstly, it is important to bear in mind that the expected curve for a clean sky (called reference) represents the maximum power that the reference module (325 Wp) could generate. Indeed, such a curve is rarely obtained, especially in places with tropical weather, as in this case. When analyzing the power generation of the reference module during the summer solstice, it can be seen that between 10:00 – 12:00 am the power generation reduces significantly (see Fig. 7a). This reduction is due to the sudden decrease of direct irradiance over the module. As depicted in Fig. 4e, the shadow from the central tower starts to block the direct light from 10:30 am until the end of the day. Even though the direct light contribution to power generation is negligible, the diffuse and reflected light from the surrounding buildings still provide some irradiance, progressively decreasing as sunset approaches. Also, based on Fig. 4e, before 10:30 am (21/06/2020), the direct light over the reference PV module could be affected by precipitations or even clouds; however, during the morning, there is no adverse effect due to shading as can be observed in Fig. 7b. In Fig. 7c, the shade from the main tower of the building starts to cast over the reference PV module at 11:30. It is essential to point out that the reference PV module was chosen as it is the closest to the shade produced by the main tower, and the effect from shading might occur earlier compared to the other PV modules part of the PV system studied. This is a valid assumption as using other reference PV modules more to the south might instead result in an overestimation of PV generation. Every module of the PV system studied has individual optimizers, so the effect of shading can be studied indi- vidually. Also, the aerial images were captured in 2022, and the analysis done in Fig. 4e was for 2022; however, we observed minor changes in sun movement for the same day according to our sun calculator. 4. Conclusion In this paper, we proposed a practical method for including the effect of the horizon on the construction of a skyline to calculate the energy generation of a PV system accurately. This method takes as inputs the location and timezone of the PV system, meteorological data, and a panoramic image of the horizon surrounding the installation site taken by a cellphone. Using this image, the objects’ height, width, and distance from the camera were determined in pixels and later converted to azi- muth and altitude. Once the skyline was constructed, the solar position was obtained at every time step while incorporating the negative effect of the buildings when blocking the direct light from the PV system. The method could also iterate between various PV orientations (azimuth and inclinations) to determine the case where the maximum energy yield was achieved. Based on the simulations, it was found that not consid- ering the shading effect of the buildings results in an overestimation of 27% on energy generation. Moreover, the optimum orientation of the PV system using the skyline construction method was for an azimuth of 190◦ and a tilt of 5.5◦. The digital image processing method and the general results of the model were validated using real PV generation data and aerial images. Finally, in this article, we have presented a practical method with low computational complexity that can correlate the position of the sun and the skyline to facilitate shading analysis on the performance of PV systems. CRediT authorship contribution statement Victor Vega-Garita: Conceptualization, Methodology, Software, Validation, Writing – original draft, Writing – review & editing, Super- vision. Veronica Alpizar-Gutierrez: Software, Validation, Formal analysis. Joel Alpízar-Castillo: Writing – review & editing, Formal analysis. Declaration of Competing Interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Data availability Data will be made available on request. Acknowledgments The authors thank Harold Moreno for providing the aerial images used to verify the results provided by the proposed method. Moreover, this investigation was carried out under the research project "Detección de fallas, control e integración de sistemas de energías renovables no convencionales con almacenamiento energético para redes inteligentes” number C1467 of the University of Costa Rica. Appendix A. Supplementary data Supplementary data associated with this article can be found, in the online version, at https://doi.org/10.1016/j.ecmx.2023.100412. References [1] IRENA. World Energy Transitions Outlook: 1.5C Pathway (2021). [2] Alpízar-Castillo, J., Ramirez-Elizondo, L. & Bauer, P. Assessing the role of energy storage in multiple energy carriers toward providing ancillary services: A review, doi: 10.3390/en16010379 (2023). [3] United Nations. The Energy Transition, towards the achievement of SDG 7 and Net- zero emissions. UN Energy 2021;157–166. [4] International Energy Agency. Global Energy Review 2021. Global Energy Review 2021;2020:1–36. [5] Narayan N, et al. A modeling methodology to evaluate the impact of temperature on solar home systems for rural electrification, 1–6. (Institute of Electrical and Electronics Engineers Inc.; 2018. https://doi.org/10.1109/ ENERGYCON.2018.8398756. [6] Vega-Garita V, Hanif A, Narayan N, Ramirez-Elizondo L, Bauer P. Selecting a suitable battery technology for the photovoltaic battery integrated module. J. Power Sources 2019;438. https://doi.org/10.1016/j.jpowsour.2019.227011. [7] Lukac N, Seme S, Žlaus D, Štumberger G, Žalik B. Buildings roofs photovoltaic potential assessment based on lidar (light detection and ranging) data. Energy 2014;66:598–609. https://doi.org/10.1016/j.energy.2013.12.066. [8] Redweik P, Catita C, Brito M. Solar energy potential on roofs and facades in an urban landscape. Sol. Energy 2013;97:332–41. https://doi.org/10.1016/j. solener.2013.08.036. [9] Brito MC, Freitas S, Guimarães S, Catita C, Redweik P. The importance of facades for the solar pv potential of a mediterranean city using lidar data. Renewable Energy 2017;111:85–94. https://doi.org/10.1016/j.renene.2017.03.085. V. Vega-Garita et al. https://doi.org/10.1016/j.ecmx.2023.100412 http://refhub.elsevier.com/S2590-1745(23)00068-5/h0015 http://refhub.elsevier.com/S2590-1745(23)00068-5/h0015 http://refhub.elsevier.com/S2590-1745(23)00068-5/h0020 http://refhub.elsevier.com/S2590-1745(23)00068-5/h0020 https://doi.org/10.1109/ENERGYCON.2018.8398756 https://doi.org/10.1109/ENERGYCON.2018.8398756 https://doi.org/10.1016/j.jpowsour.2019.227011 https://doi.org/10.1016/j.energy.2013.12.066 https://doi.org/10.1016/j.solener.2013.08.036 https://doi.org/10.1016/j.solener.2013.08.036 https://doi.org/10.1016/j.renene.2017.03.085 Energy Conversion and Management: X 20 (2023) 100412 9 [10] Palmer, D., Koumpli, E., Cole, I., Gottschalg, R. & Betts, T.A gis-based method for identification of wide area rooftop suitability for minimum size pv systems using lidar data and photogrammetry. Energies 11, 2018, doi: 10.3390/en11123506. [11] Prieto, I., Izkara, J.L. & Usobiaga, E. The application of lidar data for the solar potential analysis based on urban 3d model, 2019, doi: 10.3390/rs11202348. [12] Machete R, Falcão AP, Gomes MG, Rodrigues AM. The use of 3d gis to analyse the influence of urban context on buildings’ solar energy potential. Energy Build. 2018;177:290–302. https://doi.org/10.1016/j.enbuild.2018.07.064. [13] Ning G, et al. Bim-based pv system optimization and deployment. Energy Build. 2017;150:13–22. https://doi.org/10.1016/j.enbuild.2017.05.082. [14] Suárez-García A, et al. Estimation of photovoltaic potential for electricity self- sufficiency: A study case of military facilities in northwest spain. J. Renew. Sustain. Energy 2017;9:053503. https://doi.org/10.1063/1.4995687. [15] Meteonorm. Horicatcher (2022). Accessed on 1 December, 2022. [16] Pathfinder, S. Solar pathfinder (2022). Accessed on 1 December, 2022. [17] Solmetric. Suneye (2022). Accessed on 1 December, 2022. [18] Martín-Jiménez J, Pozo SD, Sánchez-Aparicio M, Lagüela S. Multi-scale roof characterization from lidar data and aerial orthoimagery: Automatic computation of building photovoltaic capacity. Autom. Construct. 2020;109:102965. https:// doi.org/10.1016/j.autcon.2019.102965. [19] Gooding J, Crook R, Tomlin AS. Modelling of roof geometries from low-resolution lidar data for city-scale solar energy applications using a neighbouring buildings method. Appl. Energy 2015;148:93–104. https://doi.org/10.1016/j. apenergy.2015.03.013. [20] Schuffert S, Voegtle T, Tate N, Ramirez A. Quality assessment of roof planes extracted from height data for solar energy systems by the eagle platform. Remote Sens. 2015;7:17016–34. https://doi.org/10.3390/rs71215866. [21] de Vries TN, et al. A quick-scan method to assess photovoltaic rooftop potential based on aerial imagery and lidar. Sol. Energy 2020;209:96–107. https://doi.org/ 10.1016/j.solener.2020.07.035. [22] Kaynak S, Kaynak B, A. Özmen. A software tool development study for solar energy potential analysis. Energy Build. 2018;162:134–43. https://doi.org/10.1016/j. enbuild.2017.12.033. [23] Panão MJO, Carreira RF, Brito MC. Determining the shading correction factor using a smartphone camera with a fisheye lens. Sol. Energy 2019;190:596–607. https://doi.org/10.1016/j.solener.2019.08.047. [24] Jonas, A., Henrik, D. & Jouri, K. Smartphone-based shading analysis using hemispherical fisheye imaging for local solar energy potential (2020). [25] Wakter, S. & Wikerman, F.A novel shade analysis technique for solar photovoltaic systems (2014). [26] Ranalli JA. Solar survey: Development and validation of a smartphone-based solar site assessment tool. Sol. Energy 2015;122:1199–213. https://doi.org/10.1016/j. solener.2015.10.039. [27] Jäger K, Isabella O, Smets AH, Van Swaaij R, Zeman M. Solar Energy: The physics and engineering of photovoltaic conversion, technologies and systems (UIT. Cambridge; 2016. [28] Diamantas, S., Astaras, S. & Pnevmatikakis, A. Depth estimation in still images and videos using a motionless monocular camera. IST 2016–2016 IEEE International Conference on Imaging Systems and Techniques, Proceedings 129–134, 2016, doi: 10.1109/IST.2016.7738210. [29] Alfonso, G., Maria, C.Q., Miguel, C.P., Otto, E.R. & Francisco, L.O. Inteligencia artificial: modelos, técnicas y áreas de aplicación (Thompson, 2003). [30] Duffie JA, Beckman WA. Solar Engineering of Thermal Processes. Wiley; 2013. V. Vega-Garita et al. https://doi.org/10.1016/j.enbuild.2018.07.064 https://doi.org/10.1016/j.enbuild.2017.05.082 https://doi.org/10.1063/1.4995687 https://doi.org/10.1016/j.autcon.2019.102965 https://doi.org/10.1016/j.autcon.2019.102965 https://doi.org/10.1016/j.apenergy.2015.03.013 https://doi.org/10.1016/j.apenergy.2015.03.013 https://doi.org/10.3390/rs71215866 https://doi.org/10.1016/j.solener.2020.07.035 https://doi.org/10.1016/j.solener.2020.07.035 https://doi.org/10.1016/j.enbuild.2017.12.033 https://doi.org/10.1016/j.enbuild.2017.12.033 https://doi.org/10.1016/j.solener.2019.08.047 https://doi.org/10.1016/j.solener.2015.10.039 https://doi.org/10.1016/j.solener.2015.10.039 http://refhub.elsevier.com/S2590-1745(23)00068-5/h0135 http://refhub.elsevier.com/S2590-1745(23)00068-5/h0135 http://refhub.elsevier.com/S2590-1745(23)00068-5/h0135 http://refhub.elsevier.com/S2590-1745(23)00068-5/h0150 A practical method for considering shading on photovoltaics systems energy yield 1 Introduction 1.1 General introduction 1.2 Design tools for PV systems 1.3 Horizon study methods 1.4 Contributions 2 The proposed method 2.1 Inputs to the model 2.1.1 Location and orientation of the studied PV system 2.1.2 Surrounding image 2.1.3 Meteorological data 2.2 Digital image processing 2.2.1 Obstacles sizing 2.2.2 Skyline construction 2.3 PV modeling 3 Results 3.1 Validation of the digital image processing method 3.2 Optimal orientation of the PV system without shading analysis 3.3 Optimal position including shading analysis 3.4 General model verification 4 Conclusion CRediT authorship contribution statement Declaration of Competing Interest Data availability Acknowledgments Appendix A Supplementary data References