ee20bab0bd | 6 years ago | |
---|---|---|
doc | 7 years ago | |
silo | 7 years ago | |
README.md | 6 years ago | |
setup.py | 6 years ago |
README.md
silo
Scientific Information for Land Owners (SILO) is a database of Australian climate data from 1889 (current to yesterday). It provides daily datasets for a range of climate variables in ready-to-use formats suitable for research and climate applications. SILO products provide national coverage with interpolated infills for missing data, which allows you to focus on your research or model development without the burden of data preparation.
https://silo.longpaddock.qld.gov.au
There are two different data types:
Point data:
Get multiple climate variables at a single point (accessible with this python module).
Gridded data:
Get a single climate variable for the entire Australian continent (accessible on the SILO website).
Point data
Installation
pip install git+http://git.wrl.unsw.edu.au:3000/danh/silo.git
Usage
import silo
# Reigster for API key at https://silo.longpaddock.qld.gov.au/register
api_key = 'BcfJnotlnVgX9gyLmZh2dURqNH8xAD3m8Am7V9OY'
variables = ['daily_rain', 'max_temp', 'min_temp']
start = '18990101'
finish = '20180101'
lat = -33
lon = 151
silo.pointdata(variables, api_key, start, finish, lat=lat, lon=lon,
output='silo-data.csv')
silo-data.csv
date | latitude | longitude | daily_rain_mm | daily_rain_source | max_temp_Celsius | max_temp_source | min_temp_Celsius | min_temp_source |
---|---|---|---|---|---|---|---|---|
1899-01-01 | -33 | 151 | 0.9 | 24 | 31.4 | 35 | 14.8 | 35 |
1899-01-02 | -33 | 151 | 0 | 24 | 30.1 | 35 | 18.3 | 35 |
1899-01-03 | -33 | 151 | 0 | 24 | 33.3 | 35 | 14.3 | 35 |
... |
Gridded data
Gridded datasets are available here:
https://silo.longpaddock.qld.gov.au/gridded-data
Example: generate timeseries at specific location
import xarray as xr
import pandas as pd
import calendar
import matplotlib.pyplot as plt
# Open netcdf dataset
fname = '2000.monthly_rain.nc'
ds = xr.open_dataset(fname)
# Convert to pandas dataframe
df = ds.to_dataframe().drop(columns=['crs'])
# Set coordinates
lat = -33.75
lon = 151.25
# Create temporary dataframe at specific location
df1 = df.loc[(lat, lon), :]
# Plot time series
fig, ax = plt.subplots(1, 1, figsize=(6, 4))
ax.plot(df1.index, df1.values)
# Tidy up figure
ax.set_xticks(df1.index)
ax.set_xticklabels([calendar.month_abbr[i] for i in df1.index.month])
ax.set_ylabel('Rainfall (mm)', labelpad=10)
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
plt.show()
Example: generate maps at specific dates
import xarray as xr
import pandas as pd
import calendar
import matplotlib.pyplot as plt
# Open netcdf dataset
fname = '2000.monthly_rain.nc'
ds = xr.open_dataset(fname)
# Convert to pandas dataframe
df = ds.to_dataframe().drop(columns=['crs'])
# Get index values
lats = df.index.get_level_values('lat').unique()
lons = df.index.get_level_values('lon').unique()
dates = df.index.get_level_values('time').unique()
fig, ax = plt.subplots(3, 4)
for i, date in enumerate(dates):
# Get temporary dataframe with only one date ('slice(None)' is ':')
df1 = df.loc[(slice(None), slice(None), date), :]
# Split multi-index so that rows=latitude and columns=longitude
grid = df1.unstack().unstack()
# Plot colour map for current month
a = ax.ravel()[i]
im = a.imshow(grid, cmap='Blues', vmin=-100, vmax=800)
a.set_title(calendar.month_abbr[i + 1])
a.invert_yaxis()
a.axis('off')
# Add colour bar
cbax = fig.add_axes([0.95, 0.3, 0.02, 0.4])
cb = fig.colorbar(im, cax=cbax)
cb.set_ticks([0, 200, 400, 600, 800])
cbax.set_ylabel('Monthly rainfall (mm)', labelpad=10)
plt.show()
Available climate variables
code | name | units |
---|---|---|
daily_rain | Daily rainfall | mm |
monthly_rain | Monthly rainfall | mm |
max_temp | Maximum temperature | Celsius |
min_temp | Minimum temperature | Celsius |
vp | Vapour pressure | hPa |
vp_deficit | Vapour pressure deficit | hPa |
evap_pan | Evaporation - Class A pan | mm |
evap_syn | Evaporation - synthetic estimate | mm |
evap_comb | Evaporation - combination (synthetic estimate pre-1970, class A pan 1970 onwards) | mm |
evap_morton_lake | Evaporation - Morton's shallow lake evaporation | mm |
radiation | Solar radiation - total incoming downward shortwave radiation on a horizontal surface | MJm-2 |
rh_tmax | Relative humidity at the time of maximum temperature | % |
rh_tmin | Relative humidity at the time of minimum temperature | % |
et_short_crop | Evapotranspiration - FAO56 short crop | mm |
et_tall_crop | Evapotranspiration - ASCE tall crop | mm |
et_morton_actual | Evapotranspiration - Morton's areal actual evapotranspiration | mm |
et_morton_potential | Evapotranspiration - Morton's potential evapotranspiration | mm |
et_morton_wet | Evapotranspiration - Morton's wet-environment areal evapotranspiration over land | mm |
mslp | Mean sea level pressure | hPa |