Skip to content

Commit 247887b

Browse files
committed
vignette info for water atlas api functions #62
1 parent 8433ab1 commit 247887b

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

vignettes/intro.Rmd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,29 @@ mancodata <- read_importwqp(org = '21FLMANA_WQX', type = 'wq', trace = T)
132132
pincodata <- read_importwqp(org = '21FLPDEM_WQX', type = 'wq', trace = T)
133133
```
134134

135+
Additionally, data can be retrieved from the Tampa Bay Water Atlas API (<https://dev.api.wateratlas.org/redoc/>) using two different functions. These functions are generally quicker and more flexible than those from the USEPA Water Quality Portal. The `util_importwqwa()` function retrieves metadata on the available information from the Water Atlas API. This includes information on available data sources, parameters, sampling stations, and waterbodies.
136+
137+
```{r}
138+
# data sources
139+
util_importwqwa('dataSources')
140+
141+
# parameters
142+
util_importwqwa('parameters')
143+
144+
# stations, using optional waterbodyId argument for Hillsborough Bay
145+
util_importwqwa('sampling-locations', waterbodyId = 20005)
146+
147+
# waterbodies
148+
util_importwqwa('waterbodies')
149+
```
150+
151+
The `read_importwqwa()` function retrieves the actual water quality data based on inputs for the data source, parameter, and date ranges. The following shows how to import chlorophyll data (uncorrected) from Pinellas County for January of 2023. Consult the metadata using `util_importwqwa()` to determine available data sources and parameters.
152+
153+
```{r}
154+
read_importwqwa(dataSource = 'WIN_21FLPDEM', parameter = 'Chla_ugl',
155+
start_date = '2023-01-01', end_date = '2023-01-31')
156+
```
157+
135158
## Analyze {.tabset}
136159

137160
The functions `anlz_avedat()` and `anlz_avedatsite()` summarize the station data by bay segments or by sites, respectively. Both functions return annual means for chlorophyll and light attenuation (based on Secchi depth measurements) and monthly means by year for chlorophyll and light attenuation. These summaries are then used to determine if bay segment targets for water quality are met using the `anlz_attain()` and `anlz_attainsite()` function.

0 commit comments

Comments
 (0)