2.2. Data Sources
The study integrates satellite, meteorological reanalysis, and ground-based observations by first filtering and preprocessing each dataset, as described below.
The datasets were then temporally and spatially aligned to enable joint analysis: Sentinel-5P/TROPOMI: Daily tropospheric NO2 column densities (in mol/m2) were obtained for the period January–December 2024 from the Sentinel-5P satellite mission operated by the European Space Agency (ESA, Paris, France). The TROPOspheric Monitoring Instrument (TROPOMI) was developed by Airbus Defence and Space (Toulouse, France) and is operated within the Copernicus Earth Observation Programme of the European Commission (Brussels, Belgium).
Data were accessed through the Copernicus Open Access Hub (European Commission and ESA, Brussels, Belgium/Paris, France). Satellite observations were filtered using a cloud fraction threshold below 20% and a quality assurance (QA) value greater than 0.75, following recommended validation practices [
14]. Data were filtered for cloud cover below 20% and a quality assurance (QA) value greater than 0.75.
In addition to satellite-based NO
2 observations, meteorological variables, including 2-m air temperature, surface pressure, wind speed, relative humidity, and planetary boundary layer height (PBLH), were obtained from the ERA5 global reanalysis produced by the European Centre for Medium-Range Weather Forecasts (ECMWF, Reading, United Kingdom). ERA5 data were retrieved at a spatial resolution of 0.25° × 0.25° and hourly temporal resolution [
5,
6]. To complement the satellite and meteorological information, surface-level NO
2 concentrations were obtained from the Automatic Atmospheric Monitoring Network (Red Automática de Monitoreo Atmosférico, RAMA), operated by the Secretaría del Medio Ambiente (SEDEMA), Mexico City, Mexico. Hourly NO
2 measurements (ppb) were downloaded from the Mexico City Atmospheric Monitoring System portal [
8], and daily mean concentrations were computed for comparison with satellite observations.
- (A)
Conversion of Station Data (ppb → µg/m3)
The concentrations of NO
2 measured by the stations of the Automatic Atmospheric Monitoring Network (RAMA) are reported in parts per billion (ppb). To convert them to micrograms per cubic meter (µg/m
3), the equation derived from the ideal gas law was applied:
where
is the concentration in micrograms per cubic meter,
is the concentration in parts per billion,
is the molecular weight of NO2 (46 g/mol),
is the atmospheric pressure (hPa),
is the universal gas constant (8.314 J·mol−1·K−1), and
is the temperature in Kelvin (K).
This relationship is frequently used in air quality studies [
1,
11] to convert atmospheric NO
2 measurements into mass units, facilitating comparisons between ground stations and satellite observations.
For standard conditions (1 atm, 298 K), the approximation used was:
This conversion allows direct comparison between surface measurements and concentrations derived from satellite products, expressed in units of mass per volume. This method is widely accepted in the literature on urban air pollution [
1,
17,
18].
- (B)
Conversion of Satellite Data (mol/m2 → µg/m3)
The tropospheric NO2 columns provided by Sentinel-5P/TROPOMI represent the number of moles per square meter (mol/m2).
First, to convert moles per square meter (mol/m2) to parts per million (ppm) of nitrogen dioxide (NO2), the molar concentration must be converted into a mass concentration (g/m3) and then into ppm. The conversion from mol/m2 to ppm of NO2 is not direct, since mol/m2 represents a molar concentration over an area, while ppm refers to a volumetric concentration.
Equation (3) converts mol/m2 to mol/m3 by multiplying the molar concentration by the height of the volume being considered. For example, if an air column of height h meters is considered, the molar concentration in mol/m3 would be (mol/m2) × h (m).
In this study, the column height is 7 km (i.e., 7000 m), as TROPOMI performs spatial sampling at a 7 km × 7 km resolution, since NO
2 is primarily located within the troposphere [
14,
15].
For tropospheric NO
2 or tropospheric ozone, Sentinel-5P specifically retrieves concentrations limited to the troposphere (approximately from the surface to altitudes of 8–15 km, depending on latitude and season). Tropospheric NO
2 is the focus of air quality monitoring because it is more closely associated with human activities, such as traffic and industry. Therefore, in this study, the column height of 7 km is derived from the operation 15 − 8 = 7.
The next step was to calculate the mass concentration (g/m
3) using the following equation:
where the molar mass of NO
2 is 46.005 g/mol [
16].
Finally, the ppm value was calculated using the density of NO2 at standard conditions (0 °C [273.15 K] and 1 atm), which is approximately 1.697 g/m3.
For the above, the ideal gas law in its density form was used as a reference [
19]:
However, the density p (in g/m
3) is given by:
Therefore, the formula for the density of a gas is:
where
p: density (g/m3)
P: pressure (in Pa = pascals)
M: molar mass (g/mol)
R: gas constant = 8.314 J/mol·K
T: absolute temperature (K)
Data:
P = 1 atm = 101,325 Pa
T = 0 °C = 273.15 K
M = 46.0055 g/mol
R = 8.314 J/mol·K
Substituting into the formula:
The formula for calculating ppm is:
Then, the conversion from ppm to µg/m
3 was performed using the equation derived from the ideal gas law, which allows expressing the mass of a gas as a function of its volumetric concentration, temperature, and atmospheric pressure:
where
is the concentration in micrograms per cubic meter,
is the concentration in parts per million,
is the molar mass of NO2 (46 g·mol−1),
is the atmospheric pressure (in hPa or Pa),
is the gas constant (8.314 J·mol−1·K−1), and
is the temperature in Kelvin (K).
For standard conditions (1 atm = 1013.25 hPa, 298 K), the equation simplifies to the following empirical form, commonly used in air quality studies:
Therefore, 1 ppm of NO2 is approximately equivalent to 1880 µg/m3 under standard conditions.
This conversion is widely used to harmonize data from different sources (ground stations and satellite products), ensuring comparability between observations expressed in volumetric units (ppm) and mass units (µg/m
3). Furthermore, the relationship has been validated in several atmospheric modeling and monitoring studies [
1,
15,
16,
17,
18,
19].
This enabled direct comparison of satellite and ground-based NO2 values on the same scale and in the same unit.
To illustrate this process,
Figure 1 outlines the steps of the NO
2 unit conversion process and demonstrates how it is integrated into the broader methodological framework for NO
2 estimation.
This study was conducted strictly for academic purposes. The data analyzed were not reported to any governmental entity, and their processing focused on evaluating pollutant behavior from a scientific and exploratory perspective.
2.4. Data Preprocessing
- (A)
Temporal Alignment
The time zone was unified to America/Mexico_City.
Satellite observations (13:20 local time) were matched to the nearest hourly block (13:00 h).
A continuous time series was generated for each station by combining ERA5 and Sentinel-5P data.
Records without temporal matches across sources (NA) were removed.
- (B)
Data Cleaning
Data cleaning was performed in R, removing null values, outliers, and unvalidated records, preserving only synchronized and complete observations.
- (C)
Spatial Bilinear Interpolation
To synchronize differences in resolution between point-based stations and satellite pixels, bilinear interpolation was applied. This method calculates intermediate values by weighting the distances between the four nearest points.
As shown in
Figure 2, bilinear interpolation smoothed spatial variability in NO
2 across monitoring stations.
The bilinear interpolation demonstrated solid performance: Coefficient of Determination (R
2): 0.9196; Root Mean Square Error (RMSE): 6.80 µg/m
3; Mean Absolute Error (MAE): 4.55 µg/m
3; and Bias: 0.20 µg/m
3 (see
Table 2). These results confirm the method’s ability to represent the spatial variability of NO
2 with high precision, consistent with previous studies conducted in similar urban contexts [
11,
20,
21,
22].
Comparing nitrogen dioxide (NO
2) concentrations from satellite (Sentinel-5P/TROPOMI) and surface measurements (RAMA) allowed assessment of both data sources. Both time series (
Figure 3 and
Figure 4) showed similar patterns. Peaks coincided with periods of high vehicular activity and stable atmospheric conditions. This revealed a strong temporal correspondence between spatial and ground-based observations.
Statistical analysis showed a strong Pearson correlation (r > 0.90) between the two measurements. Annual mean NO2 concentration was 42.8 µg/m3 from RAMA. It was 41.9 µg/m3 from satellite data after conversion and alignment. Ground-based data had a slightly higher standard deviation (±27.5 µg/m3) than satellite data (±24.8 µg/m3), reflecting more local surface-level variability.
These differences arise from the nature of each observation. Satellite sensors measure integrated tropospheric columns, which are affected by dispersion factors, cloud cover, and optical depth. Monitoring stations, in contrast, capture point-specific surface values that may be amplified by traffic intensity and unique topographic conditions [
2,
5,
23,
24].
The analysis of the mean bias (Bias) revealed a slight overestimation of satellite data relative to stations (+0.06 µg/m
3), indicating an excellent fit and the potential to apply bias-correction techniques, such as quantile mapping, to enhance the local representation of modeled values. Therefore, we recommend implementing bias corrections, specifically quantile mapping, to enhance the accuracy of local satellite data. This level of agreement is comparable to that found in studies conducted in other megacities, where the differences between satellite and surface observations generally remain within ±10% [
4,
14,
18,
25].
The graphs illustrate the temporal correspondence between the two data sources and the consistency of concentration peaks associated with urban pollution episodes.
2.7. Comparison with the State-of-the-Art AQNet Model
To contextualize the performance of the RF-based downscaling framework, we conducted a comparative analysis against AQNet, a recently proposed multimodal deep learning architecture specifically designed for Sentinel-based NO2 prediction. AQNet integrates:
- (1)
Sentinel-2 multispectral imagery (12 bands);
- (2)
Sentinel-5P tropospheric NO2;
- (3)
Tabular descriptors including altitude, population density, urban/rural classification, and station metadata.
AQNet employs a MobileNetV3 backbone for Sentinel-2, a compact CNN for Sentinel-5P, and a fully connected network for structured data, followed by multimodal fusion layers. Trained across more than 1300 stations in Europe (2018–2020), AQNet achieved:
Our RF model, trained exclusively on TROPOMI, ERA5 variables, and RAMA observations, outperformed both AQNet configurations, achieving R2 = 0.972, RMSE = 3.81 µg/m3, and MAE = 2.91 µg/m3. Despite its simplicity relative to AQNet’s multimodal design, RF benefited from high-quality, locally aligned data, demonstrating that traditional ensemble techniques can surpass deep neural architectures when supported by dense in situ observations and region-specific preprocessing workflows.
This finding is consistent with prior evaluations showing that deep learning models outperform classical machine learning only when large, multiregional datasets are available [
12,
14,
27].
To contextualize the performance of the Random Forest (RF) downscaling framework developed in this study, a comparative evaluation was conducted against AQNet, a recently proposed state-of-the-art multimodal deep learning architecture for Sentinel-based NO
2 prediction. The quantitative performance comparison between the RF model and both the baseline and fine-tuned versions of AQNet is summarized in
Table 3.
As shown in
Table 3, the RF model achieved substantially higher predictive skill than AQNet across all reported metrics, including the coefficient of determination (R
2), root mean squared error (RMSE), and mean absolute error (MAE). Despite relying on fewer input modalities, limited to TROPOMI tropospheric NO
2, ERA5 meteorological variables, and geographic coordinates, the RF model outperformed AQNet’s multimodal configurations, which integrate Sentinel-2 imagery, Sentinel-5P data, and tabular descriptors. This result highlights the effectiveness of locally aligned preprocessing and dense in situ observations, demonstrating that ensemble-based machine learning approaches can surpass complex deep learning architectures when applied to region-specific air quality downscaling.
2.9. Sensitivity Analysis and Uncertainty Assessment
A comprehensive sensitivity analysis was performed to evaluate the robustness of the methodological framework and quantify uncertainty arising from (i) assumptions in tropospheric column height, (ii) meteorological predictors derived from ERA5, and (iii) the conversion between volumetric (ppm) and mass-based (µg/m
3) NO
2 concentrations. This procedure follows established approaches in satellite validation, AMF characterization, urban atmospheric modeling, and machine-learning-based NO
2 estimation [
4,
5,
6,
10,
11,
12,
14,
15,
16,
18,
19,
26,
28,
29].
All reported concentrations include an explicit uncertainty term (±error), consistent with error-propagation practices recommended. The conversion of tropospheric NO
2 column densities (mol/m
2) into volume-based concentrations (mol/m
3) requires an assumed tropospheric column height. Although a nominal value of 7 km was adopted in accordance with Sentinel-5P specifications and mid-latitude climatological profiles [
4,
5,
6,
13,
18], Mexico City’s atmospheric structure is highly variable due to its altitude, topography, and frequent thermal inversions [
1,
2,
7]. To evaluate structural dependence, four alternative heights were tested: 5 km, 7 km (baseline), 10 km, and 12 km. These sensitivity bounds are consistent with the role of vertical-profile assumptions and AMF-related uncertainty in satellite NO
2 retrieval and validation workflows [
5,
6,
18,
29].
2.9.1. Sensitivity to Tropospheric Column Height
The conversion of tropospheric NO
2 column densities (mol/m
2) into volume-based concentrations (mol/m
3) requires an assumed tropospheric column height. Although a nominal value of 7 km was adopted in accordance with Sentinel-5P specifications and mid-latitude climatological profiles [
4,
5,
6,
13,
18], Mexico City’s atmospheric structure is highly variable due to its altitude, topography, and frequent thermal inversions [
1,
2,
7]. To evaluate structural dependence, four alternative heights were tested: 5 km, 7 km (baseline), 10 km, and 12 km.
The results demonstrate substantial sensitivity (
Table 5), consistent with reported uncertainties in vertical profile assumptions and AMF retrievals for TROPOMI and ground-based DOAS measurements [
5,
6,
18,
29]. The corresponding concentration curves are illustrated in
Figure 6.
Variations in column height introduce significant structural uncertainty and represent the most sensitive element of the conversion process. Reduced-height scenarios (≤5 km) lead to systematic overestimations, whereas expanded-height scenarios (≥10 km) tend to attenuate pollutant magnitude.
These variations are consistent with structural uncertainties observed in tropospheric retrievals and AMF calculations [
5,
6,
18,
29].
2.9.2. Sensitivity to Meteorological Predictors
Meteorological parameters influence NO
2 dispersion, optical depth, and vertical mixing, particularly in high-altitude megacities such as Mexico City [
1,
2,
7,
23]. To assess model robustness, two perturbation strategies were applied:
- (A)
Replacement of ERA5 predictors with ERA5-Land, reflecting structural differences between reanalysis products [
28].
- (B)
Stochastic ±1σ perturbations to temperature, pressure, wind speed, and PBLH, following methodologies used in machine learning atmospheric modeling [
11,
15,
31,
32].
Table 6 and
Figure 6 summarize the model’s sensitivity to perturbations applied to the ERA5 meteorological predictors. Overall, the results show that the Random Forest model is relatively stable, but its performance does respond differently to variations in specific atmospheric variables.
Table 6 evaluates how sensitive the model is to different meteorological perturbations by measuring how much the error (ΔRMSE) increases when each variable is altered.
Replacing the standard ERA5 predictors with ERA5-Land leads to a substantial increase in model error. This indicates that structural differences between the two reanalysis datasets have a meaningful impact on NO2 estimation.
Perturbing temperature produces a moderate increase in error, suggesting that thermal conditions influence the model’s representation of NO2 dynamics, but not as strongly as wind or dataset substitution.
Surface pressure also results in moderate sensitivity. Changes in pressure slightly affect air density and vertical stability, resulting in noticeable but not dominant changes in the model output.
Wind shows the largest increase in error among all predictors. This indicates that horizontal advection and turbulence play a major role in determining NO2 transport and dispersion, making wind the most influential meteorological factor in the model.
Although the numerical value is moderate, PBLH is classified as the dominant driver because variations in the planetary boundary layer directly determine the depth available for pollutant mixing. Even small perturbations can significantly affect near-surface NO2.
The sensitivity of the Random Forest model to perturbations in meteorological predictors is illustrated in
Figure 7, which shows the relative changes in model error associated with variations in temperature, pressure, wind speed, and planetary boundary layer height.
These impacts agree with those reported for megacity-scale NO
2 retrieval modeling in China, Europe, and North America [
15,
25,
30,
31].
2.9.3. Sensitivity to ppm–µg/m3 Conversion Factors
The conversion from volumetric concentration (ppm) to mass concentration (µg/m
3) depends on temperature, pressure, and gas density. Its sensitivity has been noted in atmospheric chemistry and exposure assessment literature [
1,
17,
19]. Due to Mexico City’s high elevation (~2240 m), non-standard atmospheric conditions significantly modify NO
2 density and thus the ppm–µg/m
3 conversion factor [
2,
7,
23]. To quantify the impact of thermodynamic variability, three representative atmospheric cases were evaluated. The corresponding conversion factors, relative deviations from standard conditions, and associated uncertainty levels are summarized in
Table 7.
Three thermodynamic cases were evaluated:
These ranges match previously documented variability in NO
2 density under changing thermodynamic conditions [
13,
17,
19].
The variability of the ppm–µg/m
3 conversion factor for NO
2 under standard, mean, and extreme thermodynamic conditions is illustrated in
Figure 8, highlighting the sensitivity of mass-based concentration estimates to changes in temperature and pressure.
2.9.4. Representation of Measurement Uncertainty (±Error)
To ensure methodological transparency and reproducibility, all NO
2 values reported in this study are expressed together with their corresponding measurement uncertainty. This applies to values derived from surface observations, satellite retrievals, or Random Forest predictions. We use the notation value ± error. This convention follows recommended practices for atmospheric data processing, error propagation, and satellite–ground validation frameworks applied in tropospheric NO
2 research [
5,
6,
18,
29]. Building on this convention, we now describe the approach used to quantify uncertainty across the various data sources employed.
For surface NO
2 observations obtained from the RAMA, uncertainty was quantified as: [describe method below]. The next section outlines the procedure used for this quantification.
where σobs represents the standard deviation of hourly values aggregated into daily means. This variability reflects short-term atmospheric processes such as turbulent diffusion, boundary layer fluctuations, and photochemical dynamics, which collectively contribute to intra-day concentration dispersion [
7,
13,
19]. The resulting value, therefore, characterizes both the magnitude and natural temporal heterogeneity of surface-level NO
2.
For model-derived estimations, uncertainty was represented as:
where denotes the Random Forest prediction and σ
model corresponds to the spread of the residuals. This statistical dispersion was estimated using the model’s cross-validated root mean square error (RMSE) and mean absolute error (MAE). These metrics are widely used in machine-learning-based NO
2 downscaling and atmospheric modeling studies [
11,
15,
30,
31]. They encapsulate intrinsic uncertainty related to algorithmic learning, predictor variability, and structural differences between satellite-derived and surface-measured pollutant concentrations.
Uncertainty derived from meteorological predictors was incorporated through perturbation experiments in which key atmospheric variables were modified using ERA5 and ERA5-Land datasets. Similarly, variability in the ppm–µg/m
3 conversion factor was expressed as a function of temperature- and pressure-dependent thermodynamic conditions, which can produce deviations ranging from mild to substantial depending on atmospheric state [
1,
17,
19].
Finally, the total propagated uncertainty for each estimate was computed using quadratic error summation:
This approach is consistent with retrieval and AMF uncertainty propagation commonly used in the validation of TROPOMI tropospheric NO
2 products [
5,
6,
18,
29]. The final reported concentrations, therefore, incorporate the combined effects of column-height assumptions, meteorological variability, conversion-factor sensitivity, and model residuals, providing a comprehensive representation of measurement uncertainty across all stages of the methodological workflow.
Table 8 summarizes the uncertainty associated with the observational dataset and the Random Forest model. The observed NO
2 concentrations have a mean of 38.45 µg/m
3 and substantial day-to-day variability (±23.97 µg/m
3), reflecting the characteristic temporal fluctuations of urban pollution, influenced by traffic intensity, meteorology, and boundary layer dynamics. Predicted values show an almost identical mean (38.35 ± 24.55 µg/m
3), indicating that the model accurately reproduces not only the central tendency but also the pollutant’s natural variability.
The model performance metrics express uncertainty as the statistical dispersion of errors. The RMSE (5.52 ± 3.35 µg/m3) and MAE (4.38 ± 3.35 µg/m3) fall within expected ranges for machine learning NO2 downscaling applications, demonstrating stable performance even under meteorological variability. The bias remains nearly zero (−0.10 ± 5.52 µg/m3), confirming the absence of systematic over- or underestimation. Together, these results indicate that uncertainty is well quantified and does not degrade the integrity of the model predictions, supporting their use for urban air quality assessment.
Figure 9 illustrates the relationship between observed and predicted surface-level NO
2 concentrations, incorporating measurement uncertainty through horizontal and vertical error bars. Each white point represents an individual daily observation–prediction pair across all RAMA stations, while the gray envelope displays the propagated uncertainty (±error) associated with both observational variability and model residual spread. The 1:1 reference line (black dashed) indicates perfect agreement between observations and predictions. The close clustering of points around this line, with no systematic divergence at either low or high concentrations, demonstrates that the Random Forest model reproduces the magnitude and distribution of surface NO
2 with high fidelity. The symmetry and narrow width of the error envelopes further confirm that uncertainty is balanced and does not introduce directional bias. This representation highlights the robustness of the modeling framework under diverse atmospheric conditions and supports the reliability of the downscaled NO
2 estimates.