Learn R Programming

SWTools: Helper Tools for Australian Hydrologists

Functions to speed up workflow for hydrological analysis. Focused on Australian climate data (SILO climate data), hydrological models (eWater Source) and South Australian hydrological data (from Water Data SA).

SILO functions:

SILO is a database of Australian climate data from 1889 to the present. It provides daily meteorological datasets for a range of climate variables in ready-to-use formats suitable for biophysical modelling, research and climate applications SILO Website.

These functions allow SILO data to be downloaded from the SILO Website, imported into R, calculate some basic statistics and undertake some quality assurance tests to easily visualise how much data has been interpolated, and to compare nearby sites to identify potential data issues. SILODownload, SILOLoad and SILOReport functions allow a vector of SILO sites to be downloaded and summarised in a Microsoft Word report.

Source and Veneer functions:

eWater Source is the Australia’s national hydrological modelling platform, and is increasing in use around the world. Functions are included to write SILO climate data to the format expected for Source SILOWriteforSource, and reading in model outputs, read_res.csv.

Veneer is a RESTful API for interacting with Source models. Functions are included that are wrappers for Veneer, to build URLs to get or set data in the Source model, and process the json object returned.

Aquarius functions:

South Australia’s hydrological data is hosted on Water Data SA, powered by an Aquatic Informatics Aquarius database. The Export link creates URLs that enable multiple datasets to be downloaded. AQWPDownload builds these URLs to download data in json format, and AWQPLoad loads this json file into the R interface.

Installation

You can install the released version of SWTools from CRAN with:

install.packages("SWTools")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("matt-s-gibbs/swtools")

Copy Link

Version

Install

install.packages('SWTools')

Monthly Downloads

190

Version

1.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Matt Gibbs

Last Published

October 14th, 2024

Functions in SWTools (1.1.0)

VeneerGetNodesbyType

Get a vector of node names for a given type
VeneerGetTS

Get a time series result from Source using Veneer
VeneerGetTSbyVariable

Get all time series recorded in Source of a given variable type
VeneerGetTSbyNode

Get all time series recorded in Source for a given node
VeneerGetPiecewise

Get data from a Source piecewise table using Veneer
VeneerGetTSVariables

Get a vector of the type of time series variables recorded
VeneerSetFunction

Update a function value or expression. Function must exist before being updated.
VeneerlatestRunNumber

Get the number of the latest run
VeneerRunSource

Run Source using Veneer
VeneerSetPiecewise

Change a Source piecewise table using Veneer
SILOThiessenShp

Function to generate Thiessen polygons from SILO sites
read_res.csv

Function to import a Source .res.csv File Returns data (as a Data Frame, Zoo, or tibble) as a time Series with all Results Read Source .res.csv file into a data table or zoo time series
VeneerGetInputSets

Get vector of InputSets
WritepwtoIS

Write an input set line for a piecewise lookup table from a csv file
SWTools-package

SWTools: Helper Tools for Australian Hydrologists
SILOLoad

Import multiple SILO files
SILOCorrectSite

Correct a slope change in a rainfall data set based on another site
HydstraSiteDetails

Get streamflow station information from Hydstra API
SILODoubleMass

Plot double mass curves of each rainfall site against each other
SILOImport

Import a SILO file
SILODownload

Download SILO data
AQWPDownload

Function to download data from https://water.data.sa.gov.au
SILOCheckConsistency

Check for homogeneity between SILO rainfall station data
SILOCumulativeDeviation

Plot the cumulative deviation from the mean for each silo station on one plot
AQWPLoad

Function to load in an Aquarius json file, downloaded from https://water.data.sa.gov.au, possibly using AWQPDownload()
SILOMortonQualityCodes

Plot the quality codes of the input data for Morton's Evap calculations
SILOQualityCodes

Plot the quality codes of the SILO rainfall data
SILOMonthlyRainfall

Plot a boxplot of monthly rainfall with mean monthly evaporation
SILOSiteSummary

Produce a table summarising SILO sites
SILOSitesfromPolygon

Find SILO sites within a polygon
SILOMap

Plot a map of the SILO station locations
SILOReport

Write SILO data report to word document. The report includes output from SILOSiteSummary(), SILOQualityCodes(), SILOMortonQualityCodes(). SILOMap(), SILOMonthlyRainfall(), SILOCumulativeDeviation() and SILODoubleMass().
SILOWriteFunctionsforSource

Function to bulk create functions for SILO data in Source.
SILOWriteforSource

Write a SILO time series to a csv file in the format expected by eWater Source