## 2 Materials and Methods
### Central Data Processing System
#### 2.3.3 The Level-1 File and the Level-1 QAQC Module  
The starting point of the processing is the submission of a daily (the maximum time period that the system can ingest is currently one local day) spectra file in a specific CF-compliant netCDF4 format. These spectra (level-1) are expected to be corrected for dark current and offset. A CDL representation of the current level-1 netCDF4 file format is given at [https://frm4 doas.aeronomie.be/](https://frm4 doas.aeronomie.be/), accessed on 27 November 2024. The structure of this file is inspired by formats for satellite data and was designed in such a way that data providers have the possibility to deliver ancillary information that can be used in the tropospheric profiling algorithms (e.g., temperature and pressure, surface albedo or aerosol parameters such as single scattering albedo, asymmetry factor of the aerosol optical depth at a reference wavelength). This extra information will also be included in all the master level-2 netCDF4 output files. The first module consists of a file check of the level-1 files. Figure 7: Concept diagram of an FRM4 DOAS module. See main text for more details. This check consists of the following components:  
1. Check against an XML template whether the file structure is correct and mandatory variables and attributes are present and have expected dimensions and fill-values. 2. Check whether the file name is consistent with the attributes within the file
3. If optional variables are present, check for consistency of expected dimensions and fill-values. 4. If solar angles are not present, calculate solar angles from location and UTC; otherwise, check for consistency
5. Basic checks on measurement type (zenith, off-axis, almucantar, horizon, direct sun); details are described below
6. If the configuration file states that tropospheric profiling should be performed, identify elevation scans and add scan numbers and a zenith before and/or after for each scan; details are described below. Measurement types are encoded using integers, and recognised encoded types are summarised in Table 7. As mentioned above under point 5, a basic check of these measurement types is performed. These checks are schematically illustrated in Figure 8. Such changes are never enforced, and differences between the check and the reported measurement type are only reported in the log file as a warning. Specifically, only the following changes are reported: originally classified almucantar (7) newly classified as direct sun (2) or horizon (11); originally classified as horizon (11) newly classified as almucantar (7), as well as changes that were originally classified as off-axis (1) and receive a different classification following the classification scheme outlined in Figure 8. Changes that originally have a classification different from off-axis (1) and result in a classification as possibly off-axis (1) are never reported as a warning since the classification as off-axis is never considered final. The limits in Figure 8 are specified in Table 8.  
Elevation scans and zenith reference measurements before and/or after the scan (see point 6 above) are identified following these steps:  
1. Check if the measurements are ordered chronologically. If not, order the measurements chronologically. 2. Look at each set of off-axis (measurement type 1, see above) measurements between two consecutive zenith (measurement type 3) measurements. 3. Distribute each such set into subsets according to their telescope azimuth angle (TAA); treat azimuth angles that differ less than 1 degree as the same azimuth angle. 4. For each such subset, check if all measurements in the set are within a maximum time difference. Currently, this time difference is set to 40 min. 5. Check if each subset (after applying the maximum time difference) contains at least 2 measurements. Discard all sequences that are shorter than 2 measurements.