## 2 Methods
### Pre-Process Analysis
#### 2.2.3 Photon Background and Offset Determination  
The calculation of amplitude offsets and the photon background of Equation (3) requires some dedicated attention for two reasons:  
1. Ion feedback from the photocathode or atmospheric muons traversing the photomultiplier can create spurious high signals, particularly in the amplitude channel, even in the absence of backscattered laser light. 2. The exact ranges of signal-free data are unknown a priori. Contamination of those regions used for background estimation with signal (e.g., from spurious reflection of laser light on the guide mirrors or late atmospheric backscatter) must be avoided. Figure 6: Power Spectral Density (PSD) vs. Frequency plot for Channel 1 (355 nm), showing a detected oscillation at approximately 0.24 MHz, probably from a switching power supply. The light blue full lines show the measured PSD spectrum, while the dashed dark blue line shows the running mean over a window of 20 bins. The light blue area displays the RMSD of the running mean. Both are used to reveal strong local deviations from the underlying trend. The olive arrow marks the frequency where the oscillation was detected. To ensure a robust computation of the backgrounds even in the presence of these two nuisances, we elaborated a scheme that uses robust statistics and continuous tests for Poissonian behavior of the photon background. Both amplitude offset and photon background are searched before and after the backscatter signal. In both cases, a generous initial search range is set (up to 400 ns at the beginning of the trace and the last 500 us recorded. A search procedure, outlined below, is repeated until an optimal background search region is found (see Figures 8 and 9). Figure 8: Background calculation for the Elastic Channel (355 nm). The background-subtracted signal is shown with the region used for the determination of the background (green) and regions not considered due to signal leakage (blue). On the left side, for the AN channel, on the right side, for the PC channel, the signal is similarly segmented, and no sample region before the signal is available. Figure 7: An example of the interactive time-delay adjustment of the LPP. In this range selection, the two elastic AN channels can be time-adjusted through the atmospheric feature visible at \(\sim\)1700 m. The offsets (in meters) on the right sliders can be continuously adjusted. The feature is too weak, however, to produce a visible signal drop in the Raman channel and also allow for the adjustment of the time delay of that channel. Note the strong AN signal saturation of the elastic lines below \(\sim\)1000 m.  
For each set of \(n\) data points in a tentative background sample, the distribution of counts is trimmed [44] with \(\alpha=0.025\) of the data clipped at both extremes because of a possible presence of outliers (see point 1). From that, the trimmed mean \(\mu_{t}\) is calculated together with the unbiased distribution variance  
\[s_{n}^{2}\approx\frac{s_{w}^{2}}{(1-2\,\alpha)^{2}}\, \tag{7}\]  
where \(s_{w}^{2}\) is the sample variance of the _winsorized_ distribution [44,45]. In the case of PC channels, the total number of photo-electrons found in the background sample,  
\[N_{\text{ph,tot}}=\mu_{t}\cdot N_{sh}/f_{s} \tag{8}\]  
is calculated, with \(N_{sh}\) being the number of laser shots and \(f_{s}\) the LOTR sampling frequency. That number is then compared with the corresponding scaled Poisson variance  
\[s_{\text{ph,tot}}^{2}=s_{n}^{2}\cdot N_{sh}^{2}/f_{s}^{2}. \tag{9}\]  
We require that \(s_{\text{ph,tot}}^{2}\lesssim N_{\text{ph,tot}}\), i.e., its Poissonian expectation. Any excess variance must come from signal leakage and shall be discarded from the background calculation.