## 2 Methods
### Profile Retrieval
#### 2.5.3 Ground Layer  
Experience at the ORM has shown [9] that under conditions that allow science data taking of IACTs, the ground layer reaches (1.5-2) km into the troposphere, until it reaches a region of free troposphere without aerosol contamination. Even under the worst circumstances, such a region can always be found [9]. Using precomputed molecular fit constants (Equation (45)) and their corresponding fit chi-squares (Equation (46)), the algorithm determines the lower limit of the free troposphere. To do so, a search range is predetermined, which starts at the LIDAR's range of full overlap and ends 10 km a.s.l., the highest altitude found for a free troposphere above the ORM [9]. The algorithm then iterates through that range and stops when: (a) a \(\left(\chi_{i}^{2}/N_{\rm dof}\right)^{\rm min}\) is found that falls below a predefined limit of 1.0 and (b) the corresponding fitted constant \(C_{i}^{\rm min}\) minus its uncertainty \(s_{C_{i}}\) is smaller than the assumed system constant \(C_{0}\). The latter condition serves to avoid the misinterpretation of well-mixed Saharan dust layers in their molecular prediction, with a slope similar to the RCS but a higher overall level. The algorithm performs a second iteration so that the lower limit of the free troposphere is not influenced by signal tails or low-quality fits from the ground layer. The refinement process continues to increase the indices \(i\) until \(C_{i}-1/4\,s_{C_{i}}>C_{i-1}\), that is, the signal exhibits a consistently decreasing trend beyond small statistical fluctuations. With this, the reference constant \(C_{\#}\) for the free troposphere is found. Using the identified ground layer top height \(h_{\#}\) (or the start of the free troposphere), the algorithm calculates aerosol extinction coefficients (\(\alpha_{i}^{\text{aer}}\)) derived through the Klett-Fernald [61; 62; 63] inversion, in non-logarithmic form, as pointed out by Young [64], see also [65]. For the inversion, the reference point is exchanged by its corresponding molecular fit constant \(C_{i}\). The ground layer VAOD is then computed as follows:  
\[VAOD=\frac{\left(C_{0}-C_{\#}\right)\cos\theta}{2}\,. \tag{48}\]  
Figure 16 highlights several aspects of the performance of the ground-layer detection algorithm presented. Here a ground layer extends from ground to \(\sim\)4 km height; the signal \(\mathcal{S}\) above the ground layer fit perfectly the molecular signal prediction \(F(h)\) for that night, location and the corresponding two wavelengths, visible in the fit \(\left(\chi_{i}^{2}/N_{\text{dot}}\right)^{\text{min}}\) (red lines), which fluctuates around values slightly lower than one (in the case of the 355 nm line) and around one (in the other case of the 532 nm line). All values of \(\left(\chi_{i}^{2}/N_{\text{dot}}\right)^{\text{min}}\) obtained from the ground layer show considerably higher values (note the logarithmic axis). The corresponding fit constants, \(C_{i}\), appear flat within 3% peak-to-peak in the free troposphere and larger throughout the entire ground layer. Extending the molecular to the ground leads to the reference constant \(C_{\#}\) of the free troposphere, which can be used to derive the full VAOD of the ground layer assuming Equation (48) and a system constant \(C_{0}\), which needs to be constantly updated and calibrated according to the prescriptions of Fruck et al. [9]. Figure 16: Ground Layer calculations for an elastic channel simultaneously observed at 355 nm (**Left**) and 532 nm (**Right**). The blue and green lines show the logarithms of the range-corrected signals \(\mathcal{S}\), with and without ringing correction, respectively, and with and without optional signal smoothing applied. The purely molecular signal expectation \(F(h)\) is drawn as a black line, the scaling factor of the signal, \(C_{i}\) (Equation (45)), to fit the molecular expectation as a full orange line. The reference system constant \(C_{0}\) (Equation (41)) is displayed as a dashed orange line.