Obtain the data from RData
Read data by a bounds of longitude and latitude
Users can give a bounds of longitude and latitude to read the station data.
Load the ObsAQ package and Define the range
[1]:
import obsaq
lon_min = -1
lon_max = 2
lat_min = 50
lat_max = 55
bounds=[lon_min, lon_max, lat_min, lat_max]
Get the station metadata
NOTE: This is the all station information and the next step will choose the stations by bounds.
[2]:
meta = obsaq.meta()
site_table = meta.get_metadata_RData()
site_table.head(5)
[2]:
| site_id | site_name | location_type | latitude | longitude | parameter | Parameter_name | start_date | end_date | ratified_to | zone | agglomeration | local_authority | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | O3 | Ozone | 2003-08-01 | 2021-09-20 | 2021-09-20 | North East Scotland | NaN | Aberdeen City |
| 1 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | NO | Nitric oxide | 1999-09-18 | 2021-09-20 | 2021-09-20 | North East Scotland | NaN | Aberdeen City |
| 2 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | NO2 | Nitrogen dioxide | 1999-09-18 | 2021-09-20 | 2021-09-20 | North East Scotland | NaN | Aberdeen City |
| 3 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | NOXasNO2 | Nitrogen oxides as nitrogen dioxide | 1999-09-18 | 2021-09-20 | 2021-09-20 | North East Scotland | NaN | Aberdeen City |
| 4 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | SO2 | Sulphur dioxide | 2001-01-01 | 2007-09-30 | 2007-09-30 | North East Scotland | NaN | Aberdeen City |
Choose the stations by range
[3]:
final_sites = meta.get_site(bounds=bounds)
final_sites.head(5)
Site is selected by bounds: [-1, 2, 50, 55]
[3]:
| site_id | site_name | location_type | latitude | longitude | parameter | Parameter_name | start_date | end_date | ratified_to | zone | agglomeration | local_authority | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 93 | AYLA | Aylesbury A4157 | Urban Traffic | 51.822161 | -0.793884 | PM2.5 | PM2.5 particulate matter (Hourly measured) | 2025-08-11 | ongoing | 2025-09-30 | South East | NaN | Aylesbury Vale |
| 94 | AYLA | Aylesbury A4157 | Urban Traffic | 51.822161 | -0.793884 | wd | Modelled Wind Direction | 2025-08-11 | ongoing | Never | South East | NaN | Aylesbury Vale |
| 95 | AYLA | Aylesbury A4157 | Urban Traffic | 51.822161 | -0.793884 | ws | Modelled Wind Speed | 2025-08-11 | ongoing | Never | South East | NaN | Aylesbury Vale |
| 96 | AYLA | Aylesbury A4157 | Urban Traffic | 51.822161 | -0.793884 | temp | Modelled Temperature | 2025-08-11 | ongoing | Never | South East | NaN | Aylesbury Vale |
| 386 | BDMP | Borehamwood Meadow Park | Urban Background | 51.661229 | -0.270550 | NO | Nitric oxide | 2017-10-01 | ongoing | 2025-09-30 | Eastern | NaN | Hertsmere |
Read data by site_id
[4]:
import obsaq
meta = obsaq.meta()
site_table = meta.get_metadata_RData()
site_table.head(5)
[4]:
| site_id | site_name | location_type | latitude | longitude | parameter | Parameter_name | start_date | end_date | ratified_to | zone | agglomeration | local_authority | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | O3 | Ozone | 2003-08-01 | 2021-09-20 | 2021-09-20 | North East Scotland | NaN | Aberdeen City |
| 1 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | NO | Nitric oxide | 1999-09-18 | 2021-09-20 | 2021-09-20 | North East Scotland | NaN | Aberdeen City |
| 2 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | NO2 | Nitrogen dioxide | 1999-09-18 | 2021-09-20 | 2021-09-20 | North East Scotland | NaN | Aberdeen City |
| 3 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | NOXasNO2 | Nitrogen oxides as nitrogen dioxide | 1999-09-18 | 2021-09-20 | 2021-09-20 | North East Scotland | NaN | Aberdeen City |
| 4 | ABD | Aberdeen | Urban Background | 57.15736 | -2.094278 | SO2 | Sulphur dioxide | 2001-01-01 | 2007-09-30 | 2007-09-30 | North East Scotland | NaN | Aberdeen City |
[5]:
final_sites = meta.get_site(site_id='LH')
final_sites.drop_duplicates(subset='site_id')
Site is selected by site_id: LH
[5]:
| site_id | site_name | location_type | latitude | longitude | parameter | Parameter_name | start_date | end_date | ratified_to | zone | agglomeration | local_authority | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1949 | LH | Lullington Heath | Rural Background | 50.7937 | 0.18125 | O3 | Ozone | 1986-10-04 | ongoing | 2025-09-30 | South East | NaN | Wealden |