An open API service indexing awesome lists of open source software.

https://github.com/pointblue/what

Wetland Hydrological Analysis Tool
https://github.com/pointblue/what

Last synced: 11 months ago
JSON representation

Wetland Hydrological Analysis Tool

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# WHAT: Wetland Hydrological Analysis Tools

`r badger::badge_repostatus('Active')`
`r badger::badge_lifecycle(stage = 'stable')`
`r badger::badge_license()`
`r badger::badge_github_actions()`
[![DOI](https://zenodo.org/badge/679839985.svg)](https://zenodo.org/doi/10.5281/zenodo.10895876)

WHAT supports estimation of wetland water management schedules in California’s
Central Valley through analysis of near-real-time, automated hydrological data
from Point Blue's [Water Tracker](https://www.pointblue.org/watertracker).

Water Tracker uses LandSat satellite imagery to detect open surface water in the
Central Valley and estimate the proportion of a given spatial unit that is
flooded on a given date. WHAT supports estimating the typical maximum extent of
flooding in individual units across multiple water years, variation in the
timing and extent of flooding among water years, and estimating the timing of
water management schedules, such as floodup and drawdown.

WHAT is intended for application to spatial units representing individual
wetland management units, and provides support for summarizing across multiple
units within a larger region, such as a Groundwater Sustainability Plan area.
Known and likely wetland management unit boundaries have already been integrated
into WaterTracker's automated processing of satellite imagery, to facilitate
application of tools in the WHAT package, but hydrological data within custom
boundaries can also be requested from WaterTracker by uploading a shapefile or
drawing a custom spatial area.

## Installation

You can install the development version of WHAT from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("pointblue/WHAT")
```

## Examples

Using sample data included, estimate the 95th percentile of the wetted area detected in each wetland management unit over all water years included:

```{r example_floodstatus}
library(WHAT)

data(sampledat)

dat <- format_watertracker(sampledat[sampledat$WETLAND == 'SampleWetland1',]) |>
estimate_flood_extent(prob = 0.95)

dplyr::select(dat, unit, ObservedAreaWaterHa_pq) |> dplyr::distinct()
```

Interpolate the extent of flooding onto a common set of dates to explore variation across water years (for an individual unit or combinations of units):

```{r example_interpolate}
dat_interp = interpolate_flooding(
dat[dat$unit == 'SampleWetland1_Unit2',],
wateryear = c(2014, 2015, 2016, 2017),
interval = 'week')

library(ggplot2)

ggplot(dat_interp, aes(interval, AreaWater_ac)) +
geom_line() +
facet_wrap(~wateryear, ncol = 1) +
scale_x_continuous(breaks = seq(1, 53, 4),
labels = dat_interp$date[seq(1, 53, 4)] |> format('%b-%d')) +
labs(x = NULL, y = 'Acres Flooded')
```

Interpret the sequence of WaterTracker observations to detect monthly modes in each unit, and optionally generalize across multiple water years to estimate the general wetland management schedule:

```{r example_modes}
estimate_flood_delta(dat[dat$unit == 'SampleWetland1_Unit2',]) |>
estimate_wetland_mode() |>
generalize_wetland_mode() |>
dplyr::select(month_name, mode, weight) |>
print(n = 12)

```
## Funding Statement

This package was originally developed as part of the project "California Central Valley Wetlands Water Budget Tool Development", Grant No. R21AP10037-00, a WaterSMART (Sustain and Manage America's Resources for Tomorrow) Applied Science Grant from the U.S. Bureau of Reclamation.