Cleaned AOD products

Created 9 Nov 2026 • Last modified 19 Nov 2026

This page describes some public data products from the project Earth_obs_cleaning and gives some hints on how to use them. Earth_obs_cleaning is described in "A post-processing machine-learning workflow to reduce retrieval error in MAIAC AOD: Results from CONUS" (manuscript in preparation). Earth_obs_cleaning takes MCD19A2, a NASA product giving aerosol optical depth (AOD) from two satellites (Terra and Aqua), and corrects it with a statistical model, using AERONET observations of AOD as ground truth. The usable results comprise files of corrected AOD for Terra and Aqua over the contiguous United States (CONUS) for several years over the operational life of these satellites.

The grid

A common grid is used by all the AOD files. It can be found as a NetCDF 4 raster file at:

https://arfer.net/projects/earth_obs_cleaning/cleaned_mcd19a2_v1/conus/grid.nc

The grid is constructed from the same tiles that MCD19A2 uses, and it's projected in the same idiosyncratic sinusoidal coordinate reference system (CRS) as MCD19A2. The file grid.nc has one layer, region, which assigns cells to one of the NOAA climate regions (which see for a map and included states, but note that I count Washington, DC, as part of Maryland and hence the "Northeast" climate region, since it has no official region). I identify the regions like so:

# Name Full name
1 n Northern Rockies and Plains
2 ne Northeast
3 nw Northwest
4 ov Ohio Valley
5 s South
6 se Southeast
7 sw Southwest
8 um Upper Midwest
9 w West

Grid cells for which region is missing are considered outside the study area. The AOD files never include values for them.

AOD files

The AOD is provided as tabular files in Parquet format in this directory:

https://arfer.net/projects/earth_obs_cleaning/cleaned_mcd19a2_v1

Each file can be found at a URL like this:

https://arfer.net/projects/earth_obs_cleaning/cleaned_mcd19a2_v1/conus/terra/ov/conus_terra_ov_2015.parquet

Here:

  • terra is the satellite (terra or aqua).
  • ov is the region name.
  • 2015 is the year. Years are defined according to UTC, so e.g. in theory, 11 pm on 31 Dec 2015 in New York City is covered in the 2016 files, not the 2015 files; in practice, AOD isn't available at night.

Files range in size from hundreds of megabytes to a few gigabytes. Each file has these columns:

  • satellite_is_aqua (Boolean): False for Terra, true for Aqua.
  • region (integer): The region number.
  • cell (integer): The index of the corresponding grid cell. Like regions, cells are numbered starting from 1, not 0. Cell 1 is the northwest corner of the grid, and cell 2 is one grid square to the east of cell 1.
  • time (timestamp): The overpass time for the MCD19A2 file that produced this AOD. Although this Parquet data type supports microsecond precision, the values only have 1-second precision.
  • aod (integer): The corrected AOD value. This uses a scale factor of 1e5 (10,000), so multiply by 1e-5 to get values on the original scale of AOD.

Notice that satellite_is_aqua and region are constant within each file and redundant with the filename. I've provided them for convenience when merging files.

None of the values in these columns are missing, but rows are only present for some combinations of satellite, region, cell, and time, not every combination. Generally, a missing row represents missing data in MCD19A2. Earth_obs_cleaning doesn't fill in missing AOD; it only tries to correct AOD values that are already present.

Usage examples

Here are two example workflows using the corrected AOD product. I give equivalent code in two programming languages, Python and R. In both languages, I show how to use DuckDB to get only the data you need. This requires DuckDB's httpfs extension. To install it, just say install httpfs in DuckDB.

All below code is licensed under the GNU General Public License (as published by the Free Software Foundation, either version 3 of the License, or, at your option, any later version).

Functions for getting AOD

Python

from datetime import datetime, UTC
from zoneinfo import ZoneInfo
import rasterio, rasterio.features
import numpy as np, pandas as pd, geopandas
import duckdb

grid = rasterio.open('https://arfer.net/projects/earth_obs_cleaning/cleaned_mcd19a2_v1/conus/grid.nc')

