These notes are a quick reference for participants of the Air Quality Hack. Registration will be strictly at 9am and while we’ll do everything possible to make it a fast start for everyone, reading these notes first will be a big time saver!
What air quality datasets are available?
There are two air quality datasets:
- Historical Air Quality Sensor Data — an archive of reading data from 2001 to 2013 (2014 data not yet ratified).
- “Live” Air Quality Sensor Data — a continuously updated dataset containing the latest readings from the current sensors
There’s also a third dataset that contains the names and geographic locations for the 5 sensors. These are also available as JSON.
How is the data collected and how often is it updated?
The data is collected by 5 air quality sensors that are situated around Bath. You can see them on a map. The sensors measure different aspects of air quality.
The sensors measurements are collected from the sensors and added to a repository at B&NES at 15-60 minute intervals. The data is then published to the live store at 1-4 hour intervals.
So while this is a live, continuously updated dataset, there is a lag between the recordings and the data being available.
Obviously the historical data won’t change, its an archive of previous readings made available for further analysis.
Please note this is RAW data, direct from the monitors/sensors. It has not been adjusted to account for errors, monitor drift or failures, some data may therefore show unusual results (e.g. negative data or spikes).
Air pollutants measured in B&NES
Nitrogen dioxide (NO2): This is the main pollutant of interest. A gas that is directly emitted and created after emission of NOx. Most of the major road network in Bath exceeds the national objective limit for an annual average of 40 micrograms per cubic metre (μg/m³). An hourly limit of 200 μg/m³ is not to be exceeded more than 18 times a year. The Bath Air Quality Management Area roughly covers the areas where this objective is exceeded. No other pollutants exceed the objectives in Bath and North East Somerset.
Oxides of nitrogen/nitrogen oxides (NOx): This encompasses nitric oxide (NO) and nitrogen dioxide (NO2).
Particulate matter (PM10): Particulate matter with diameter of 10 micrometres or less. Objective limit of 40 μg/m³ as an annual average is not exceeded in Bath. 24 hourly limit of 50 μg/m³ not to be exceeded more than 35 times a year (also not exceeded).
Ozone (O3): aka Trioxygen. Greenhouse gas. Formed by the reaction of sunlight on air containing hydrocarbons and nitrogen oxides that react to form ozone directly at the source of the pollution or many kilometers downwind. National air quality objective is 100 μg/m³ not to be exceeded more than 10 times a year as measured over an 8hr mean.
Carbon monoxide: National air quality objectives of 10 μg/m³ as a running 8 hour mean.
A deeper explanation for what air pollutants mean for public health in BANES is available on the Wiki.
How do I get access to the data?
You can get access to the data in one of two ways:
- Via an API — each dataset in the store has an API. Click the “Export” tab on the dataset page to get the endpoint for the dataset. Socrata publish some documentation on the SODA API. There’s also an OData API for each dataset if you prefer that.
- Via a download — again, via the “Export” tab you can download the data in various formats. This might be useful if you’re doing some local analysis. Bear in mind that the historical dataset is very large. Please perform any large downloads before attending the event.
In order to use the API with higher rate limits, you will need to have signed up for a Socrata account & use your account details for authentication. If you would like to create your own Socrata datasets or visualisations ahead of the event, feel free to get in touch & we can escalate your account privileges.
What do the columns in the datasets mean?
Data is recorded in each datastore in raw units of measure & should be converted to appropriate units according to any calculations to be performed & any prevailing standards.
|Unique identifier for the reading
|Time reading was recorded in GMT
|Sensor Location Name
|Name of sensor. The names match the entries in the sensor location dataset.
|Sensor Location Slug
|Identifier for sensor
|Latitude and longitude for the sensor, i.e. where the reading was taken
|Nitric oxide and nitrogen dioxide.
|Particulate matter with diameter of 10 micrometres or less
Units of measurement:
- micrograms per cubic metre = μg/m3
- milligrams per cubic metre = mg/m3
- parts per billion = ppb
- parts per million = ppm
Is there any guidance on interpreting the data?
The DEFRA air quality site has some useful background resources, this page has some links to information on causes and effects of air pollution.
DEFRA also provide some guidance on official reports of air quality indexes, and detailed notes on the calculations.
Air quality indices should be calculated in μg/m³, using multipliers of measurement units. Specific colours should be used for each index. Outlier values (caused by maintenance) should be removed from averages. Some useful values have been made available as JSON.
How is the data licensed?
The data is published under the UK Open Government Licence. This means its available for anyone to use without restriction except that you have to attribute the source of the data using the text below and a link to the data on the Bath: Hacked datastore:
Contains information published by Bath & North East Somerset Council under the Open Government Licence.
What other datasets might be useful?
Depending on your hack there are a number of other datasets or APIs you might want to use.
- Summary statistics of average climate in Bath from 1981-2010
- The MetOffice DataPoint API provides access to current and some historical weather data which might be useful. This requires you to register to get an API key. If you plan to use this, it might be worth signing up ahead of the event
- The DEFRA air quality data archive has additional data available for the UK and its regions.
Remember there is a prize for Best Mashup!
I have other questions not covered here, who can I contact?
Before the event, feel free to tweet us at @BathHacked and we’ll do our best to answer any questions.
We hope to have some experts available on the hackday, at least in the morning, to answer any further questions about the data.
Cover photo courtesy of Daz Smith.