Repository navigation
Air quality from CAMS: NO2, CO, ozone, SO2, particles and the US AQI (model "air") - #17
Merged
Merged
Conversation
…(model "air") The Copernicus Atmosphere Monitoring Service's global forecast, from the Atmosphere Data Store: two runs a day, hourly to 120 h, stored on its own 0.4° grid. The gases at the lowest model level are turned into µg/m³ with the air's density there; the US EPA's Air Quality Index is worked out at ingest hour by hour with EPA's breakpoints and averaging windows (forecast/aqi.py, checked against the technical document's worked examples). The ADS queues requests, so the ingest asks for a run on one poll (prepare raises RunPending) and downloads it on a later one, without holding up the other models. One request at a time, checked against the dataset's constraints first; a failed one is asked again only after a wait, as the ADS asks of automated clients. Served by default only when CDSAPI_KEY is set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The expert asked for NO2, CO and an AQI. This adds a model
airfrom CAMS, the Copernicus Atmosphere Monitoring Service's global forecast (ECMWF's IFS with chemistry, about 40 km), read from the Atmosphere Data Store (ADS).What it serves (
/v2/air/...), hourly to 120 h, from two runs a day, on CAMS's own 0.4° grid:no2,co,o3,so2: the gases at the model's lowest level (about 10 m up), in µg/m³. They are converted from mass mixing ratios using the air's density, taken from that level's temperature and pressure; the pressure uses the files' own level coefficients.pm25,pm10: the same ids and meaning as GEFS-Aerosols', so the two models can be compared.aqi: the US EPA Air Quality Index, computed at ingest (forecast/aqi.py) following EPA-403/B-26-003 (May 2026):aqi_max,no2_mean,co_mean,o3_max,pm25_mean,pm10_mean.Getting a run. The ADS queues requests, which can take anywhere from under a minute to an hour. The ingest is built so the queue never holds up the other models:
prepareraises the newRunPending), and the other models go on.data/forecast/air/.ads, so a restart carries on with the same request.The ECMWF data stores' current notice for automated clients asks for one request at a time and warns against resubmitting invalid requests. So:
Accounts and licence.
CDSAPI_KEYis set. Production's.envdoesn't have it yet.Checked.
A stored run is about 0.7 GB, and two are kept.