def get_aod(satellites, shapes, time_min, time_max):

    region_abbrs = ('n', 'ne', 'nw', 'ov', 's', 'se', 'sw', 'um', 'w')

    assert time_min.tzinfo.key == time_max.tzinfo.key

    ex = pd.concat(
        [
            pd.DataFrame(dict(ID = i, row = xys[:,0], col = xys[:,1]))
            for i, shape in enumerate(shapes.geometry.to_crs(grid.crs))
            for xys in [np.argwhere(rasterio.features.geometry_mask(
                [shape],
                grid.shape,
                grid.transform,
                all_touched = True,
                invert = True
            ))]
        ],
        ignore_index = True)
    ex['cell'] = ex['row']*grid.shape[1] + ex['col'] + 1
    regions = grid.read(1)[ex['row'], ex['col']]

    # Drop cells outside the study area.
    na, = grid.nodatavals
    ex = ex[regions != na]
    regions = regions[regions != na]

    urls = [
        f"https://arfer.net/projects/earth_obs_cleaning/cleaned_mcd19a2_v1/conus/{satellite}/{ra}/conus_{satellite}_{ra}_{year}.parquet"
        for satellite in satellites
        for ra in [region_abbrs[r - 1] for r in set(regions.astype(int))]
        for year in range(time_min.astimezone(UTC).year, time_max.astimezone(UTC).year + 1)
    ]

    with duckdb.connect(':memory:') as duck:
        duck.execute('set TimeZone = ?', [time_min.tzinfo.key])
        duck.execute('set enable_progress_bar = true')
        return duck.execute(
            """select
                satellite_is_aqua, ID, row, col, time, aod
                from read_parquet(split(?, '|'))
                join ex
                using (cell)
                where time between to_timestamp(?) and to_timestamp(?)
                order by satellite_is_aqua, ID, cell, time""",
            [
                '|'.join(urls),
                int(time_min.timestamp()),
                int(time_max.timestamp())
            ]
        ).df()

R

library(sf)
library(terra)
library(DBI)
library(duckdb)

grid = rast("https://arfer.net/projects/earth_obs_cleaning/cleaned_mcd19a2_v1/conus/grid.nc")

get.aod = \(satellites, shapes, time.min, time.max) {

    region.abbrs = c("n", "ne", "nw", "ov", "s", "se", "sw", "um", "w")

    tz = attr(time.min, "tzone")
    stopifnot(identical(tz, attr(time.max, "tzone")))
    utc.year = \(time)
        as.integer(format(`attr<-`(time, "tzone", "UTC"), "%Y"))

    ex = subset(
        extract(
            grid,
            st_transform(crs = st_crs(grid), shapes),
            touches = TRUE,
            cell = TRUE
        ),
        !is.na(region)
    )

    urls = with(
         expand.grid(
             satellite = satellites,
             region = unique(ex$region),
             year = utc.year(time.min) : utc.year(time.max)
         ),
         sprintf(
            "https://arfer.net/projects/earth_obs_cleaning/cleaned_mcd19a2_v1/conus/%s/%s/conus_%s_%s_%s.parquet",
            satellite,
            region.abbrs[region],
            satellite,
            region.abbrs[region],
            year
        )
    )

    duck = dbConnect(duckdb())
    on.exit(dbDisconnect(duck))
    dbExecute(duck, "set TimeZone = ?", tz)
    dbWriteTable(duck, "Ex", ex)

    dbGetQuery(
        duck,
        "select
            satellite_is_aqua, ID, cell, time, aod
            from read_parquet(split(?, '|'))
            join Ex
            using (cell)
            where time between to_timestamp(?) and to_timestamp(?)
            order by satellite_is_aqua, ID, cell, time",
        list(
            paste(collapse = "|", urls),
            as.integer(time.min),
            as.integer(time.max)
        )
    )
}

A polygon on one day

Let's get Terra AOD for every grid cell in Rhode Island on 2025-08-03 and make a map. At the time, the area was covered in smoke from Canadian wildfires. First, download the Census shapefile cb_2019_us_state_500k.zip, which we'll use to identify Rhode Island (which is actually a multi-polygon geometry, not a single polygon). After getting the gridded AOD, we'll reproject it to a more suitable CRS for Rhode Island, Universal Transverse Mercator zone 19. The squares of the grid no longer appear square in this CRS.

Python

