waterquality
A package designed to detect and quantify water quality and cyanobacterial harmful algal bloom (CHABs) from remotely sensed imagery.
https://github.com/RAJohansen/waterquality
Category: Natural Resources
Sub Category: Water Supply and Quality
Keywords
algal-bloom algorithms landsat-8 meris modis olci remote-sensing sentinel-2 water-quality
Keywords from Contributors
geos routing
Last synced: about 22 hours ago
JSON representation
Repository metadata
Package designed to detect and quantify water quality and cyanobacterial harmful algal bloom (CHABs) from remotely sensed imagery
- Host: GitHub
- URL: https://github.com/RAJohansen/waterquality
- Owner: RAJohansen
- License: other
- Created: 2017-11-29T19:57:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-25T15:24:52.000Z (almost 2 years ago)
- Last Synced: 2025-12-08T12:43:53.840Z (17 days ago)
- Topics: algal-bloom, algorithms, landsat-8, meris, modis, olci, remote-sensing, sentinel-2, water-quality
- Language: R
- Homepage: https://rajohansen.github.io/waterquality/
- Size: 33.6 MB
- Stars: 48
- Watchers: 8
- Forks: 8
- Open Issues: 3
- Releases: 2
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
README.Rmd
---
output: github_document
---
[](https://cran.r-project.org/package=waterquality)
[](https://app.codecov.io/gh/RAJohansen/waterquality)

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# waterquality
The main purpose of **waterquality** is to quickly and easily convert satellite-based reflectance imagery into one or many well-known water quality indices designed for the detection of Harmful Algal Blooms (HABs) using the following pigment proxies: chlorophyll-a, blue-green algae (phycocyanin), and turbidity.
Currently, this package is able to process [40 algorithms](https://rajohansen.github.io/waterquality/reference/index.html) for the following satellite-based imagers: WorldView-2, Sentinel-2, Landsat-8, MODIS, MERIS, and OLCI.
In order to improve the aesthetics of the `wq_calc()` output, a series of `Map_WQ()` functions were developed to help reduce technical barriers and simplify the complexities in selecting a map layout.
Additional functionality of the package includes a series of `extract_lm()` functions that wrap the ["Fitting Linear Models"](https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/lm) and ["caret"](https://topepo.github.io/caret/index.html) packages to quickly generate crossvalidated linear models and standardized outputs (r^2^, p-value, slope, intercept of the global lm model & average r^2^, average RMSE, average MAE of crossvalidated model) for any number of algorithm and water quality parameter combinations.
It is important to note that the `extract_lm()` functions require ground-truth data in order to develop the models.
For a more detailed look into the full functionality of **waterquality**, please view ["Introduction to the waterquality package"](https://rajohansen.github.io/waterquality/articles/waterquality_vignette.html).
For a broader look into how to apply this tool into a research workflow or for more information on topics such as data acquisition, image pre-processing, or results, see our publication entitled ["Waterquality: An Open-Source R Package for the Detection and Quantification of Cyanobacterial Harmful Algal Blooms and Water Quality"](https://erdc-library.erdc.dren.mil/jspui/bitstream/11681/35053/3/ERDC-EL%20TR-19-20.pdf).
Additionally, we have recently developed and published a complementary python-based version of **waterquality** compatible with ESRI ArcGIS and ArcPro. For more information please visit [“waterquality for ArcGIS Pro Toolbox”](https://hdl.handle.net/11681/42240).
## Installation
You can install the released version from CRAN with:
```{r install_CRAN, eval = FALSE}
install.packages("waterquality")
```
You can install waterquality from github with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("RAJohansen/waterquality")
```
## Basic Example
The main function in this package is `wq_calc()`:
```{r example_code, fig.asp=0.33, results='hide', message=FALSE, warning=FALSE}
library(waterquality)
library(terra)
s2 = terra::rast(system.file("raster/S2_Harsha.tif", package = "waterquality"))
MM12NDCI = wq_calc(s2, alg = "MM12NDCI", sat = "sentinel2")
```
```{r,fig.height = 5, fig.width = 6}
Map_WQ_raster(WQ_raster = MM12NDCI,
map_title= "Water Quality Map",
raster_style = "quantile",
histogram = TRUE)
```
## Citation
To cite waterquality in publications, please use:
Johansen R, Nowosad J, Reif M, Emery E (2023). waterquality: Satellite Derived Water Quality Detection Algorithms.
U.S Army Engineer Research and Development Center, Vicksburg, MS, USA. R package version 1.0.0,
https://github.com/RAJohansen/waterquality/.
## Package Contributions
We encourage users to submit issues and enhancement requests so we may continue to improve our package.
Furthermore, if you have a water quality algorithm that was not on our list, and you would like for it to be included in our package please email Richard.A.Johansen@erdc.dren.mil.
Owner metadata
- Name: Richard A. Johansen
- Login: RAJohansen
- Email:
- Kind: user
- Description: Research Interests: Remote Sensing, Water Quality, GIS, R, Data Visualization, Geography ORCID:_0000-0003-4287-9677
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/29709655?u=dd03c0823ba2b5034edc0c4a8d651a33c8ccdd50&v=4
- Repositories: 20
- Last ynced at: 2024-06-11T15:54:54.792Z
- Profile URL: https://github.com/RAJohansen
GitHub Events
Total
- Watch event: 3
Last Year
- Watch event: 3
Committers metadata
Last synced: 2 days ago
Total Commits: 330
Total Committers: 5
Avg Commits per committer: 66.0
Development Distribution Score (DDS): 0.615
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| jn | t****i@g****m | 127 |
| Richard | r****3@g****m | 107 |
| Richard Johansen | r****n@u****u | 83 |
| Richard Johansen | j****a@m****u | 12 |
| olivroy | 5****y | 1 |
Committer domains:
- mail.uc.edu: 1
- uc.edu: 1
Issue and Pull Request metadata
Last synced: 4 months ago
Total issues: 18
Total pull requests: 2
Average time to close issues: about 2 months
Average time to close pull requests: 2 months
Total issue authors: 4
Total pull request authors: 2
Average comments per issue: 1.5
Average comments per pull request: 0.0
Merged pull request: 2
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- RAJohansen (9)
- Nowosad (7)
- wbsalls (1)
- rsbivand (1)
Top Pull Request Authors
- olivroy (2)
- Nowosad (1)
Top Issue Labels
- enhancement (1)
Top Pull Request Labels
Package metadata
- Total packages: 2
-
Total downloads:
- cran: 182 last-month
- Total dependent packages: 0 (may contain duplicates)
- Total dependent repositories: 0 (may contain duplicates)
- Total versions: 7
- Total maintainers: 1
proxy.golang.org: github.com/rajohansen/waterquality
- Homepage:
- Documentation: https://pkg.go.dev/github.com/rajohansen/waterquality#section-documentation
- Licenses: other
- Latest release: v1.0.0 (published about 7 years ago)
- Last Synced: 2025-12-21T15:03:03.181Z (4 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.999%
- Average: 8.173%
- Dependent repos count: 9.346%
cran.r-project.org: waterquality
Satellite Derived Water Quality Detection Algorithms
- Homepage: https://github.com/RAJohansen/waterquality
- Documentation: http://cran.r-project.org/web/packages/waterquality/waterquality.pdf
- Licenses: MIT + file LICENSE
- Latest release: 1.0.0 (published over 2 years ago)
- Last Synced: 2025-12-21T15:02:56.027Z (4 days ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 182 Last month
-
Rankings:
- Stargazers count: 9.027%
- Forks count: 9.117%
- Average: 27.675%
- Dependent packages count: 29.797%
- Dependent repos count: 35.455%
- Downloads: 54.978%
- Maintainers (1)
Dependencies
- R >= 3.4.0 depends
- caret * imports
- dplyr * imports
- magrittr * imports
- methods * imports
- pingr * imports
- purrr * imports
- raster * imports
- rgdal * imports
- vctrs * imports
- OpenStreetMap * suggests
- covr * suggests
- knitr * suggests
- rmarkdown * suggests
- sf * suggests
- testthat * suggests
- tibble * suggests
- tmap * suggests
- tmaptools * suggests
Score: 10.750749697999847