## 2 Materials and Methods
### Retrieval Algorithms
#### 2.2.4 Cloud Detection and Flagging  
As clouds massively affect the atmospheric light paths, MAX-DOAS measurements under cloudy conditions can generally not be used for profile retrievals (see Table 5). Thus, reliable cloud information is required to flag cloudy MAX-DOAS measurements as dubious or invalid. Beyond simple flagging, a cloud classification algorithm allows for investigation of the effects of different cloud conditions for MAX-DOAS profile measurements separately. The determination of cloud properties from MAX-DOAS measurements themselves (instead of using independent cloud information) has several advantages. First, the cloud information can directly be assigned to the MAX-DOAS trace gas measurements without spatio-temporal interpolation. Second, the cloud algorithm can be used for MAX-DOAS measurements at different locations and with different availability of independent cloud information in a consistent way. Third, for situations with broken clouds, it might be possible to identify cloud contamination at individual elevation angles. Such cloud-contaminated measurements might then be excluded from the profile inversion. Clouds generally have a strong impact on the radiative transfer in the atmosphere. Thus, several quantities measured by the MAX-DOAS instruments that are affected by clouds can in turn be used for deriving cloud information. The main effects are the following:  
Clouds are bright: Clouds typically increase the radiance. However, e.g., in case of thick thunderstorm clouds, they might also decrease the radiance. Thus, the radiance alone cannot be used to non-ambiguously identify clouds. Clouds are white: The clear sky has a strong wavelength dependency for scattering probability (Rayleigh scattering), while scattering on cloud particles reveals almost no wavelength dependency. Thus, clouds look white. This effect on the broadband wavelength dependency of the radiance can be quantified by a colour index (CI), i.e., the ratio of radiances for two different wavelengths. It has, however, to be noted that only in zenith view, clouds lead in general to a whitening of the sky. In non-zenith viewing directions, depending on the viewing geometry, the cloudy and clear sky can in principle have the same colour. Clouds alter the light path: As clouds alter atmospheric light paths, they directly affect the measured spectral signatures of \"light path proxies\" like the O\({}_{4}\) SCD; also, the strength of the \"Ring effect\" is affected by clouds. However, as for the radiance, clouds \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline  & **AOD** & \begin{tabular}{c} **Aerosol Extinction** \\ **near Surface** \\ \end{tabular} & \begin{tabular}{c} **Profile of Aerosol** \\ **Extinction** \\ \end{tabular} & **VCD** & \
\begin{tabular}{c} **VMR near** \\ **Surface** \\ \end{tabular} &
\begin{tabular}{c} **Profile of** \\ **VMRs** \\ \end{tabular} \\ \hline Low aerosol & \(\bullet\) & \(\bullet\) & \(\bullet\) & \(\bullet\) & \(\bullet\) & \(\bullet\) \\ High aerosol & \(\bullet\) & \(\bullet\) & \(\bullet\) & \(\bullet\) & \(\bullet\) & \(\bullet\) \\ Cloud holes & \(\O\) & \(\bullet\) & \(\O\) & \(\bullet\) & \(\bullet\) & \(\bullet\) \\ Broken clouds & \(\O\) & \(\bullet\) & \(\O\) & \(\bullet\) & \(\bullet\) & \(\bullet\) \\ Continuous clouds & \(\O\) & \(\bullet\) & \(\O\) & \(\bullet\) & \(\bullet\) & \(\bullet\) \\ Fog & \(\O\) & \(\O\) & \(\O\) & \(\O\) & \(\O\) & \(\O\) \\ Thick clouds & \(\O\) & \(\O\) & \(\O\) & \(\O\) & \(\O\) & \(\O\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Impact of various cloud conditions on the quality of aerosol and trace gas results derived from MAX-DOAS observations. Filled circles: use of measurement is recommended. Open circles: use of measurement is not recommended. Table taken from [40]. might increase or decrease these quantities, depending on viewing geometry, sun position and cloud height.