tz = ZoneInfo('America/New_York')
aod = get_aod(
    satellites = ['terra'],
    shapes = geopandas
        .read_file('/vsizip/cb_2019_us_state_500k.zip')
        .filter(pd.col('NAME') == 'Rhode Island'),
    time_min = datetime(2025, 8, 3, tzinfo = tz),
    time_max = datetime(2025, 8, 4, tzinfo = tz)
)
print(aod)
#       satellite_is_aqua  ID   row   col                      time    aod
# 0                 False   0   957  6824 2025-08-03 09:55:00-04:00  42211
# 1                 False   0   957  6825 2025-08-03 09:55:00-04:00  40074
# 2                 False   0   957  6826 2025-08-03 09:55:00-04:00  40774
# 3                 False   0   957  6827 2025-08-03 09:55:00-04:00  42939
# 4                 False   0   957  6828 2025-08-03 09:55:00-04:00  43627
# ...                 ...  ..   ...   ...                       ...    ...
# 3709              False   0  1061  6736 2025-08-03 09:55:00-04:00  13467
# 3710              False   0  1062  6729 2025-08-03 09:55:00-04:00  13888
# 3711              False   0  1062  6730 2025-08-03 09:55:00-04:00  10655
# 3712              False   0  1062  6731 2025-08-03 09:55:00-04:00  10965
# 3713              False   0  1062  6732 2025-08-03 09:55:00-04:00  11352

import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap as LSC
from matplotlib_scalebar.scalebar import ScaleBar

g = np.full(grid.shape, -1)
g[aod['row'], aod['col']] = aod['aod']
features = [
    (geo, v / 1e5)
    for geo, v in rasterio.features.shapes(g, transform = grid.transform)
    if v != -1
]
aod = geopandas.GeoDataFrame.from_features(
    (dict(geometry = geo) for geo, _ in features),
    crs = grid.crs
)
aod['aod'] = [v for _, v in features]

aod.to_crs('epsg:32619').plot(
    column = 'aod',
    legend = True,
    edgecolor = 'face',
    cmap = LSC.from_list(0, ['#fcc', '#f00'])
)
plt.gca().add_artist(ScaleBar(1))
plt.axis('off')
plt.savefig('plot.png', bbox_inches = 'tight')
py_polygon.png

R

tz = "America/New_York"
aod = get.aod(
    satellites = "terra",
    shapes = subset(
        read_sf(as_tibble = FALSE, "/vsizip/cb_2019_us_state_500k.zip"),
        STUSPS == "RI"
    ),
    time.min = as.POSIXct("2025-08-03", tz = tz),
    time.max = as.POSIXct("2025-08-04", tz = tz)
)

str(aod)
#'data.frame':   3714 obs. of  5 variables:
# $ satellite_is_aqua: logi  FALSE FALSE FALSE FALSE FALSE FALSE ...
# $ ID               : num  1 1 1 1 1 1 1 1 1 1 ...
# $ cell             : int  8045625 8045626 8045627 8045628 8045629 8045630 8045631 8045632 8045633 8045634 ...
# $ time             : POSIXct, format: "2025-08-03 09:55:00" "2025-08-03 09:55:00" ...
# $ aod              : int  42211 40074 40774 42939 43627 44380 46250 46313 50773 51010 ..

g = grid
g$aod = NA_integer_
g$aod[aod$cell] = aod$aod
aod = st_transform(
    st_as_sf(as.polygons(trim(g$aod))),
    crs = "epsg:32619"
)
library(ggplot2)
ggplot(aod) +
    geom_sf(aes(fill = aod / 1e5), color = NA) +
    scale_fill_gradient(name = "AOD", low = "#fcc", high = "#f00") +
    theme_void() +
    # The below annotations constuct a scale bar.
    annotate(
         "rect",
         xmin = 2.7e5, xmax = 2.7e5 + 2e4,
         ymin = 4.575e6, ymax = 4.575e6 + 1000,
         fill = "black"
    ) +
    annotate(
        "text",
        x = 2.7e5, y = 4.575e6,
        label = "0",
        vjust = 1
    ) +
    annotate(
        "text", x = 2.7e5 + 2e4, y = 4.575e6,
        label = "20 km",
        vjust = 1
    )
r_polygon.png

A set of points on multiple days

Let's get the AOD at a few retired coal power plants and see how the mean AOD differed before and after retirement.

Python

tz = ZoneInfo('America/New_York')
plants = pd.DataFrame(dict(
    ID            = ('Cheswick', 'Bridgeport', 'River Rouge',   'Eckert'),
    lon           = (-79.791389,   -73.184167,    -83.124699, -84.662078),
    lat           = ( 40.538333,    41.171389,     42.270523,  42.694957),
    retired_year  = (      2022,         2021,          2021,       2021)
))

