## 2 Materials and Methods
### Central Data Processing System
#### 2.3.7 The Tropospheric Profiling Module  
As outlined in Section 2.2.1, FRM4 DOAS currently implements the MMF [21] and the MAPA [23] tropospheric trace gas retrieval algorithms. Both ingest differential slant column densities with respect to a reference at the scan zenith. While the QDOAS analysis for HCHO already uses the scan zenith as a reference, this is not the case for NO\({}_{2}\) and O\({}_{4}\), for which a pre-processing step is necessary. Based on the information about the scan number of each measurement and the zenith measurements before and after each scan (as identified in the level-1 QAQC processing), the measurements are re-ordered into elevation scans, and a time-averaged contribution, using the zenith before and the zenith after, is subtracted from each off-axis measurement of the scan. Further, using the RMS between a 4-degree polynomial fit through 5 consecutive zenith measurements, an additional error on the differential slant column is calculated for those species that do not use the scan measurement as a reference in the QDOAS analysis. This extra error was introduced to account for fast time variability in the trace gas concentration. It is possible to specify a list of elevation angles, or azimuth-elevation angle pairs, in the station-specific configuration files (see Section 2.3.4), to exclude specific elevation angles (for all azimuth directions, for specific azimuth directions or all elevation angles below a certain elevation angle) from the processing. Currently, as default, all elevation angles below 0.8\({}^{\circ}\) are excluded for all stations. Both currently implemented retrieval codes need a temperature and pressure profile for the aerosol inversion. These profiles are either taken from a climatology as briefly mentioned in Section 2.3.6 or taken from profiles provided in the level-1 file. The climatology profiles are based on data from 20 years (1995-2016) of global reanalysis by the European Centre for Medium-Range Weather Forecasts (ECMWF). Daily median values were prepared by MPIC on a global grid with a 1\({}^{\circ}\)\(\times\) 1\({}^{\circ}\) resolution on 60 pressure levels. Within FRM4 DOAS, a separate file is prepared for each station. If the level-1 file contains surface values for temperature and pressure but no profile information, the temperature profile of the lowest 5 km above surface is calculated with a fixed laps rate of \(-\)6.5 K/km. Once this pre-processing is performed, the data are passed to the different tropospheric profiling codes via a set of dictionaries and returned as an output dictionary. Hence, new or updated codes can be connected easily. Although both codes have their individual flagging procedure, an additional quality step is performed on the results from both codes. This is introduced since only results from the MMF retrieval code are delivered in the GEOMS files. However, MAPA results are used as an additional quality flag: The integrated partial column up to 2 km and up to 4 km is calculated and checked for consistency between both codes within their delivered uncertainties. Furthermore, it is required that at least one of the codes individually judges a scan as valid. A previous version of the processor (version 1.0) used an additional flag based on the extra error calculated from consecutive zenith measurements, see description above. Specifically, the system flagged measurement scans as invalid if the calculated extra error was larger than a factor of 3 than the median of the QDOAS estimated error of the zenith before and zenith after scans. While this does filter out conditions for which the assumption of temporal homogeneity breaks down, it also introduces a low bias on average. To illustrate this point, we show in Figure 9 the annual variation of TROPOMI and ground-based tropospheric NO\({}_{2}\) column measurements for Xianghe, derived from roughly 3 years of measurements (July 2019 to September 2022).