Download Copernicus atmospheric reanalysis
Use the Copernicus Atmosphere Data Store (ADS) to retrieve a CAMS EAC4 field of total aerosol optical depth at 550 nm. ADS creates a job for each selection. The job ID lets you start the request, close the terminal, and collect the result later. This walkthrough uses one analysis time and a New Mexico region.
Set up ADS access in your browser
Section titled “Set up ADS access in your browser”- Open the ADS API setup page. Select Login or Register, complete the account steps, and return to the setup page while signed in. ADS API setup
- Under Setup the CDS Api key, find the configuration for
https://ads.atmosphere.copernicus.eu/api. Copy just the personal access token value afterkey:. Particula can save this value directly. - Open the EAC4 dataset’s Download tab. Review the terms at the bottom of the form and accept them if you agree. ADS requires this step in the browser before API retrieval. EAC4 download form
- Follow the Particula installation steps.
With your Python environment active, run the following commands. Paste the ADS token
at the hidden prompt. On a desktop, expect
system credential store.
particula-data login copernicusparticula-data status copernicusSubmit one job
Section titled “Submit one job”Save the following as eac4-request.json. It requests the January 1, 2025
18:00 UTC analysis. The area coordinates in degrees are north, west, south,
east. To adapt the selection, use Show API request code on the dataset
form to find the accepted variable names, dates and formats.
{ "variable": ["total_aerosol_optical_depth_550nm"], "date": ["2025-01-01/2025-01-01"], "time": ["18:00"], "area": [37, -109.1, 31.3, -103], "data_format": "grib"}Run this command once. Copy the job ID it prints. Submission confirms that ADS accepted the request. File generation can take longer.
particula-data copernicus-submit cams-global-reanalysis-eac4 eac4-request.jsonOpen a fresh terminal, activate the same environment, and replace JOB_ID
below with the ID you saved. The command waits for the job and writes its
result to the displayed path. After an interruption or wait timeout, repeat
this download command with the same ID.
particula-data copernicus-download JOB_ID data/cams/aod550.gribparticula-data verify data/cams/aod550.gribThe receipt includes the job ID and, when ADS supplies them, the collection and selection fields such as variable, time, area and format. Keep your request JSON so you can reproduce the selection if the job expires. For the selection above, a fresh Particula process used the saved ADS token to download a 300-byte GRIB edition 1 file. Its size and SHA-256 matched the download receipt. A fresh request for the same selection receives its own job ID and receipt.
Check the format from Python. Optical depth is dimensionless and describes the atmospheric column. Preserve the analysis time, grid cell and wavelength when comparing the reanalysis with satellite retrievals or model output. EAC4 product description
from pathlib import Path
path = Path("data/cams/aod550.grib")with path.open("rb") as stream: assert stream.read(4) == b"GRIB"print(path, path.stat().st_size, "bytes")Plot aerosol optical depth
Section titled “Plot aerosol optical depth”The worked example maps aerosol optical depth on the 0.75° EAC4 grid for January 1, 2025 at 18:00 UTC. Each value describes how strongly aerosols in the atmospheric column scatter and absorb 550 nm light. You can reproduce the figure offline with the example data, or use the download steps above to retrieve the field directly from ADS. Plot the New Mexico aerosol field
The map uses data from the Copernicus Atmosphere Monitoring Service (CAMS), distributed by ECMWF through the Atmosphere Data Store. Cite the dataset when reusing the example or its figure. CAMS global reanalysis (EAC4), DOI 10.24381/d58bbf47
Use the same selection from Python
Section titled “Use the same selection from Python”For a new request, the programmatic equivalent reads the same JSON and
records the job ID before waiting. For a job already submitted from the
terminal, pass its existing ID directly to download_copernicus.
import jsonfrom pathlib import Pathfrom particula.data.sources import submit_copernicus, download_copernicus
inputs = json.loads(Path("eac4-request.json").read_text())job_id = submit_copernicus("cams-global-reanalysis-eac4", inputs)Path("eac4-job.txt").write_text(job_id)path = download_copernicus(job_id, "data/cams/aod550.grib")If ADS returns HTTP 401 or 403, check that the token came from ADS and
that the same account accepted the EAC4 terms. Use
particula-data login copernicus to replace the saved token. For a failed
job, inspect the request in your ADS account and compare its selection with
the current download form before submitting a corrected request.
Related studies
Section titled “Related studies”Explore this topic: Optical properties