aod = get_aod(
    satellites = ['terra', 'aqua'],
    shapes = geopandas.GeoDataFrame(
        plants,
        geometry = geopandas.GeoSeries.from_xy(plants['lon'], plants['lat']),
        crs = 'WGS84'
    ),
    time_min = datetime(2019, 1, 1, tzinfo = tz),
    time_max = datetime(2025, 1, 1, tzinfo = tz)
)
aod['ID'] = pd.Categorical.from_codes(aod['ID'], plants['ID'])
print(aod)
#       satellite_is_aqua        ID   row   col                      time    aod
# 0                 False  Cheswick  1135  5923 2019-01-05 10:30:00-05:00   5008
# 1                 False  Cheswick  1135  5923 2019-01-05 12:10:00-05:00   4056
# 2                 False  Cheswick  1135  5923 2019-02-25 11:00:00-05:00   3575
# 3                 False  Cheswick  1135  5923 2019-02-28 11:30:00-05:00   4261
# 4                 False  Cheswick  1135  5923 2019-03-09 11:25:00-05:00  16551
# ...                 ...       ...   ...   ...                       ...    ...
# 5154               True    Eckert   876  5733 2024-11-08 14:05:00-05:00   6617
# 5155               True    Eckert   876  5733 2024-11-10 15:25:00-05:00   8686
# 5156               True    Eckert   876  5733 2024-11-12 15:05:00-05:00   3538
# 5157               True    Eckert   876  5733 2024-11-26 14:30:00-05:00   3432
# 5158               True    Eckert   876  5733 2024-12-30 14:05:00-05:00   4078

aod = aod.merge(plants[['ID', 'retired_year']])
aod['years_retired'] = aod['time'].dt.year - aod['retired_year']
aod = aod[abs(aod['years_retired']).isin([1, 2])]
aod['retired'] = aod['years_retired'] > 0
print(aod
    .groupby(['ID', 'retired'])
    ['aod']
    .agg(N = 'size', mean_aod = lambda x: (x.mean() / 1e5).round(3))
)
#                        N  mean_aod
# ID          retired               
# Bridgeport  False    539     0.112
#             True     572     0.114
# Cheswick    False    353     0.148
#             True     438     0.150
# Eckert      False    360     0.146
#             True     372     0.161
# River Rouge False    381     0.148
#             True     425     0.154

R

tz = "America/New_York"
plants = data.frame(
    ID            = c("Cheswick", "Bridgeport", "River Rouge",   "Eckert"),
    lon           = c(-79.791389,   -73.184167,    -83.124699, -84.662078),
    lat           = c( 40.538333,    41.171389,     42.270523,  42.694957),
    retired.year  = c(     2022L,        2021L,         2021L,      2021L)
)

aod = get.aod(
    satellites = c("terra", "aqua"),
    shapes = st_as_sf(
        plants,
        coords = c("lon", "lat"),
        crs = "WGS84"
    ),
    time.min = as.POSIXct("2019-01-01", tz = tz),
    time.max = as.POSIXct("2025-01-01", tz = tz)
)
aod$ID = structure(aod$ID, class = "factor", levels = plants$ID)
str(aod)
#'data.frame':   5159 obs. of  5 variables:
# $ satellite_is_aqua: logi  FALSE FALSE FALSE FALSE FALSE FALSE ...
# $ ID               : Factor w/ 4 levels "Cheswick","Bridgeport",..: 2 2 2 2 2 2 2 2 2 2 ...
# $ cell             : int  8902190 8902190 8902190 8902190 8902190 8902190 8902190 8902190 8902190 8902190 ...
# $ time             : POSIXct, format: "2019-01-11 11:30:00" "2019-01-22 11:15:00" ...
# $ aod              : int  3109 3832 3118 6750 8167 4104 5428 3329 4215 5799 ...

library(data.table)
aod = merge(as.data.table(aod), plants[, c("ID", "retired.year")])
aod[, years.retired := year(time) - retired.year]
print(
    aod[
         abs(years.retired) %in% 1:2,
         keyby = .(ID, retired = years.retired > 0),
         .(.N, mean.aod = round(mean(aod / 1e5), 3))
    ]
)
#            ID retired      N mean.aod
#        <char>  <lgcl> <char>    <num>
#1:  Bridgeport   FALSE    539    0.112
#2:  Bridgeport    TRUE    572    0.114
#3:    Cheswick   FALSE    353    0.148
#4:    Cheswick    TRUE    438    0.150
#5:      Eckert   FALSE    360    0.146
#6:      Eckert    TRUE    372    0.161
#7: River Rouge   FALSE    381    0.148
#8: River Rouge    TRUE    425    0.154