UK monthly historical station data

source is the same for UK-hist_station: “UK-hist_station”, “UK-hist-station”, “UK_hist_station”, “UK_hist-station”, “UK_hist_station”, “UK_hist-station”

get meta load, if true, read the metadata as Dataframe

[1]:
from obswx import *

# initialize the UK-hist_station source
met = obswx(source='UK-hist_station')

# get the metadata
met.get_meta(load=True).head()
[1]:
Name lon lat Opened Link
0 Aberporth -4.570 52.139 1941 https://www.metoffice.gov.uk/pub/data/weather/...
1 Armagh -6.649 54.352 1853 https://www.metoffice.gov.uk/pub/data/weather/...
2 Ballypatrick Forest -6.153 55.181 1961 https://www.metoffice.gov.uk/pub/data/weather/...
3 Bradford -1.772 53.813 1908 https://www.metoffice.gov.uk/pub/data/weather/...
4 Braemar No 2 -3.396 57.011 1959 https://www.metoffice.gov.uk/pub/data/weather/...

metadata is from UK-hist-stataion-meta (last access: 2024-04-30), originally from the UK Met Office, and is available at: https://www.metoffice.gov.uk/research/climate/maps-and-data/historic-station-data .

  • get_data station, station name when obswx(source='UK-hist_station')

[2]:
met.get_data(station="Armagh")
Getting data from UK Historical Station
Goto here to help select station:  https://junjieyu-uom.github.io/obswx/UK-hist-station-map
Getting data from https://www.metoffice.gov.uk/pub/data/weather/uk/climate/stationdata/armaghdata.txt
[2]:
yyyy [nan] mm [nan] tmax [degC] tmin [degC] af [days] rain [mm] sun [hours]
1 1853.0 1.0 --- --- --- 57.3 ---
2 1853.0 2.0 --- --- --- 32.3 ---
3 1853.0 3.0 --- --- --- 65.5 ---
4 1853.0 4.0 --- --- --- 46.2 ---
5 1853.0 5.0 --- --- --- 13.2 ---
... ... ... ... ... ... ... ...
2051 2023.0 11.0 10.6 4.2 3 58.2 67.3
2052 2023.0 12.0 9.6 5.0 4 96.6 24.7
2053 2024.0 1.0 7.8 1.5 10 39.4 58.1
2054 2024.0 2.0 10.2 4.1 1 56.2 69.4
2055 2024.0 3.0 10.5 4.1 2 97.0 89.9

2055 rows × 7 columns

  • Mean daily maximum temperature (tmax)

  • Mean daily minimum temperature (tmin)

  • Days of air frost (af)

  • Total rainfall (rain)

  • Total sunshine duration (sun)

save the data

[ ]:
df = met.get_data(station="Armagh")
df.to_csv("Armagh.csv", index=False) # save the data to a csv file