Cloud fraction determined by thermal infrared and visible all-sky cameras

The thermal infrared cloud camera (IRCCAM) is a prototype in strument that determines cloud fraction continuously during day and nighttime using measurements of the absolute thermal sky radiance distributions in the 8 μm 14μm wavelength range in conjunction with clear sky radiative transf er modelling. Over a time period of two years, the fractional cloud coverage obtained by the IRCCAM is compared with two commerc ial cameras (Mobotix Q24M and Schreder VIS-J1006) sensitive in the visible spectrum, as well as with the automa ed partial cloud amount detection algorithm (APCADA) usin g 5 pyrgeometer data. Over the two year period, the cloud fracti ons determined by the IRCCAM and the visible sky cameras are consistent to within 2 oktas (0.25 cloud fraction) for 90 % of the dataset during the day while for dayand nighttime data t he comparison with the APCADA algorithm yields an agreement of 80 %. These results are independent of cloud types with the exception of thin cirrus clouds which are not detected as con istently by the current cloud algorithm of the IRCCAM. The m asured absolute sky radiance distributions also provide the pot ntial for future applications by combining these measu rements 10 with ancillary meteorological data from radiosondes and ce ilometers.


Introduction
Clouds affect the surface radiation budget and thus the climate system on a local as well as on a global scale. Clouds have an influence on solar and on terrestrial radiation by absorbing, scattering and emitting radiation. The Intergovernmental Panel on Climate Change (IPCC) states that clouds in general, and aerosol-cloud interactions in particular, gen-erate considerable uncertainty in climate predictions and climate models (IPCC, 2013). Having information about cloud fraction on a local scale is of importance in different fields: for solar power production due to the fact that clouds cause large variability in the energy production (Parida et al., 2011;Mateos et al., 2014;Tzoumanikas et al., 2016), for aviation and weather forecast or microclimatological studies.
The most common practice worldwide used to determine cloud coverage, cloud base height (CBH) and cloud type from the ground are human observations (CIMO, 2014). These long-term series of cloud data allow climate studies to be conducted (e.g. Chernokulsky et al., 2017). Cloud detection by human observers is carried out several times per day over a long time period without the risk of a larger data gap due to the technical failure of an instrument. However, even with a reference standard defined by the World Meteorological Organisation (WMO), for human observers, the cloud determination is not objective, e.g. due to varying degrees of experience (Boers et al., 2010). Other disadvantages of human cloud observations are that the temporal resolution is coarse and, due to visibility issues, night-time determinations are difficult. Since clouds are highly variable in space and time, measurements at high spatial and temporal resolution with small uncertainties are needed (WMO, 2012). Recent research has therefore been conducted to find an automated cloud detection instrument (or a combination of instruments) to replace human observers (Boers et al., 2010;Tapakis and Charalambides, 2013;Huertas-Tato et al., 2017;Smith et al., 2017).
An alternative to detecting clouds from the ground by human observation is to detect them from space. With a temporal resolution of 5 to 15 min, Meteosat Second Generation Published by Copernicus Publications on behalf of the European Geosciences Union. 5550 C. Aebi et al.: Cloud fraction determined by thermal infrared and visible all-sky cameras (MSG) geostationary satellites are able to detect cloud coverage with a higher time resolution than is accomplished by human observers (Ricciardelli et al., 2010;Werkmeister et al., 2015). The geostationary satellite Himawari-8 (Da, 2015) even delivers cloud information with a temporal resolution of 2.5 to 10 min and a spatial resolution of 0.5 to 2 km. However, these geostationary satellites cover only a certain region of the globe. Circumpolar satellites (i.e. the MODIS satellites Terra and Aqua, Baum and Platnick, 2006;Ackerman et al., 2008) determine cloud fraction globally, but for a specific region only four times a day. Satellites cover a larger area than ground-based instruments and are also able to deliver cloud information from regions where few ground-based instruments are available (e.g. in Arctic regions Heymsfield et al., 2017 or over oceans). However, due to the limited resolution of satellites, small clouds can be overlooked (Ricciardelli et al., 2010). Another challenge with satellite data is the ability to distinguish thin clouds from land (Dybbroe et al., 2005;Ackerman et al., 2008). Furthermore, satellites collect information mainly from the highest cloud layer rather than the lower cloud layer, closer to the Earth's surface. Satellite data are validated and thus supported by ground-based cloud data. Different studies focusing on the comparison of the determined cloud fraction from ground and from space were presented, e.g. by Fontana et al. (2013), Wacker et al. (2015), Calbó et al. (2016), Kotarba (2017).
In general, three automatic ground-based cloud cover measurement techniques are distinguished: radiometers, active column instruments and hemispherical sky cameras. Radiometers measure the incident radiation in different wavelength ranges. Depending on the wavelength range, the presence of clouds alters the radiation measured at ground level (e.g. Calbó et al., 2001;Mateos Villán et al., 2010). Calbó et al. (2001) and Dürr and Philipona (2004) both present different methodologies to determine cloud conditions from broadband radiometers. Other groups describe methodologies using instruments with a smaller spectral range. Such instruments are, for example, the infrared pyrometer CIR-7 (Nephelo) (Tapakis and Charalambides, 2013) or NubiScope (Boers et al., 2010;Feister et al., 2010;Brede et al., 2017), which both measure in the 8-14 µm wavelength range of the spectrum. In order to retrieve cloud information, Nephelo consists of seven radiometers which scan the whole of the upper hemisphere. The NubiScope consists of one radiometer only, which also scans the whole of the upper hemisphere. A scan takes several minutes, which is a limitation on the retrieval of cloud fraction information when, for example, fast-moving clouds occur (Berger et al., 2005). In general, these instruments give information about cloud fraction for three different levels, cloud types and CBH (Wauben, 2006). Brocard et al. (2011) presents a method using data from the tropospheric water vapour radiometer (TROWARA) to determine cirrus clouds from the measured fluctuations in the sky infrared brightness temperature.
The second group, the column cloud detection instruments, send laser pulses to the atmosphere and measure the backscattered photons. The photons are scattered back by hydrometeors in clouds and, depending on the time and the amount of backscattered photons measured, the cloud base height can be determined. However, the laser pulse is not only scattered back by cloud hydrometeors, but also by aerosols (Liu et al., 2015). Examples of active remote sensing instruments are cloud radar (Kato et al., 2001;Illingworth et al., 2007;Feister et al., 2010), lidar (Campbell et al., 2002;Zhao et al., 2014) and ceilometers (Martucci et al., 2010). Due to the narrow beam, a disadvantage of these measurement techniques is the lack of instantaneous cloud information of the whole of the upper hemisphere. Boers et al. (2010) showed that, with smaller integration times, the instruments tend to give okta values of 0 and 8 rather than the intermediate cloud fractions of 1 to 7 oktas.
The third group of ground-based cloud detection instruments comprises the hemispherical sky cameras, which often have a 180 • view of the upper hemisphere. The most common all-sky camera is the commercially available Total Sky Imager (TSI) (Long et al., 2006). Another pioneering hemispherical cloud detection instrument is the Whole Sky Imager (WSI) (Shields et al., 2013). Whereas the TSI is sensitive in the visible spectrum, the WSI acquires information in seven different spectral ranges in the visible and in the near infrared regions. A special version of the WSI also allows for night-time measurements (Feister and Shields, 2005). Other cloud research has been undertaken with low-cost commercial cameras sensitive in the visible spectrum of the wavelength range (e.g. Calbó and Sabburg, 2008;Cazorla et al., 2008;Kazantzidis et al., 2012;Wacker et al., 2015;Kuhn et al., 2017). All of these hemispherical sky cameras operate well during the daytime but give often limited information during night-time. Thus, there is increasing interest in the development of cloud cameras sensitive in the thermal infrared region of the spectrum. Ground-based thermal infrared all-sky cameras have the advantage of potentially delivering continuous information about cloud coverage, cloud base height and cloud type during daytime and night-time, which in turn is of interest in various fields.
The Infrared Cloud Imager (ICI) is a ground-based sky camera sensitive in the 8-14 µm wavelength range and with a resolution of 320 × 240 pixels Smith and Toumi, 2008). Another instrument, the Solmirus All Sky Infrared Visible Analyzer (ASIVA) consists of two cameras, one measuring in the visible and the other one in the 8-13 µm wavelength range (Klebe et al., 2014). The whole-sky infrared cloud measuring system (WSIRCMS) is an all-sky cloud camera sensitive in the 8-14 µm wavelength range (Liu et al., 2013). The WSIRCMS consists of nine cameras measuring at the zenith and at eight surrounding positions. With a time resolution of 15 min, information about cloud cover, CBH and cloud type are determined. This instrument has an accuracy of ±0.3 oktas compared to visual observations (Liu et al., 2013). Redman et al. (2018) presented a reflective all-sky imaging system (sensitive in the 8-14 µm wavelength range) consisting of a long-wave infrared microbolometer camera and a reflective sphere (110 • field of view, FOV). The Sky Insight thermal infrared cloud imager is an industrial and patented (Bertin et al., 2015b) product from Reuniwatt. The Sky Insight cloud imager is sensitive in the 8-13 µm wavelength range and gives cloud information of the whole of the upper hemisphere. Their system is mainly used for cloud cover forecasts up to 30 min in advance, which is relevant for global horizontal irradiance forecasts or optical communication link availability (Bertin et al., 2015a;Liandrat et al., 2017).
The current study describes a newly developed prototype instrument, the thermal infrared cloud camera (IRCCAM), which consists of a modified commercial thermal camera (Gobi-640-GigE) that gives instantaneous information about cloud conditions for the full upper hemisphere. The time resolution of the IRCCAM in the current study is 1 min during daytime and night-time. It measures in the wavelength range of 8-14 µm. After a developing and testing phase (Aebi et al., 2014;Gröbner et al., 2015), the IRCCAM has been in continuous use at the Physikalisch-Meteorologisches Observatorium Davos/World Radiation Center (PMOD/WRC), Davos, Switzerland, since September 2015. The IRCCAM was developed to provide instantaneous hemispheric cloud coverage information from the ground with a high temporal resolution in a more objective way than human cloud observations. Thus the IRCCAM could be used for different applications at meteorological stations, at airports or at solar power plants. The performance of the IRCCAM regarding cloud fraction is compared with data from two visible all-sky cameras and the automatic partial cloud amount detection algorithm (APCADA) (Dürr and Philipona, 2004). In Sect. 2, the instruments and cloud detection algorithms are presented. The comparison of the calculated cloud fractions based on different instruments and algorithms is analysed and discussed for the overall performance and for different cloud classes, times of day and seasons in Sect. 3. Section 4 provides a summary and conclusions.

