aeronet_oc_db
AERONET-OC (version 3, SeaPRISM) database for the validation of the satellite products of grs,
hgrs, grstbx and radcalnet_oc. It replaces the legacy shell tool (../download_aeronet_OC_v3.sh)
and does the following:
- downloads the data from the AERONET web service (
print_web_data_v3, all points). It either re-downloads the full record of each site, which picks up the reprocessing of past data, or fetches only the last days and merges them into the raw file; - discovers the new AERONET-OC sites (sites with data in the last 60 days);
- keeps the raw files
<site>_OCv3.lev15|lev20in the legacy layout. Each file is replaced atomically and only when its records changed, so existing readers keep working without changes; - builds the database products of the changed sites:
- one netCDF-4 file per site and level (CF-1.10 / ACDD-1.3,
featureType=timeSeries, compressed float32), dimensions(time, wl); - a Hive-partitioned Parquet dataset (zstd) with one row per (record, band), for queries across sites with pandas, pyarrow, duckdb or polars;
catalog.csv: one row per site and level with the coverage, location, bands, instruments, PI and the checksum of the raw file;
- one netCDF-4 file per site and level (CF-1.10 / ACDD-1.3,
- provides readers for validation: a dataset per site, filtered tables, and in situ statistics at satellite overpass times.
Install
pip install git+https://github.com/Tristanovsk/aeronet_oc_db.git
# development (editable) install
git clone https://github.com/Tristanovsk/aeronet_oc_db.git && pip install -e aeronet_oc_db
The packages that use it declare it as their aeronet extra under its name (aeronet_oc_db>=1.2), because
PyPI does not accept dependencies given by a git URL: install aeronet_oc_db from GitHub first, then e.g.
pip install radcalnet_oc[aeronet].
Update
aeronet-oc-db update --discover # full re-download of all sites, new sites, build
aeronet-oc-db update --days 30 # quick update: last 30 days merged into the raw files
aeronet-oc-db update --sites AAOT Venise --levels lev20
aeronet-oc-db build --force # rebuild the products from the raw files
aeronet-oc-db discover # active sites, flags the ones not in the database
aeronet-oc-db status # catalog
The root folder is $AERONET_OC_ROOT, or /DATA/AERONET/OCv3 by default (--root overrides it).
Each run is logged in db/update.log.
Level 2.0 data are quality-assured with a delay of months to years and past records get
reprocessed. Use --days for frequent updates, and run a full update (the default) from time to
time, e.g. monthly.
Location of the database (shared by all the packages)
The packages find the database without hardcoded paths, in this order:
$AERONET_OC_ROOT;rootin~/.config/aeronet_oc_db/config.toml(also read by Jupyter, PyCharm and cron, which do not always inherit the shell environment):root = "/DATA/AERONET/OCv3"
/DATA/AERONET/OCv3.
Use from the other packages
aeronet_oc_db is the single access layer to the AERONET-OC data. Each package declares it as an
optional dependency (aeronet extra), imports it only in the functions that need it, and keeps a
fallback when it is missing (CI, users without the database):
| package | install | entry points |
|---|---|---|
| radcalnet_oc | pip install radcalnet_oc[aeronet] |
Aeronet().read_site(site, level), Aeronet.open_site, Aeronet().aeronet_oc_site_info |
| grstbx | pip install grstbx[aeronet] |
Data().read_aeronet_oc_site, Data.open_aeronet_oc, Data.aeronet_oc_sites |
| invRrs | pip install invRrs[aeronet] |
aeronet_data_loading.read().read_site, read.open_site, read.sites |
| hgrs | validation scripts | validation/aeronet_oc/common.py (HGRS_VAL_AERONET overrides the location) |
| aeronet_visu | aeronet_files_merger.py |
Functions of aeronet_oc_db for the code of the packages:
import aeronet_oc_db
aeronet_oc_db.open_site('AAOT', 'lev20') # xarray.Dataset (time, wl), database names
aeronet_oc_db.open_site('AAOT', 'lev20', legacy_names=True) # names of the former netcdf/OCv3 files
aeronet_oc_db.raw_file('AAOT', 'lev20') # raw file, for the existing text readers
aeronet_oc_db.site_info() # location, Sentinel-2 tile, coverage per level
aeronet_oc_db.site_info(level='lev15') # columns of info_aeronet_oc_v15_location.csv
aeronet_oc_db.default_root() # location of the database
legacy_names=True gives the variable names of the former AERONET/netcdf/OCv3 conversion
(Aerosol_Optical_Depth, Lwn_fQ, Rrs_Lwn*, 'Total_Precipitable_Water(cm)', wavelength in um,
SZA, ...), so that existing code only changes the line that opens the data. New code should use the
database names.
The Sentinel-2 tile of each site comes from aeronet_oc_db/data/site_s2_tile.csv (checked by hand: the
stations in the overlap of two tiles, e.g. Venise and AAOT in 32TQR rather than 33TUL), or is computed
(MGRS 100 km square) for the new sites. Add a line to that file to force the tile of a site.
Layout
OCv3/
<site>_OCv3.lev15, <site>_OCv3.lev20 raw files (legacy layout: header on line 8)
db/catalog.csv
db/netcdf/<level>/<site>_OCv3.<level>.nc
db/parquet/level=<level>/site=<site>/data.parquet
db/update.log
Variables
| name | dims | units | AERONET field |
|---|---|---|---|
wl |
coord | nm | nominal band |
wl_exact |
time, wl | nm | Exact_Wavelengths(um) |
Lt, Lt_std, Lt_min_rel |
time, wl | uW cm-2 nm-1 sr-1 | Lt_mean, Lt_stddev, Lt_min_rel |
Li, Li_std |
time, wl | uW cm-2 nm-1 sr-1 | Li_mean, Li_stddev |
rho |
time, wl | 1 | Rho |
Lw, LwQ, Lwn, Lwn_fQ, Lwn_IOP |
time, wl | uW cm-2 nm-1 sr-1 | Lw, LwQ, Lwn, Lwn_f/Q, Lwn_IOP |
Rrs_Lwn, Rrs_Lwn_fQ, Rrs_Lwn_IOP |
time, wl | sr-1 | 10 Lwn / F0 (see below) |
aot, tau_rayleigh, tau_o3, tau_no2, tau_h2o |
time, wl | 1 | *_Optical_Depth |
sza_band, saa_band |
time, wl | degree | Solar_Zenith_Angle, Solar_Azimuth_Angle |
sza |
time | degree | mean of sza_band |
tco3, tno2 |
time | DU | Total_Ozone(Du), Total_NO2(DU) |
tcwv |
time | cm | Total_Precipitable_Water(cm) |
chl |
time | mg m-3 | Chlorophyll-a |
wind, pressure |
time | m s-1, hPa | Wind_Speed(m/s), Pressure(hPa) |
raa_sea, vza_sea |
time | degree | ASea(Degrees), ZSea(Degrees) |
instrument, quality_level, last_processed |
time | instrument number, data level, processing date | |
latitude, longitude, elevation, station_name |
scalar | site |
Rrs_* = 10 Lwn_* / F0(wl_exact). F0 is the Thuillier et al. (2003) spectrum averaged over a
Gaussian band of 10 nm FWHM centred on the exact wavelength, as in hgrs/validation/aeronet_oc.
The previous AERONET/netcdf/OCv3 files used the 0.3 nm spectrum interpolated at the exact
wavelength, which gives up to ±4% differences at 412 and 443 nm because of the Fraunhofer lines.
Times are UTC.
Use in the validation
from aeronet_oc_db import Database
db = Database()
# one site (xarray)
ds = db.open('AAOT', 'lev20')
ds.Rrs_Lwn_fQ.sel(time='2023-07').plot.line(x='wl', add_legend=False)
# in situ data at satellite overpasses: median of the records within 1 h
mu = db.match('AAOT', overpass_times, level='lev20', max_lag='1h') # dims (match, wl)
mu.Rrs_Lwn_fQ, mu.aot, mu.n_records, mu.lag_min
# several sites, filtered at read time (pandas)
df = db.table('lev20', sites=['AAOT', 'Venise', 'Galata_Platform'], start='2018-01-01',
columns=['Rrs_Lwn_fQ', 'aot', 'sza', 'chl'], wl=[443, 490, 560, 665])
# sites with a long level 2.0 record
db.catalog.query("level == 'lev20' and n_records > 1000")
The products can be read without this package:
import xarray as xr, pandas as pd
xr.open_dataset('/DATA/AERONET/OCv3/db/netcdf/lev20/AAOT_OCv3.lev20.nc')
pd.read_parquet('/DATA/AERONET/OCv3/db/parquet', filters=[('level', '==', 'lev20'), ('site', '==', 'AAOT')])
# duckdb: SELECT * FROM read_parquet('/DATA/AERONET/OCv3/db/parquet/*/*/*.parquet', hive_partitioning=true)
Tests
~/anaconda3/envs/py12/bin/python -m pytest tests
Releasing on PyPI
The workflow .github/workflows/pypi.yml builds the sdist and the wheel, checks them (twine check, version,
content), runs the tests on the installed wheel with Python 3.10 and 3.12, then publishes with PyPI trusted
publishing (no token stored).
One-time setup, on pypi.org and test.pypi.org (Your projects > Publishing > Add a new pending publisher):
owner Tristanovsk, repository aeronet_oc_db, workflow pypi.yml, environment pypi (resp.
testpypi). In the GitHub repository, create the environments pypi and testpypi
(Settings > Environments; a required reviewer on pypi adds a manual approval before each upload).
Release:
- set
__version__inaeronet_oc_db/__init__.py(the only place,pyproject.tomlreads it); - Actions > Publish on PyPI > Run workflow with
testpypi, then checkpip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ aeronet_oc_db; - tag and push:
git tag -a v<version> -m "aeronet_oc_db <version>" && git push origin v<version>: the workflow publishes on PyPI (the tag must match__version__).
Once on PyPI, pip install radcalnet_oc[aeronet] (or grstbx, invRrs) installs aeronet_oc_db with no
extra step.
Data policy
AERONET-OC data are public. Publications must acknowledge AERONET and the site PIs (the PI is stored in the attributes of each file and in the catalog). See https://aeronet.gsfc.nasa.gov/new_web/data_usage.html.
Metadata
Release files for aeronet-oc-db 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aeronet_oc_db-1.2.1.tar.gz | 79.4 kB | With provenance | Details for aeronet_oc_db-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aeronet_oc_db-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for aeronet_oc_db-1.2.1-py3-none-any.whl |
Total release size: 155.6 kB
Release files / aeronet_oc_db-1.2.1.tar.gz
| Download URL | aeronet_oc_db-1.2.1.tar.gz |
|---|---|
| Size | 79.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fa2dec554606753c133bafaafe63228c3fb3055abd6947067ee6e504b557ed4
|
|
BLAKE2b-256 checksum How to use checksums |
25ec3a433e7ff0dec7d1644ef89580bbf98cb832abbf9e2254f331900f8654eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / aeronet_oc_db-1.2.1-py3-none-any.whl
| Download URL | aeronet_oc_db-1.2.1-py3-none-any.whl |
|---|---|
| Size | 76.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f61db3705f7d4a8d8fa377b080806a34624155b15227cbe9f09f994e0b75d89d
|
|
BLAKE2b-256 checksum How to use checksums |
bba820ebb0c015d034a8e3b5636d24074bd30c2e4893852035e75e9b854e4bbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for aeronet-oc-db 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aeronet_oc_db-1.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.