CAMELS Australia
This example demonstrates how to use the aqua_fetch package to download and explore the CAMELS Australia dataset using the :py:class:aqua_fetch.RainfallRunoff class. Although we show it for CAMELS Australia, the same can be done for all other rainfall runoff datasets.
Note: This file runs online on readthedocs everytime the documentation is built. The server to download the CAMELS_AUS data is sometimes down and gives HTTPError: HTTP Error 500: Internal Server Error.
[1]:
import os
import site
if __name__ == '__main__':
wd_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath('__file__')))))
#wd_dir = os.path.dirname(os.path.realpath('__file__'))
#wd_dir = os.path.dirname(os.path.dirname(os.path.realpath('__file__')))
print(wd_dir)
site.addsitedir(wd_dir)
from tabulight import EDA
import matplotlib.pyplot as plt
from easy_mpl import scatter, hist
from easy_mpl.utils import process_cbar
from aqua_fetch import RainfallRunoff
from aqua_fetch.utils import print_info
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev
[2]:
print_info()
numpy 1.26.4
pandas 2.1.4
aqua_fetch 1.0.1
python 3.12.10 (main, May 6 2025, 11:38:28) [GCC 9.4.0]
os posix
matplotlib 3.8.4
shapefile 2.3.1
xarray 2024.7.0
netCDF4 1.7.4
scipy 1.17.0
fiona 1.10.1
Script Executed on: 04 February 2026 10:04:15
tot_cpus 2
avail_cpus 2
mem_gib 7.555538177490234
[3]:
dataset = RainfallRunoff('CAMELS_AUS', version=1,
#overwrite=True,
#path='/mnt/datawaha/hyex/atr/gscad_database/raw/CAMELS_AUS_V1'
)
01_id_name_metadata.zip already exists at /home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev/aqua_fetch/data/CAMELS/CAMELS_AUS
02_location_boundary_area.zip already exists at /home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev/aqua_fetch/data/CAMELS/CAMELS_AUS
03_streamflow.zip already exists at /home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev/aqua_fetch/data/CAMELS/CAMELS_AUS
04_attributes.zip already exists at /home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev/aqua_fetch/data/CAMELS/CAMELS_AUS
05_hydrometeorology.zip already exists at /home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev/aqua_fetch/data/CAMELS/CAMELS_AUS
CAMELS_AUS_Attributes&Indices_MasterTable.csv already exists at /home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev/aqua_fetch/data/CAMELS/CAMELS_AUS
unzipping files in /home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev/aqua_fetch/data/CAMELS/CAMELS_AUS
05_hydrometeorology already exists
02_location_boundary_area already exists
03_streamflow already exists
04_attributes already exists
01_id_name_metadata already exists
dynamic data already exists as /home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev/aqua_fetch/data/CAMELS/CAMELS_AUS/camels_aus_D.nc. To overwrite, set `overwrite=True`
[4]:
dataset.start
[4]:
'19500101'
[5]:
dataset.end
[5]:
'20181231'
[6]:
222
[7]:
stations[0:10]
[7]:
['912101A',
'912105A',
'915011A',
'917107A',
'919003A',
'919201A',
'919309A',
'922101B',
'925001A',
'926002A']
Static Features
[8]:
dataset.static_features
[8]:
['station_name',
'drainage_division',
'river_region',
'notes',
'lat',
'long',
'lat_centroid',
'long_centroid',
'map_zone',
'area_km2',
'state_outlet',
'state_alt',
'daystart',
'daystart_P',
'daystart_Q',
'nested_status',
'next_station_ds',
'num_nested_within',
'start_date',
'end_date',
'prop_missing_data',
'q_uncert_num_curves',
'q_uncert_n',
'q_uncert_q10',
'q_uncert_q10_upper',
'q_uncert_q10_lower',
'q_uncert_q50',
'q_uncert_q50_upper',
'q_uncert_q50_lower',
'q_uncert_q90',
'q_uncert_q90_upper',
'q_uncert_q90_lower',
'p_mean',
'pet_mean',
'aridity',
'p_seasonality',
'frac_snow',
'high_prec_freq',
'high_prec_dur',
'high_prec_timing',
'low_prec_freq',
'low_prec_dur',
'low_prec_timing',
'q_mean',
'runoff_ratio',
'stream_elas',
'slope_fdc',
'baseflow_index',
'hdf_mean',
'Q5',
'Q95',
'high_q_freq',
'high_q_dur',
'low_q_freq',
'low_q_dur',
'zero_q_freq',
'geol_prim',
'geol_prim_prop',
'geol_sec',
'geol_sec_prop',
'unconsoldted',
'igneous',
'silicsed',
'carbnatesed',
'othersed',
'metamorph',
'sedvolc',
'oldrock',
'claya',
'clayb',
'sanda',
'solum_thickness',
'ksat',
'solpawhc',
'elev_min',
'elev_max',
'elev_mean',
'elev_range',
'mean_slope_pct',
'upsdist',
'strdensity',
'strahler',
'elongratio',
'relief',
'reliefratio',
'mrvbf_prop_0',
'mrvbf_prop_1',
'mrvbf_prop_2',
'mrvbf_prop_3',
'mrvbf_prop_4',
'mrvbf_prop_5',
'mrvbf_prop_6',
'mrvbf_prop_7',
'mrvbf_prop_8',
'mrvbf_prop_9',
'confinement',
'lc01_extracti',
'lc03_waterbo',
'lc04_saltlak',
'lc05_irrcrop',
'lc06_irrpast',
'lc07_irrsuga',
'lc08_rfcropp',
'lc09_rfpastu',
'lc10_rfsugar',
'lc11_wetlands',
'lc14_tussclo',
'lc15_alpineg',
'lc16_openhum',
'lc18_opentus',
'lc19_shrbsca',
'lc24_shrbden',
'lc25_shrbope',
'lc31_forclos',
'lc32_foropen',
'lc33_woodope',
'lc34_woodspa',
'lc35_urbanar',
'prop_forested',
'nvis_grasses_n',
'nvis_grasses_e',
'nvis_forests_n',
'nvis_forests_e',
'nvis_shrubs_n',
'nvis_shrubs_e',
'nvis_woodlands_n',
'nvis_woodlands_e',
'nvis_bare_n',
'nvis_bare_e',
'nvis_nodata_n',
'nvis_nodata_e',
'distupdamw',
'impound_fac',
'flow_div_fac',
'leveebank_fac',
'infrastruc_fac',
'settlement_fac',
'extract_ind_fac',
'landuse_fac',
'catchment_di',
'flow_regime_di',
'river_di',
'pop_mean',
'pop_max',
'pop_gt_1',
'pop_gt_10',
'erosivity',
'anngro_mega',
'anngro_meso',
'anngro_micro',
'gromega_seas',
'gromeso_seas',
'gromicro_seas',
'npp_ann',
'npp_1',
'npp_2',
'npp_3',
'npp_4',
'npp_5',
'npp_6',
'npp_7',
'npp_8',
'npp_9',
'npp_10',
'npp_11',
'npp_12']
[9]:
len(dataset.static_features)
[9]:
166
[10]:
[11]:
static = dataset.fetch_static_features(stations=stations)
static.shape
[11]:
(222, 166)
[12]:
# EDA(data=static, save=False).heatmap()
[13]:
physical_features = []
soil_features = []
geological_features = []
flow_characteristics = []
static = static.dropna(axis=1)
static.shape
[13]:
(222, 153)
[14]:
| lat | long | |
|---|---|---|
| station_id | ||
| 912101A | -18.643612 | 139.253052 |
| 912105A | -18.970833 | 138.803329 |
| 915011A | -20.177500 | 144.524445 |
| 917107A | -18.133612 | 144.306671 |
| 919003A | -16.471390 | 144.290558 |
| ... | ... | ... |
| 312061 | -41.419445 | 145.670563 |
| 314207 | -41.250832 | 146.089996 |
| 314213 | -40.872223 | 145.297775 |
| 315450 | -41.611668 | 146.130554 |
| 318076 | -41.494446 | 147.384171 |
222 rows × 2 columns
[15]:
dataset.plot_stations(color='area_km2')
Setting upper limit to 46848.34 for color scale
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/dev/aqua_fetch/rr/utils.py:962: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '46848.34' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.
c[c>ul] = ul
[15]:
<Axes: title={'center': 'CAMELS_AUS Stations (n=222)'}, xlabel='Longitude', ylabel='Latitude'>
[16]:
dataset.plot_catchment(dataset.area().sort_values(ascending=False).index[0], show_outlet=True)
Using attribute 'CatchID' as default for boundary ID mapping.
[16]:
<Axes: xlabel='Longitude', ylabel='Latitude'>
[17]:
dataset.plot_num_observations()
Skipping aet_mm_silo_morton due to no missing values.
Skipping aet_mm_silo_morton_point due to no missing values.
Skipping et_morton_wet_SILO due to no missing values.
Skipping aet_mm_silo_short_crop due to no missing values.
Skipping aet_mm_silo_tall_crop due to no missing values.
Skipping evap_morton_lake_SILO due to no missing values.
All stations for evap_pan_SILO have 16436 observations.
Skipping evap_syn_SILO due to no missing values.
Skipping pcp_mm_awap due to no missing values.
Skipping pcp_mm_silo due to no missing values.
All stations for solrad_wm2_awap have 9131 observations.
Skipping airtemp_C_awap_max due to no missing values.
Skipping airtemp_C_awap_min due to no missing values.
Skipping vp_hpa_awap due to no missing values.
All stations for mslp_SILO have 21184 observations.
Skipping solrad_wm2_silo due to no missing values.
Skipping rh_%_silo_tmax due to no missing values.
Skipping rh_%_silo_tmin due to no missing values.
Skipping airtemp_C_silo_max due to no missing values.
Skipping airtemp_C_silo_min due to no missing values.
Skipping vp_deficit_SILO due to no missing values.
Skipping vp_hpa_silo due to no missing values.
Skipping airtemp_C_mean_silo due to no missing values.
Skipping airtemp_C_mean_awap due to no missing values.
[17]:
<Axes: xlabel='Number of observations', ylabel='Number of stations'>
[18]:
_, ax = plt.subplots()
for idx, period in enumerate([("19810101", "19901231"), ("19910101", "20001231"), ("20010101", "20101231")]):
start, end = period
ax = dataset.plot_num_observations(
dynamic_features=['q_cms_obs'],
ax=ax,
start=start, end=end, show=False)
ax.lines[idx].set_label(f'{start} to {end}')
assert isinstance(ax, plt.Axes)
ax.legend()
[18]:
<matplotlib.legend.Legend at 0x7f8be7cd4ad0>
[19]:
[20]:
idx = 0
ax_num = 0
fig, axes = plt.subplots(5, 5, figsize=(15, 12))
axes = axes.flatten()
while ax_num < 25:
val = static.iloc[:, idx]
idx += 1
try:
c = val.astype(float).values.reshape(-1,)
en = 222
ax = axes[ax_num]
ax, sc = scatter(long[0:en], lat[0:en], c=c[0:en], cmap="hot", show=False, ax=ax)
process_cbar(ax, sc, border=False, title=val.name, #title_kws ={"fontsize": 14}
)
ax_num += 1
except ValueError:
continue
plt.tight_layout()
plt.show()
print(idx)
33
[21]:
idx = 32
ax_num = 0
fig, axes = plt.subplots(5, 5, figsize=(15, 12))
axes = axes.flatten()
while ax_num < 25:
val = static.iloc[:, idx]
idx += 1
try:
c = val.astype(float).values.reshape(-1,)
en = 222
ax = axes[ax_num]
ax, sc = scatter(long[0:en], lat[0:en], c=c[0:en], cmap="hot", show=False, ax=ax)
process_cbar(ax, sc, border=False, title=val.name, #title_kws ={"fontsize": 14}
)
ax_num += 1
except ValueError:
continue
plt.tight_layout()
plt.show()
print(idx)
59
[22]:
idx = 59
ax_num = 0
fig, axes = plt.subplots(5, 5, figsize=(15, 12))
axes = axes.flatten()
while ax_num < 25:
val = static.iloc[:, idx]
idx += 1
try:
c = val.astype(float).values.reshape(-1,)
en = 222
ax = axes[ax_num]
ax, sc = scatter(long[0:en], lat[0:en], c=c[0:en], cmap="hot", show=False, ax=ax)
process_cbar(ax, sc, border=False, title=val.name, #title_kws ={"fontsize": 14}
)
ax_num += 1
except ValueError:
continue
plt.tight_layout()
plt.show()
print(idx)
84
Dyanmic Features
[23]:
dataset.dynamic_features
[23]:
['q_cms_obs',
'streamflow_MLd_inclInfilled',
'q_mm_obs',
'aet_mm_silo_morton',
'aet_mm_silo_morton_point',
'et_morton_wet_SILO',
'aet_mm_silo_short_crop',
'aet_mm_silo_tall_crop',
'evap_morton_lake_SILO',
'evap_pan_SILO',
'evap_syn_SILO',
'pcp_mm_awap',
'pcp_mm_silo',
'precipitation_var_AWAP',
'solrad_wm2_awap',
'airtemp_C_awap_max',
'airtemp_C_awap_min',
'vp_hpa_awap',
'mslp_SILO',
'solrad_wm2_silo',
'rh_%_silo_tmax',
'rh_%_silo_tmin',
'airtemp_C_silo_max',
'airtemp_C_silo_min',
'vp_deficit_SILO',
'vp_hpa_silo',
'airtemp_C_mean_silo',
'airtemp_C_mean_awap']
Streamflow
[24]:
streamflow = dataset.q_mm()
streamflow.shape
[24]:
(23376, 222)
[25]:
[25]:
| 912101A | 912105A | 915011A | 917107A | 919003A | 919201A | 919309A | 922101B | 925001A | 926002A | ... | 304499 | 305202 | 307473 | 308145 | 308799 | 312061 | 314207 | 314213 | 315450 | 318076 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| time | |||||||||||||||||||||
| 1951-01-01 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | 0.931382 | NaN | NaN | NaN | 0.571042 |
| 1951-01-02 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | 0.881380 | NaN | NaN | NaN | 0.387082 |
| 1951-01-03 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | 0.799637 | NaN | NaN | NaN | 0.343161 |
| 1951-01-04 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | 0.832386 | NaN | NaN | NaN | 0.313503 |
| 1951-01-05 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | 0.897625 | NaN | NaN | NaN | 0.309466 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2014-12-27 | 0.033409 | 0.032417 | 0.000000 | 0.010655 | 0.003816 | 0.0 | 0.0 | 0.0 | 0.036582 | 0.300530 | ... | 0.505348 | 0.447075 | 2.489122 | 1.391061 | 1.407268 | 0.547383 | 0.415754 | 0.093841 | 0.944415 | 0.243313 |
| 2014-12-28 | 0.037260 | 0.028840 | 0.000000 | 0.010369 | 0.002212 | 0.0 | 0.0 | 0.0 | 0.036308 | 0.293852 | ... | 0.506314 | 0.126054 | 2.198925 | 1.255558 | 1.330847 | 0.524695 | 0.386941 | 0.084121 | 0.881395 | 0.219409 |
| 2014-12-29 | 0.037653 | 0.027334 | 0.000000 | 0.010321 | 0.001903 | 0.0 | 0.0 | 0.0 | 0.036154 | 0.292314 | ... | 0.482631 | 0.057792 | 1.557511 | 1.061568 | 1.150340 | 0.501252 | 0.378870 | 0.075581 | 0.802402 | 0.207761 |
| 2014-12-30 | 0.032432 | 0.027785 | 0.000000 | 0.028903 | 0.001662 | 0.0 | 0.0 | 0.0 | 0.034776 | 0.293543 | ... | 0.548162 | 0.041354 | 1.354081 | 12.621201 | 17.800033 | 0.731634 | 0.387640 | 0.078101 | 7.128174 | 0.205275 |
| 2014-12-31 | 0.032191 | 0.169300 | 0.003321 | 0.042891 | 0.002262 | 0.0 | 0.0 | 0.0 | 0.034613 | 0.291518 | ... | 2.707964 | 0.135351 | 11.706610 | 10.158581 | 9.200824 | 1.745331 | 1.042905 | 0.134921 | 6.993985 | 0.223863 |
23376 rows × 222 columns
[26]:
# EDA(data=streamflow, save=False).heatmap()
[27]:
[28]:
_ = hist(streamflow.skew().values.reshape(-1,), bins=50)
[29]:
1
[29]:
(23376, 28)
[30]:
[30]:
| dynamic_features | q_cms_obs | streamflow_MLd_inclInfilled | q_mm_obs | aet_mm_silo_morton | aet_mm_silo_morton_point | et_morton_wet_SILO | aet_mm_silo_short_crop | aet_mm_silo_tall_crop | evap_morton_lake_SILO | evap_pan_SILO | ... | mslp_SILO | solrad_wm2_silo | rh_%_silo_tmax | rh_%_silo_tmin | airtemp_C_silo_max | airtemp_C_silo_min | vp_deficit_SILO | vp_hpa_silo | airtemp_C_mean_silo | airtemp_C_mean_awap |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| time | |||||||||||||||||||||
| 1951-01-01 | NaN | NaN | NaN | 6.900847 | 7.008263 | 6.964195 | 4.927754 | 5.668008 | 7.193645 | NaN | ... | NaN | 32.358261 | 51.326271 | 100.000000 | 20.904661 | 10.066525 | 8.196610 | 12.691102 | 15.485594 | 15.136791 |
| 1951-01-02 | NaN | NaN | NaN | 2.477542 | 4.668009 | 3.581144 | 3.552542 | 4.533263 | 3.637924 | NaN | ... | NaN | 15.430085 | 47.353390 | 100.000000 | 25.054661 | 11.972670 | 11.037289 | 15.045551 | 18.513664 | 18.838453 |
| 1951-01-03 | NaN | NaN | NaN | 1.580085 | 7.552754 | 4.596186 | 5.127966 | 6.821610 | 4.623517 | NaN | ... | NaN | 17.965891 | 33.362499 | 81.882202 | 30.682627 | 15.816525 | 20.855932 | 14.715255 | 23.249577 | 23.413496 |
| 1951-01-04 | NaN | NaN | NaN | 1.993432 | 4.997246 | 3.503602 | 3.572670 | 4.592797 | 3.549153 | NaN | ... | NaN | 13.834322 | 49.643433 | 93.554665 | 25.778179 | 15.487288 | 11.990254 | 16.464407 | 20.632734 | 20.646568 |
| 1951-01-05 | NaN | NaN | NaN | 5.422246 | 6.595974 | 6.007415 | 4.723941 | 5.495975 | 6.159746 | NaN | ... | NaN | 26.630508 | 55.812714 | 90.836021 | 22.569916 | 14.784746 | 9.022035 | 15.276271 | 18.677330 | 18.615295 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2014-12-27 | 0.293994 | 25.410000 | 0.220957 | 5.823305 | 5.865678 | 5.827754 | 4.412076 | 5.185805 | 6.027754 | 5.708687 | ... | 1021.000000 | 29.454872 | 43.703602 | 100.000000 | 20.876907 | 4.455297 | 8.311653 | 10.788559 | 12.666101 | 12.750244 |
| 2014-12-28 | 0.230000 | 19.879000 | 0.172861 | 5.624788 | 6.623305 | 6.123517 | 5.024153 | 5.952119 | 6.295127 | 6.719491 | ... | 1016.400208 | 27.618433 | 44.151695 | 100.000000 | 25.743221 | 10.142585 | 11.572458 | 14.613348 | 17.942904 | 17.073708 |
| 2014-12-29 | 0.216533 | 18.715000 | 0.162739 | 1.743220 | 6.377754 | 4.053813 | 4.491737 | 5.896186 | 4.142585 | 4.677966 | ... | 999.897888 | 17.204237 | 37.116951 | 87.352753 | 27.214830 | 13.368645 | 16.028179 | 13.402543 | 20.291737 | 19.733093 |
| 2014-12-30 | 0.228936 | 19.787001 | 0.172061 | 4.835382 | 4.899153 | 4.891526 | 3.627966 | 4.131780 | 5.004449 | 4.643856 | ... | 1004.114868 | 24.038136 | 62.204239 | 99.619492 | 17.834534 | 10.561229 | 5.493856 | 12.707839 | 14.197882 | 13.984047 |
| 2014-12-31 | 0.245932 | 21.256001 | 0.184835 | 4.941102 | 7.023941 | 5.999788 | 4.917161 | 5.931356 | 6.196187 | 5.381144 | ... | 1015.700012 | 29.225636 | 40.730721 | 91.275215 | 21.215466 | 8.692585 | 10.477966 | 10.261017 | 14.954025 | 14.957585 |
23376 rows × 28 columns
[31]:
222
get data of 10 % of stations as dataframe
[32]:
[32]:
22
The keys in dynamic dictionary are names of stations
[33]:
[33]:
dict_keys(['143303A', '613146', '138009A', '208007', '410734', 'G8140040', '212209', '917107A', '925001A', '616002', '226222', '116014A', '412028', '146014A', '116012A', '405274', 'A2390519', '422394A', 'A5130501', 'G8210010', '138010A', '915011A'])
get data by station id
[34]:
(23376, 28)
[35]:
dynamic['224214A']
[35]:
| dynamic_features | q_cms_obs | streamflow_MLd_inclInfilled | q_mm_obs | aet_mm_silo_morton | aet_mm_silo_morton_point | et_morton_wet_SILO | aet_mm_silo_short_crop | aet_mm_silo_tall_crop | evap_morton_lake_SILO | evap_pan_SILO | ... | mslp_SILO | solrad_wm2_silo | rh_%_silo_tmax | rh_%_silo_tmin | airtemp_C_silo_max | airtemp_C_silo_min | vp_deficit_SILO | vp_hpa_silo | airtemp_C_mean_silo | airtemp_C_mean_awap |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| time | |||||||||||||||||||||
| 1951-01-01 | NaN | NaN | NaN | 5.854414 | 7.344525 | 6.591062 | 5.199777 | 6.248827 | 6.805475 | NaN | ... | NaN | 31.693129 | 38.657600 | 99.223740 | 22.589106 | 7.179832 | 11.043966 | 10.625475 | 14.884469 | 14.630333 |
| 1951-01-02 | NaN | NaN | NaN | 3.720838 | 5.970670 | 4.841676 | 4.888380 | 6.280447 | 4.949106 | NaN | ... | NaN | 22.082012 | 34.147209 | 100.000000 | 28.960335 | 6.874693 | 15.285140 | 13.665586 | 17.917515 | 18.440363 |
| 1951-01-03 | NaN | NaN | NaN | 2.758045 | 7.028100 | 4.901564 | 5.288883 | 6.920726 | 5.006983 | NaN | ... | NaN | 21.208046 | 31.228270 | 100.000000 | 30.393967 | 10.257375 | 18.920113 | 13.559162 | 20.325670 | 21.916115 |
| 1951-01-04 | NaN | NaN | NaN | 1.872346 | 6.184246 | 4.023073 | 4.378045 | 5.689497 | 4.110280 | NaN | ... | NaN | 17.139608 | 38.984528 | 88.440506 | 26.720001 | 13.467207 | 15.200336 | 13.682403 | 20.093605 | 21.333338 |
| 1951-01-05 | NaN | NaN | NaN | 5.242626 | 7.473408 | 6.367821 | 5.259832 | 6.279441 | 6.540224 | NaN | ... | NaN | 28.298380 | 46.126926 | 88.514526 | 24.212961 | 13.754525 | 11.920447 | 13.948156 | 18.983744 | 19.464199 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2014-12-27 | 0.963259 | 83.254898 | 0.188958 | 5.263129 | 6.776760 | 6.019442 | 4.915475 | 6.007598 | 6.219441 | 4.861006 | ... | 1019.592529 | 29.931396 | 36.573353 | 100.000000 | 22.333185 | 5.147654 | 10.853352 | 9.882738 | 13.740419 | 13.589680 |
| 2014-12-28 | 0.884752 | 76.469498 | 0.173558 | 5.425922 | 6.773743 | 6.106760 | 5.046369 | 6.066201 | 6.275363 | 5.650447 | ... | 1016.386047 | 28.012011 | 42.295364 | 100.000000 | 25.113855 | 9.529721 | 11.808492 | 13.501006 | 17.321789 | 17.031651 |
| 2014-12-29 | 0.840371 | 72.633598 | 0.164852 | 4.498380 | 7.134861 | 5.817374 | 5.214023 | 6.422570 | 5.948380 | 5.629944 | ... | 1003.352966 | 25.781174 | 40.154190 | 99.995697 | 26.736649 | 11.710727 | 14.221453 | 14.024302 | 19.223688 | 19.246988 |
| 2014-12-30 | 0.799492 | 69.100403 | 0.156833 | 4.197989 | 7.002067 | 5.593017 | 4.859721 | 5.987654 | 5.782179 | 5.312737 | ... | 1005.831726 | 28.189497 | 35.938995 | 87.377266 | 20.986034 | 7.259050 | 11.269665 | 8.918436 | 14.122542 | 13.945707 |
| 2014-12-31 | 0.764555 | 66.080803 | 0.149979 | 5.004805 | 7.923408 | 6.462682 | 5.426425 | 6.696928 | 6.690391 | 6.193520 | ... | 1014.303040 | 31.586760 | 32.787151 | 87.620003 | 22.560167 | 7.305643 | 12.661620 | 9.018715 | 14.932905 | 14.372753 |
23376 rows × 28 columns
get names of available dynamic features
[36]:
dataset.dynamic_features
# get only selected dynamic features
dynamic = dataset.fetch(1, as_dataframe=True,
dynamic_features=['airtemp_C_awap_max', 'pcp_mm_awap', 'aet_mm_silo_morton', 'q_cms_obs'])[1]
print(type(dynamic))
data = dynamic.popitem()[1]
data.shape
<class 'dict'>
[36]:
(23376, 4)
[37]:
[37]:
| dynamic_features | airtemp_C_awap_max | pcp_mm_awap | aet_mm_silo_morton | q_cms_obs |
|---|---|---|---|---|
| time | ||||
| 1951-01-01 | 21.935394 | 0.452928 | 3.315090 | NaN |
| 1951-01-02 | 23.287857 | 0.000000 | 5.217868 | NaN |
| 1951-01-03 | 26.117542 | 0.002778 | 4.202328 | NaN |
| 1951-01-04 | 24.906099 | 0.000000 | 3.087012 | NaN |
| 1951-01-05 | 28.666145 | 0.106794 | 5.054317 | NaN |
| ... | ... | ... | ... | ... |
| 2014-12-27 | 19.452383 | 0.005631 | 3.907845 | 0.256276 |
| 2014-12-28 | 22.509159 | 0.305668 | 4.146021 | 0.341883 |
| 2014-12-29 | 23.570950 | 0.410886 | 4.778228 | 0.244659 |
| 2014-12-30 | 19.964930 | 1.556344 | 4.581156 | 0.184819 |
| 2014-12-31 | 24.274628 | 0.000826 | 5.400901 | 0.148594 |
23376 rows × 4 columns
get data of 10 random stations
[38]:
[38]:
10
static data is always a pandas DataFrame while dynamic is a dictionary of dataframes with keys as station names.
[39]:
static, dynamic = dataset.fetch(stations='224214A', static_features="all", as_dataframe=True)
static.shape, dynamic['224214A'].shape
[39]:
((1, 166), (23376, 28))
[40]:
[40]:
| station_name | drainage_division | river_region | notes | lat | long | lat_centroid | long_centroid | map_zone | area_km2 | ... | npp_3 | npp_4 | npp_5 | npp_6 | npp_7 | npp_8 | npp_9 | npp_10 | npp_11 | npp_12 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| station_id | |||||||||||||||||||||
| 224214A | Wentworth River at Tabberabbera (224214A) | South East Coast (Victoria) | MITCHELL-THOMSON RIVERS | No notes | -37.494444 | 147.393333 | -37.372603 | 147.422449 | 55 | 440.6 | ... | 0.639791 | 0.552442 | 0.399512 | 0.304924 | 0.365059 | 0.528615 | 0.694625 | 0.868412 | 0.842424 | 0.76443 |
1 rows × 166 columns
[41]:
[41]:
dict_keys(['224214A'])
get dynamic data data of all stations as xarray dataset
[42]:
| station_name | drainage_division | river_region | notes | lat | long | lat_centroid | long_centroid | map_zone | area_km2 | ... | npp_3 | npp_4 | npp_5 | npp_6 | npp_7 | npp_8 | npp_9 | npp_10 | npp_11 | npp_12 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| station_id | |||||||||||||||||||||
| 912101A | Gregory River at Gregory Downs (912101A) | Carpentaria Coast | NICHOLSON-LEICHHARDT RIVERS | No notes | -18.643611 | 139.253056 | -19.303638 | 138.553210 | 54 | 12577.3 | ... | 0.079221 | 0.028471 | 0.033520 | 0.022459 | 0.016778 | 0.002405 | 0.004844 | 0.016939 | 0.035641 | 0.046875 |
| 912105A | Gregory River at Riversleigh No. 2 (912105A) | Carpentaria Coast | NICHOLSON-LEICHHARDT RIVERS | No notes | -18.970833 | 138.803333 | -19.333672 | 138.508911 | 54 | 11392.9 | ... | 0.076032 | 0.027316 | 0.032327 | 0.021844 | 0.017243 | 0.002405 | 0.004756 | 0.016132 | 0.033410 | 0.044226 |
| 915011A | Porcupine Creek at Mt Emu Plains (915011A) | Carpentaria Coast | FLINDERS-NORMAN RIVERS | No notes | -20.177500 | 144.524444 | -20.054245 | 144.483641 | 55 | 565.3 | ... | 0.228245 | 0.178230 | 0.192825 | 0.137060 | 0.123925 | 0.084574 | 0.037268 | 0.100204 | 0.153955 | 0.172525 |
| 917107A | Elizabeth Creek at Mount Surprise (917107A) | Carpentaria Coast | FLINDERS-NORMAN RIVERS | Uncertain catchment boundary. The SRTM-derive... | -18.133611 | 144.306667 | -18.152298 | 144.524350 | 55 | 458.3 | ... | 0.255098 | 0.169087 | 0.163391 | 0.074736 | 0.064303 | 0.034086 | 0.014866 | 0.074020 | 0.154662 | 0.201448 |
| 919003A | Mitchell River at O.K. Bridge (919003A) | Carpentaria Coast | MITCHELL-COLEMAN RIVERS (QLD) | No notes | -16.471389 | 144.290556 | -16.646693 | 144.878729 | 55 | 7731.7 | ... | 0.322416 | 0.227765 | 0.189666 | 0.104363 | 0.092505 | 0.063088 | 0.036525 | 0.098279 | 0.184531 | 0.238028 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 312061 | Hellyer River at Guilford Junction (312061) | Tasmania | ARTHUR RIVER | No notes | -41.419444 | 145.670556 | -41.467375 | 145.651407 | 55 | 99.4 | ... | 0.451088 | 0.299095 | 0.176474 | 0.100124 | 0.135071 | 0.223450 | 0.332237 | 0.487613 | 0.569115 | 0.609835 |
| 314207 | Leven River at at Bannons Bridge (314207) | Tasmania | SMITHTON-BURNIE COAST | No notes | -41.250833 | 146.090000 | -41.403886 | 145.927003 | 55 | 499.6 | ... | 0.545703 | 0.390217 | 0.238852 | 0.151707 | 0.200632 | 0.331666 | 0.485940 | 0.669314 | 0.727175 | 0.738653 |
| 314213 | Black River at South Forest (314213) | Tasmania | SMITHTON-BURNIE COAST | No notes | -40.872222 | 145.297778 | -40.997264 | 145.345798 | 55 | 319.0 | ... | 0.593617 | 0.447931 | 0.278360 | 0.183765 | 0.244593 | 0.391560 | 0.567227 | 0.767863 | 0.813744 | 0.791578 |
| 315450 | Forth River at U/S Lemonthyme (315450) | Tasmania | FORTH RIVER | No notes | -41.611667 | 146.130556 | -41.733571 | 146.045131 | 55 | 309.6 | ... | 0.463656 | 0.309041 | 0.183652 | 0.094034 | 0.137295 | 0.238779 | 0.363403 | 0.520559 | 0.603897 | 0.662411 |
| 318076 | North Esk River at Ballroom (318076) | Tasmania | TAMAR RIVER | No notes | -41.494444 | 147.384167 | -41.458693 | 147.537101 | 55 | 374.2 | ... | 0.610545 | 0.511115 | 0.327000 | 0.218916 | 0.285644 | 0.461620 | 0.661953 | 0.848524 | 0.833786 | 0.871770 |
222 rows × 166 columns
[43]:
[43]:
<xarray.Dataset> Size: 581MB
Dimensions: (time: 23376, dynamic_features: 28)
Coordinates:
* time (time) datetime64[ns] 187kB 1951-01-01 ... 2014-12-31
* dynamic_features (dynamic_features) <U27 3kB 'q_cms_obs' ... 'airtemp_C_...
Data variables: (12/222)
912101A (time, dynamic_features) float32 3MB ...
912105A (time, dynamic_features) float32 3MB ...
915011A (time, dynamic_features) float32 3MB ...
917107A (time, dynamic_features) float32 3MB ...
919003A (time, dynamic_features) float32 3MB ...
919201A (time, dynamic_features) float32 3MB ...
... ...
308799 (time, dynamic_features) float32 3MB ...
312061 (time, dynamic_features) float32 3MB ...
314207 (time, dynamic_features) float32 3MB ...
314213 (time, dynamic_features) float32 3MB ...
315450 (time, dynamic_features) float32 3MB ...
318076 (time, dynamic_features) float32 3MB ...