## 2 Methods
### Dynamic Rebinning  
The dynamic rebinning algorithm addresses the presence of negative values produced during background subtraction in the glued signal. The algorithm operates by dynamically adjusting the bin widths structure to eliminate negative values, while at the same time maintaining fine binning where a strong signal (for instance, due to a cloud) is visible. The glued PC rates \(\mathcal{R}_{i}\) are segmented into discrete windows where values fall below a predefined threshold \(T\). This threshold is chosen to isolate regions that contain signals with too small values \(\mathcal{R}_{i}<T\) (by default \(T=3\cdot r_{b}\) is chosen). The algorithm returns a series of such windows \(W_{j}\):  
\[W_{j}\;\text{boundaries:}\;[i_{1},i_{2}],\quad\text{where}\;\mathcal{R}_{i}<T, \;\forall i\in[i_{1},i_{2}]. \tag{32}\]  
Figure 14: **Top**: Logarithms of the range-corrected-signals, \(\mathcal{S}_{i}\), obtained with the \(\chi^{2}\)-based gluing method (blue), the likelihood-based method, before (red) and after (green) a ringing correction has been applied. No re-binning has yet been applied here; negative signals are not shown. **Below**: The residuals between the signals from the upper plots obtained with likelihood-based methods (before and after ringing correction) and those from the \(\chi^{2}\)-based gluing are shown, as well as the statistical uncertainty of the likelihood-based \(\mathcal{S}_{i}\). The left columns show a 355 nm elastic line with little photon background, the central column a 389 nm Raman line, and the right column a 532 nm elastic line with very strong photon background from the street lighting of the UAB university campus. If all \(\mathcal{R}_{i}\geq T\), the windows remain unchanged and correspond to the sampling window of the LOTR. Wherever windows are found with \(\mathcal{R}_{i}<T\), the algorithm proceeds to the re-binning phase. In windows containing negative values, adjacent bins are averaged iteratively in pairs until the averaged signal in the new window is positive or the new window contains the entire \(W_{j}\). For each bin \(i\), the signal rate \(\mathcal{R}_{i}\), bin width \(w\), and variance are updated as follows:  
\[\mathcal{R}_{\text{re-binned}}(j)=\frac{1}{N}\sum_{i\in\text{W}_{j}}\mathcal{R }_{i},\quad w_{\text{re-binned}}(j)=\sum_{i\in\text{W}_{j}}w(i),\quad s_{\text {re-binned}}^{2}(\mathcal{R}_{j})=\frac{1}{N^{2}}\sum_{i\in\text{W}_{j}}s^{2}( \mathcal{R}_{i}). \tag{33}\]  
Here, \(N\) is the step size, representing the number of original bins combined during the re-binning process. This normalization ensures that the signal density and associated variances remain consistent with the original bin structure and that the total signal content is preserved:  
\[\sum_{j}\mathcal{R}_{\text{re-binned}}(j)=\sum_{i}\mathcal{R}_{i}. \tag{34}\]  
For windows with an odd number of bins, the last bin is summed with the previous pair of bins, forming a \"three-bin\" group:  
\[\mathcal{R}_{\text{re-binned}}(j)=\mathcal{R}_{i-2}+\mathcal{R}_{i-1}+ \mathcal{R}_{i}. \tag{35}\]  
This ensures consistency in bin width distributions while maintaining the stability of the signal representation. If a window continues to contain negative values, even after rebinning (e.g., at the very end of the summation procedure), it gets replaced by a default baseline signal value, corresponding to \(P(X>0|\mu=\mu_{0})=0.5\) yielding \(\mu_{0}=0.69\) photoelectrons in the entire window:  
\[\mathcal{R}_{\text{baseline}} =e\cdot\frac{0.69\,f_{\text{s}}}{N_{sh}} \tag{36}\] \[s_{\text{U},L}^{2}(\mathcal{R}_{\text{baseline}}) =e^{2}\cdot\frac{|0.69-\mu_{U,L}(0)|^{2}f_{\text{s}}^{2}}{N_{sh}^ {2}}\] (37) \[s_{L}^{2}(\mathcal{R}_{\text{baseline}}) =e^{2}\cdot\frac{0.69^{2}f_{\text{s}}^{2}}{N_{sh}^{2}}\] (38) \[s_{\text{U}}^{2}(\mathcal{R}_{\text{baseline}}) =e^{2}\cdot\frac{(1.84-0.69)^{2}f_{\text{s}}^{2}}{N_{sh}^{2}} \tag{39}\]  
Once all windows are processed, the rebinned signal values, widths, and variances are integrated to form a new range-corrected signal.