Data and methods
All three all-sky camera systems used for the current study are installed at the Physikalisch-Meteorologisches Observatorium Davos/World Radiation Center (PMOD/WRC), Davos, located in the Swiss Alps (46.81 • N, 9.84 • E, 1594 m a.s.l.). There are two commercial cameras, one Q24M from Mobotix and the other is a VIS-J1006 cloud camera from the company Schreder. Both of these cameras measure in the visible spectrum. The third camera is the newly developed all-sky camera (IRCCAM) sensitive in the thermal infrared wavelength range. All of these cameras are cleaned daily. The instruments themselves and their respective analysis software are described in the following subsections. Also, the APCADA is briefly described in Sect 2.4.
The analysis of the data from the IRCCAM is performed for the time period 21 September 2015 to 30 September 2017, with a data gap between 20 December 2016 and 24 February 2017 due to maintenance of the instrument. Mobotix and APCADA data are available for the whole aforementioned time period. Schreder data have only been available since 9 March 2016. Thus the analysis of these data is only performed for the time period 9 March 2016 to 30 September 2017.

Thermal infrared cloud camera
The infrared cloud camera (IRCCAM) (Fig. 1) consists of a commercial thermal infrared camera (Gobi-640-GigE) from Xenics (http://www.xenics.com/en, last access: 22 September 2018). The camera is an uncooled microbolometer sensitive in the wavelength range of 8-14 µm. The chosen focal length of the camera objective is 25 mm and the FOV 18 • ×24 • . The image resolution is 640×480 pixels. The camera is located on top of a frame, looking downward on a goldplated spherically shaped aluminium mirror such that the entire upper hemisphere is imaged on the camera sensor. The complete system is 1.9 m tall. The distance between the camera objective and the mirror is about 1.2 m. These dimensions were chosen in order to reflect the radiation from the whole of the upper hemisphere onto the mirror and to minimise the area of the sky hidden by the camera itself. The arm holding the camera above the mirror is additionally fixed with two wire ropes to stabilise the camera during windy conditions. The mirror is gold-plated to reduce the emissivity of the mirror and to make measurements of the infrared sky radiation largely insensitive to the mirror temperature. Several temperature probes are included to monitor the mirror, camera and ambient temperatures.
The camera of the IRCCAM was calibrated in the PMOD/WRC laboratory in order to determine the brightness temperature or the absolute radiance in Wm −2 sr −1 for every pixel in an IRCCAM image. The absolute calibration was obtained by placing the camera in front of the aperture of a well-characterised black body at a range of known temperatures between −20 and +20 • C in steps of 5 • C (Gröbner, 2008). The radiance emitted by a black-body radiator can be calculated using the Planck radiation formula, where T is the temperature, λ the wavelength, h is the Planck constant, 6.6261 × 10 −34 Js, c the speed of light, 299 792 458 ms −1 and k the Boltzmann constant, 1.3806 × 10 −23 J K −1 . For the IRCCAM camera, the spectral response function R λ as provided by the manufacturer is shown in where T is the effective temperature of the black body (Gröbner, 2008) and L R is the integrated radiance measured by the IRCCAM camera. To retrieve the brightness temperature (T B ) from the integrated radiance L R , Eq.
(2) cannot be solved analytically. Therefore, as an approximation, we are using a polynomial function T B = f (L R ) to retrieve the brightness temperature T B from the radiance L R . Using Eq.
(2), L R values are calculated for temperatures in the range of −40 and +40 • C. The resulting fitting function is a polynomial third-order function (see Fig. 3), which is used to retrieve T B from the integrated radiance L R for every pixel in an IRCCAM image. The IRCCAM calibration in the black-body aperture was performed on 16 March 2016 and all its images are calibrated with the corresponding calibration function retrieved from the laboratory measurements. The calibration uncertainty of the camera in terms of brightness temperatures (in a range of −40 and +40 • C) is estimated at 1 K for a Planck spectrum as emitted by a black-body radiator. Furthermore, a temperature correction function for the camera was derived from these laboratory calibrations in order to correct the measure- ments obtained at ambient temperatures outdoors. The hemispherical sky images taken by the IRCCAM are converted to polar coordinates ( , ) for the purpose of retrieving brightness temperatures in dependence of zenith and azimuth. Due to slight aberrations in the optical system of the IRCCAM, the coordinate does not follow a linear relationship with the sky zenith angle, producing a distorted sky image. Therefore, a correction function was determined by correlating the apparent solar position as measured by the IRCCAM with the true solar position obtained by a solar position algorithm. This correction function was then applied to the raw camera images to obtain undistorted images of the sky hemisphere. One should note that observing the sun with the Gobi camera implies that the spectral filter used in the camera to limit the spectral sensitivity to the 8-14 µm wavelength band has some leakage at shorter wavelengths. Fortunately, this leakage is confined to a narrow region around the solar disk (around 1 • ) as shown in Fig. 4. Thus, it has no effect on the remaining part of the sky images taken by the IRCCAM during daytime measurements.
The main objective of the IRCCAM study is to determine cloud properties from the measured sky radiance distributions. The cloudy pixels in every image are determined from their observed higher radiances with respect to that of a cloud-free sky. The clear-sky radiance distributions are determined from radiative transfer calculations using MODTRAN 5.1 (Berk et al., 2005), using as input parameters screenlevel air temperature and integrated water vapour (IWV). The temperature was determined at 2 m elevation from a nearby SwissMetNet station, while the IWV was retrieved from GPS signals operated by the Federal Office for Topography and archived in the Studies in Atmospheric Radiation Transfer and Water Vapour Effects (STARTWAVE) database hosted at the Institute of Applied Physics at the University of Bern (Morland et al., 2006). For practical reasons, a look-up table (LUT) for a range of temperatures and IWV was generated, which was then used to compute the reference clear-sky radiance distribution for every single image taken by the camera. A similar approach that is used to detect cloud patterns is described in Bertin et al. (2015a) and Liandrat et al. (2017).
The sky brightness temperature distribution as measured on a cloud-free day (18 June 2017, 10:49 UTC) and the corresponding modelled sky brightness temperature are shown in Fig. 4a and b. As expected, the lowest radiance is emitted at the zenith, with a gradual increase at increasing zenith angle, until the measured effective sky brightness temperature at the horizon is nearly equal to ambient air temperature (Smith and Toumi, 2008). Figure 4c shows the profiles of the measured (red) and modelled (blue) brightness temperatures along one azimuth position going through the solar position (yellow line in Fig. 4a). As can be seen in Fig. 4c, the measured and modelled sky distributions agree fairly well, with large deviations at high zenith angles due to the mountains obstructing the horizon around Davos. The short-wave leakage from the sun can also be clearly seen around pixel number 180. A smaller deviation is seen at pixel number 239 from the wires holding the frame of the camera.
The average difference between the measured and modelled clear-sky radiance distributions was determined for several clear-sky days during the measurement period in order to use that information when retrieving clouds from the IR-CCAM images. Differences can arise, on the one hand, from the rather crude radiative transfer modelling, which only uses surface temperature and IWV as input parameters to the model. On the other hand, it can arise from instrumental effects such as a calibration uncertainty of ±1 K. An effect of the mirror temperature and a possible mismatch between actual and nominal spectral response functions of the IRCCAM camera are other potential causes for this difference. However, both of these possible effects have not been taken into account. The validation measurements span 8 days, with fullsky measurements obtained every minute, yielding a total of 11 512 images for the analysis. For every image, the corresponding sky radiance distribution was calculated from the LUT, as shown in Fig. 4b. The residuals between the measured and modelled sky radiance distributions were calculated by averaging over all data points with zenith angles smaller than 60 • while removing the elements (frame and wires) of the IRCCAM within the FOV of the camera, resulting in one value per image. The brightness temperature differences between IRCCAM and model calculations show a mean difference of +4.0 K and a standard deviation of 2.4 K over the whole time period. The observed variability comes equally from day-to-day variations as well as from variations within a single day. No systematic differences are observed between day and night-time data.
The stability of the camera over the measurement period is investigated by comparing the horizon brightness temperature derived from the IRCCAM with the ambient air temperature measured at the nearby SwissMetNet station. As mentioned by Smith and Toumi (2008), the horizon brightness temperature derived from the IRCCAM should approach the surface air temperature close to the horizon. Indeed, the average difference between the horizon brightness temperature derived from the IRCCAM and the surface air temperature was 0.1 K with a standard deviation of 2.4 K, showing no drifts over the measurement period and thus confirming the high stability of the IRCCAM during this period. The good agreement of 0.1 K between the derived horizon brightness temperature from the IRCCAM and the surface air temperature confirms the absolute calibration uncertainty of ±1 K of the IRCCAM. Therefore, the observed discrepancy of 4 K between measurements and model calculations mentioned previously can probably be attributed to the uncertainties in the model parameters (temperature and IWV) used to produce the LUT.

Cloud detection algorithm
After setting up the IRCCAM, a horizon mask is created initially to determine the area of the IRCCAM image representing the sky hemisphere. A cloud-free image is selected manually. The sky area is selected by the very low sky brightness temperatures with respect to the local obstructions with much larger brightness temperatures. This image mask contains local obstructions such as the IRCCAM frame (camera, arm and wire ropes) as well as the horizon, which, in the case of Davos, consists of mountains limiting the FOV of the IRCCAM. Thereafter, the same horizon mask is applied to all IRCCAM images. The total number of pixels within the mask is used as a reference and the cloud fraction is defined as the number of pixels detected as cloudy relative to the total number.
The algorithm used to determine cloudy pixels from an IRCCAM image consists of two parts. The first part uses the clear-sky model calculations as a reference to retrieve low-to mid-level clouds. These clouds have large temperature differences compared to the clear-sky reference. In this part of the algorithm, cloudy pixels are defined for measured sky brightness temperatures that are at least 6.5 K greater than the modelled clear-sky reference value. A rather large threshold value was empirically chosen to avoid any erroneous clear-sky misclassifications as cloudy pixels. The thinner and higher clouds with lower brightness temperatures are therefore left for the second part of the algorithm.
In order to determine the thin and high-level clouds within an IRCCAM image, non-cloudy pixels remaining from the first part of the algorithm are used to fit an empirical clearsky brightness temperature as a function of the zenith angle, where T B is the brightness temperature for a given zenith angle , and T 65 , a and b are the retrieved function parameters (Smith and Toumi, 2008). This second part of the algorithm assumes a smooth variation of the clear-sky bright-ness temperature with zenith angle. Thereby, it determines cloudy pixels as deviations from this smooth function as well as requiring a brightness temperature higher than this empirical clear-sky reference. Pixels with a brightness temperature higher than the empirically defined threshold of 1.2 K are defined as cloudy and removed from the clear-sky data set. This procedure is repeated up to 10 times to iteratively find pixels with a brightness temperature higher than the clear-sky function. One restriction of this fitting method is that it requires at least broken cloud conditions, as it does not work well under fully overcast conditions without the presence of cloud-free pixels to constrain the fitting procedure. The selected threshold of 1.2 K allows the detection of low-emissivity clouds, but still misses the detection of parts of thin, high-level cirrus clouds even though they can be clearly seen in the IRCCAM images. Unfortunately, reducing the threshold to less than 1.2 K results in many clear-sky misclassifications as clouds. Therefore, under these conditions, it seems that using a spatial smoothness function is not sufficient to infer that individual pixels are cloudy; a more advanced algorithm as discussed in Brocard et al. (2011) is required to define clouds, not only on a pixel-by-pixel basis but as a continuous structure (e.g. pattern recognition algorithm).
Before reaching the final fractional cloud data set, some data-filtering procedures are applied: situations with precipitation are removed by considering precipitation measurements from the nearby SwissMetNet station; ice or snow deposition on the IRCCAM mirror is detected by comparing the median radiance of a sky area with the median radiance value of an area on the image showing the frame of the IRC-CAM. In cases where the difference between the median values of the two areas is smaller than the empirically defined value of 5 Wm −2 sr −1 , the mirror is assumed to be contaminated by snow or ice and therefore does not reflect the sky, so the image is excluded. The horizon mask does not cover all pixels that do not depict sky, which leads to an offset in the calculated cloud fraction of around 0.04. This offset is removed before comparing the cloud fraction determined by the IRCCAM with other instruments.

Mobotix camera
A commercial surveillance Q24M camera from Mobotix (https://www.mobotix.com/, last access: 22 September 2018) was installed in Davos in 2011. The camera has a fisheye lens and is sensitive in the red-green-blue (RGB) wavelength range. The camera takes images from the whole of the upper hemisphere with a spatial resolution of 1200 × 1600 pixels. The camera system is heated, ventilated and installed on a solar tracker with a shading disk. The shading disk avoids overexposed images due to the sun. The time resolution of the Mobotix data is 1 min (from sunrise to sunset) and the exposure time is 1/500 s. An algorithm determines the cloud fraction of each image automatically (Wacker et al., 2015;Aebi et al., 2017). Before applying the cloud detection algorithm, the images are preprocessed. The distortion of the images is removed by applying a correction function. The same horizon mask, which was defined on the basis of a cloud-free image, is applied to all images. After this preprocessing, the colour ratio (the sum of the blue to green ratio plus the blue to red ratio) is calculated per pixel. To perform the cloud determination per pixel, this calculated colour ratio is compared to an empirically defined reference ratio value of 2.2. Comparing the calculated colour ratio value with this reference value designates whether a pixel is classified as cloudy or as cloud-free. The cloud fraction is calculated by the sum of all cloud pixels divided by the total number of sky pixels.

Schreder camera
The total-sky camera VIS-J1006 from Schreder (http://www. schreder-cms.com/en/, last access: 22 September 2018) consists of a digital camera with a fisheye lens. The VIS-J1006 Schreder camera is sensitive in the RGB region of the spectrum and takes two images every minute with different exposure times (1/500 and 1/1600 s). The aperture is fixed at f/8 for both images. The resolution of the images is 1200 × 1600 pixels. The camera comes equipped with a weatherproof housing and a ventilation system.
The images from the Schreder camera are analysed using two different algorithms. The original software is directly delivered from the company Schreder. Before calculating the fractional cloud coverage, some steps are needed to define the settings that are needed to preprocess the images. In a first step, the centre of the image is defined manually. In a second step, the maximum zenith angle of the area taken into account for further analyses is defined. Unfortunately, the maximum possible zenith angle is only 70 • and thus a larger fraction of the sky cannot be analysed. After the distortion of the images is removed, in a fourth step a horizon mask is defined on the basis of a cloud-free image. The mask also excludes the pixels around the sun. In a last step, a threshold is defined which specifies whether a pixel is classified as a cloud or not. The settings from these preprocessing steps are then applied to all images from the Schreder camera. In the following, the term Schreder refers to data for which this algorithm is used.
Due to the Schreder algorithm's limitation of a maximum zenith angle of 70 • , we used the same algorithm as for the Mobotix camera, referred to hereafter as Schreder pmod . The algorithm Schreder pmod has the advantage that the whole of the upper hemisphere is considered when calculating the fractional cloud coverage. Thus, a new horizon mask is defined on the basis of a cloud-free image. The colour ratio reference that distinguishes between clouds and no clouds is assigned an empirical value of 2.5, which is slightly different to that used for the Mobotix camera. The Schreder camera in Davos has been measuring continuously since March 2016.

APCADA
The automated partial cloud amount detection algorithm (APCADA) determines the cloud amount in oktas using downward long-wave radiation from pyrgeometers, temperature and relative humidity measured at screen-level height (Dürr and Philipona, 2004). APCADA is only able to detect low-and mid-level clouds and is not sensitive to high-level clouds. The time resolution of APCADA is 10 min during daytime and night-time. The agreement of APCADA compared to synoptic observations at high-altitude and midlatitude stations, such as Davos, is that 82 % to 87 % of cases during daytime and night-time have a maximum difference of ±1 okta (±0.125 cloud fraction) and between 90 % to 95 % of cases have a difference of ±2 oktas (±0.250 cloud fraction) (Dürr and Philipona, 2004).
In order to compare the cloud coverage information retrieved from APCADA with the fractional cloud coverages retrieved from the cameras, the okta values are converted to fractional cloud coverage values by multiplying the okta values by 0.125. In the current study, APCADA is mainly used for comparisons of the night-time IRCCAM data.

Results
In the aforementioned time period 21 September 2015 to 30 September 2017, the IRCCAM data set comprises cloud cover information from 581 730 images. The Mobotix data set comprises 242 249 images (because only daytime data are available) and the Schreder data set 184 746 images (shorter time period and also only daytime). Figure 5 shows the relative frequencies of cloud cover detection from the different camera systems in okta bins during the daytime and when all camera data are available. Zero okta corresponds to a cloud fraction of 0 to 0.05 and 8 oktas to a cloud fraction of 0.95 to 1. One and seven oktas correspond to intermediate bins of 0.1375 cloud fraction and oktas two to six to intermediate bins of 0.125 cloud fraction (Wacker et al., 2015). Cloud-free (0 okta) and overcast (8 oktas) are the cloud coverages that are most often detected in the aforementioned time period. This behaviour also agrees with the analysis of the occurrence of fractional cloud coverages over a longer time period in Davos discussed in Aebi et al. (2017). All four instruments and algorithms show similar relative occurrences of cloud coverage of 2-6 oktas. It is noteworthy that the IR-CCAM clearly underestimates the occurrence of 0 oktas in comparison to the cameras measuring in the visible spectrum (by up to 20 %). On the other hand, the relative frequency of the IRCCAM of 1 okta is clearly larger (by up to 10 %) compared to the visible cameras. This can be explained by higher brightness temperatures measured in the vicinity of the horizon above Davos. These higher measured brightness temperatures are falsely determined as cloudy pixels (up to 0.16 cloud fraction). Since these situations with larger brightness temperatures occur quite frequently, the IRCCAM algorithm more often detects cloud coverages of 1 okta instead of 0 okta. Also, at the other end of the scale, the IRCCAM detects slightly larger values of a relative frequency of 7 oktas compared to the visible cameras and slightly lower relative frequencies of a measurement of 8 oktas.
As an example, Fig. 6 shows the cloud fraction determined on 4 April 2016, where various cloud types and cloud fractions were present. This day starts with an overcast sky and precipitation and therefore the IRCCAM measures fractional cloud coverages of more than 0.98. The cloud layer disperses until it reaches cloud fraction values of 0.1 at around 06:00 UTC. At this time the sun rises above the effective horizon and the visible all-sky cameras start to measure shortly thereafter. The cloud classes are determined with the algorithm developed by Wacker et al. (2015) based on Mobotix images. In the early morning, the cloud type present is cumulus. The larger difference of more than 0.1 between the cloud fraction determined by the Schreder algorithm and the other algorithms can be explained after a visual observation of the image: the few clouds that are present are located close to the horizon and thus in the region of the sky that the Schreder algorithm is not able to analyse. The fractional cloud coverage increases again to values of around 0.8 at 07:00 UTC. At this time, all four cameras and algorithms determine a similar fractional cloud coverage. Around 08:00 UTC a first cirrostratus layer appears, which is slightly better detected by the IRCCAM and the Mobotix algorithm than by the two algorithms using the Schreder images. Two hours later, around 10:00 UTC, the main cloud type present is again cumulus. Low-level clouds are quite precisely detected by all camera systems and thus, in this situation, the maximum observed difference is only 0.06. Figure 7a shows exactly this situation as an RGB image taken by the Mobotix camera, and the corresponding classifications as cloudy or non-cloudy pixels determined by the IRCCAM (Fig. 7b) and by the Mobotix algorithm (Fig. 7c). From 11:00 UTC onwards the cumulus clouds are found in the vicinity of the horizon and cirrus-cirrostratus closer to the zenith. Because all algorithms have difficulty detecting thin and high-level clouds, the differences in the determined cloud fractions are variable. Again, the Schreder algorithm is not able to analyse the cloud fraction near the horizon and thus it always detects the smallest fraction compared to the other algorithms. The visible cameras continue measuring until 16:23 UTC when the sun sets, and afterwards only data from the IRCCAM are available.

Visible all-sky cameras
Before validating the fractional cloud coverage determined by the IRCCAM algorithm, the fractional cloud coverages, which are determined using the images of the visible allsky cameras Mobotix and Schreder, are compared with each other to gain a better understanding of their performance. The time period analysed here is 9 March 2016 to 30 September 2017, consisting of only daytime data, which correspond to a data set of 184 746 images. Additionally, the results from the visible all-sky cameras are compared with data retrieved from APCADA (temporal resolution of 10 min). For this comparison, 32 902 Mobotix and 24 907 Schreder images are considered. The histograms of the residuals of the difference in the cloud fractions (range between [−1;1]) between the visible all-sky cameras are shown in Fig. 8 and the corresponding median and 5th and 95th percentiles are shown in Table 1.
As shown in Table 1, the two algorithms from the Schreder camera as well as APCADA underestimate the cloud fraction determined from Mobotix images, with a maximum median difference of −0.04. Although the median difference in cloud fraction between the two Schreder algorithms is 0.00, the distribution tends towards more negative values. This more pronounced underestimation of fractional cloud coverage of the Schreder algorithm might be explained by the smaller fraction of the sky being analysed (Fig. 8c). The underestimation in the retrieved cloud fraction of the Schreder algorithm for 90 % of the data is even slightly larger in comparison to the cloud fraction determined with the Mobotix algorithm. The spread (shown as 5th and 95th percentiles in Table 1)  is greatest for all comparisons of the algorithms from the visible cameras with APCADA. As previously mentioned in Sect. 2.4, APCADA gives the cloud fraction only in steps of 0.125, and it is thus not as accurate as the cloud fraction determined from the cameras. This fact might explain the large variability in the residuals. In Fig. 8 it is shown that the distribution of the residuals between the cloud fraction retrieved from Mobotix versus the cloud fraction retrieved from the two Schreder algorithms ( Fig. 8a and b) are left-skewed, which confirms that the cloud fraction retrieved from the two Schreder algorithms underestimates the cloud fraction retrieved from the Mobotix images.
Taking the measurement uncertainty of human observers and also of other cloud detection instruments to be ±1 okta to ±2 oktas (Boers et al., 2010), we consider this to be a baseline uncertainty range that tests the performance in the detection of cloud fraction of our visible camera systems. The algorithms for the visible camera systems determine the cloud fraction for 94 %-100 % of the data within ±2 oktas (±0.25) and for 77 %-94 % of the data within ±1 okta (±0.125). Comparing the cloud fraction determined from APCADA with the cloud fraction determined from the visible cameras shows that in only 67 %-71 % of the cases is there an agreement of ±1 okta (±0.125) and in 83 %-86 % of data an agreement of ±2 oktas (±0.25). All of these results are further discussed in the next section.

IRCCAM validation
As described in Sect. 3.1, in up to 94 % of the data set the visible cameras are consistent to within ±1 okta (±0.125) in the cloud fraction detection, so that they can be used to validate the fractional cloud coverage determined by the IRCCAM. For this comparison, a data set of 242 249 images (Mobotix) and a data set of 184 746 images (Schreder) are available. This comparison is only performed for daytime data of the IRCCAM, because from the visible cameras only daytime data are available. The residuals and some statistical values of the differences between the IRCCAM and the visible cameras are shown in Fig. 9 and Table 2. With a median value of 0.01, there is no considerable difference between the cloud fraction determined by the IRCCAM and the cloud fraction determined by the Mobotix camera. The differences between the IRC-CAM and the Schreder algorithms are only slightly larger, with median values of 0.04 and 0.07 for Schreder pmod and Schreder. Thus, the IRCCAM only marginally overestimates the cloud fraction in comparison to the cloud fraction determined by the visible cameras. The distributions of the  Fig. 9b and c). The distribution of the residuals in the cloud fraction IRCCAM-Mobotix is slightly left-skewed (Fig. 9a).
The percentage of agreement in the determined cloud fraction between the sky cameras and APCADA separately is given in Table 3. All values above the main diagonal designate the fraction of data that agree within ±0.125 (±1 okta) fractional cloud coverage between two individual algorithms and all values below the main diagonal indicate the fraction that agree within ±0.25 (±2 oktas) cloud fraction. The agreement of the IRCCAM in comparison with different visible all-sky cameras and APCADA is that 59 %-77 % of the IRC- within ±2 oktas and ±1 okta respectively). The close agreement between the two algorithms Schreder and Schreder pmod is noteworthy, although they analyse a different number of image pixels. We can conclude that the IRCCAM retrieves cloud fraction values within the uncertainty range of the cloud fraction retrieved from the visible cameras and also in a similar range to state-of-the-art cloud detection instruments.

Cloud class analysis
Although the median difference between the cloud fraction determined with the IRCCAM algorithm and the cloud fraction determined with the Mobotix algorithm is not evident, it is interesting to analyse differences in cloud fraction depending on the cloud type. The algorithm developed by Wacker et al. (2015) is used to distinguish six selected cloud classes and cloud-free cases automatically on the basis of the Mobotix images. Figure 10 shows the distribution of the residuals of the cloud fraction of the two aforementioned algorithms for (a) cumulus (low-level; N = 37 320), (b) cirrocumulus-altocumulus (mid-level; N = 52 097) and (c) cirrus-cirrostratus (high-level; N = 10 467). The median value of the difference in cloud fraction between IRCCAM and Mobotix for Cu clouds is 0.02 and therefore not considerable. In general, all low-level clouds (Sc, Cu, St-As, Cb-Ns) are detected with a median cloud fraction difference of −0.01 to 0.02 (Table 4). The IRCCAM and the Mobotix camera observe the mid-level cloud class Cc-Ac with a median agreement of cloud fraction of 0.00 but with a slightly asymmetric distribution towards negative values. Considering 90 % of the data set of Cc-Ac clouds, the IRCCAM tends to underestimate the cloud fraction for the mid-level cloud class. The spread in the Cc-Ac data (shown as 5th and 95th percentiles in Table 4) is in general slightly larger than that for low-level clouds. The median value of the cloud fraction residuals determined on the basis of IRCCAM images and those based on Mobotix images for the high-level cloud class Ci-Cs is, at −0.13, clearly larger in comparison to clouds at lower levels. Thus, although we applied the second part of the algorithm to detect thin, high-level clouds from the IRCCAM images, it still misses a large fraction of the Ci-Cs clouds in comparison to the Mobotix camera. The distribution of the residuals (Fig. 10c) is clearly wider, which leads to 5th and 95th percentiles of −0.42 and 0.21. Due to the large spread and as shown in Aebi et al. (2017), the visible camera systems also have difficulties in detecting the thin, high-level clouds.

Day-night differences
So far, only daytime data have been analysed. At PMOD/WRC in Davos, during night-time the cloud fraction is retrieved from pyrgeometers as well as from the IRCCAM. Therefore the IRCCAM cloud coverage data are compared  with the data retrieved from the APCADA, which uses pyrgeometer data and calculates cloud fractions independently of the time of day. As explained in Sect. 2.4, APCADA only determines the cloud fraction from low-to mid-level clouds and gives no information about high-level clouds. It also gives the cloud fraction only in okta steps (equals steps of 0.125 cloud fraction). Table 5 shows the median values of the residuals of the cloud fraction between IRCCAM and APCADA for all available data (N = 103 624), only daytime data (N = 32 902) and only night-time data (N = 70 722) and the corresponding 5th and 95th percentiles separately. The overall median difference value in cloud fraction detection between IRC-CAM and APCADA is, at 0.05, in a similar range to the ones for the comparison of the cloud fraction determined with the cloud cameras. The median value for daytime data is, at 0.06, only slightly larger than the one for night-time data (0.04). However, the spread of the residuals is notably broad, mainly during night-time with a large positive 95th percentile value (0.65). However, because APCADA already showed larger spreads in the residuals in comparison to the fractional cloud coverage determined with the visible all-sky cameras, it is not possible to draw the conclusion that the IRCCAM overestimates the cloud fraction at night-time.

Seasonal variations
The seasonal analysis is performed in order to investigate whether a slightly unequal distribution of cloud types in different months in Davos (Aebi et al., 2017) has an impact on the performance of the cloud fraction retrieval between seasons. The percentage of agreement in the retrieved cloud fraction between the systems is again given for a maximum of ±1 okta (±0.125) differences (top) and ±2 oktas (±0.25) differences (bottom) for summer (left values) and winter (right values) in Table 6. For all algorithms there is a slightly closer agreement in the determined cloud fraction in the winter months in comparison to the summer months. In winter, the IRCCAM agrees with the other cameras in 78 %-83 % of the data within ±0.125 (±1 okta) and as high as 84 %-94 % within ±0.25 (±2 oktas). In summer, the agreement in cloud fraction is only 54 %-71 % of the data within ±0.125 (±1 okta) cloud fraction, but nevertheless, 89 %-91 % of values fall within ±0.25 (±2 oktas) cloud fraction. The slight difference between the two seasons might be explained by the slightly larger frequency of occurrence of the thin and low-emissivity cloud class cirrocumulusaltocumulus in Davos in summer than in winter (Aebi et al., 2017). Also, the values for spring (MAM) and autumn (SON) are in a similar range to the ones for summer and winter. Thus, the IRCCAM (and also the other camera systems) do not show any noteworthy variation in any of the seasons.

Conclusions
The current study describes a newly developed instrument -the thermal infrared cloud camera (IRCCAM) and its al-gorithm -that determines cloud fraction on the basis of absolute sky radiance distributions. The cloud fraction determined on the basis of IRCCAM images is compared with the cloud fraction determined on the basis of images from two visible camera systems (one analysed with two different algorithms) and with the partial cloud amount determined with APCADA.
The overall median differences between the determined cloud fraction from the IRCCAM and the fractional cloud coverage determined from other instruments and algorithms are 0.01-0.07 fractional cloud coverage. The IRCCAM has an agreement of ±2 oktas (±0.25) in more than 90 % of cases and an agreement of ±1 okta (±0.125) in up to 77 % of the cases in comparison to other instruments. Thus, in only 10 % of the data, the IRCCAM typically overestimates the cloud fraction in comparison with the cloud fraction determined from the all-sky cameras sensitive in the visible region of the spectrum. Differences in the cloud fraction estimates can be due to different thresholds for the camera systems (as discussed in Calbó et al., 2017) as well as some other issues addressed throughout the current study.
In general, there is no considerable difference in the performance of the IRCCAM in the different seasons. Analysis of the median values of the residuals between the cloud fraction determined from the IRCCAM and the ones calculated from APCADA shows no difference between daytime and night-time, even though the spread of the residuals is clearly higher during night-time.
The cloud fraction determination of the three cameras is independent of cloud classes, with the exception of thin cirrus clouds, which are underestimated by the current IRC-CAM algorithm by about 0.13 cloud fraction.
Overall, the IRCCAM is able to determine cloud fraction with good agreement in comparison to all-sky cameras sensitive in the visible spectrum and with no considerable differences in its performance during different times of the day or in different seasons. Thus, the IRCCAM is a stable system that can be used throughout the day and night with a high temporal resolution. In comparison to other state-of-the-art cloud detection instruments (e.g. ceilometer or NubiScope) it has the advantage of measuring the whole of the upper hemisphere at one specific moment. Its accuracy ranges from similar to rather better than that of the NubiScope (Feister et al., 2010) as well as that of the human observers (Boers et al., 2010).
In this study we mainly showed one application of the IRCCAM, which is to retrieve fractional cloud coverage information from the images. However, the known brightness temperature distribution of the sky and thus the known radiance can also be used for other applications, including the determination of other cloud parameters (cloud type, cloud level, cloud optical thickness) as well as the retrieval of information about downward long-wave radiation in general. Thus, after some improvements in the hardware (e.g. a heating or ventilation system to avoid a frozen mirror) and soft-ware (improvements of the cloud algorithm detecting lowemissivity clouds, e.g. by pattern recognition) the IRCCAM might be of interest for a number of further applications, for example, at meteorological stations or airports.
Data availability. Data are available from the corresponding author on request.
Competing interests. The authors declare that they have no conflict of interest.