You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/changes_slides_deck.qmd
+22-1Lines changed: 22 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -137,7 +137,9 @@ Open Geospatial Consortium (OGC), a non-profit international organization that d
137
137
138
138
*[read_waterdata_field_measurements](https://doi-usgs.github.io/dataRetrieval/reference/read_waterdata_field_measurements.html) - Discrete hydrologic data (gage height, discharge, and readings of groundwater levels)
139
139
140
-
*[read_waterdata](https://doi-usgs.github.io/dataRetrieval/reference/read_waterdata.html) - Generalized function
140
+
*[read_waterdata_continuous](https://doi-usgs.github.io/dataRetrieval/reference/read_waterdata_continuous.html) - Continuous data are collected via automated sensors installed at a monitoring location.
The retrieval produces a data frame that contains 96 rows (one for every 15 minute period in the day). They include all data collected from the `startDate` through the `endDate` (starting and ending with midnight locally-collected time). The dateTime column is converted to UTC (Coordinated Universal Time), so midnight EST will be 5 hours earlier in the dateTime column (the previous day, at 7pm).
360
363
361
-
To override the UTC timezone, specify a valid timezone in the tz argument. Default is "", which will keep the dateTime column in UTC. Other valid timezones are:
362
364
363
-
```
364
-
America/New_York
365
-
America/Chicago
366
-
America/Denver
367
-
America/Los_Angeles
368
-
America/Anchorage
369
-
America/Honolulu
370
-
America/Jamaica
371
-
America/Managua
372
-
America/Phoenix
373
-
America/Metlakatla
374
-
```
375
365
376
-
Data are retrieved from [https://waterservices.usgs.gov/docs/instantaneous-values/](https://waterservices.usgs.gov/docs/instantaneous-values/). There are occasions where NWIS values are not reported as numbers, instead a common example is "Ice". Any value that cannot be converted to a number will be reported as NA in this package. Site information and measured parameter information is attached to the data frame as attributes. This is discussed further in [metadata](#embedded-metadata) section.
366
+
Data are retrieved from <https://api.waterdata.usgs.gov/ogcapi/v0/>. Site information and measured parameter information is attached to the data frame as attributes. This is discussed further in [metadata](#embedded-metadata) section.
377
367
378
368
## Groundwater Level Data
379
369
380
-
Groundwater level measurements can be obtained with the `readNWISgwl` function. Information on the returned data can be found with the `comment` function, and attached attributes as described in the [metadata](#embedded-metadata) section.
370
+
Groundwater level measurements can be obtained with the `read_waterdata_field_measurements` function.
381
371
382
372
```{r gwlexample, echo=TRUE, eval=FALSE}
383
373
siteNumber <- "USGS-434400121275801"
@@ -411,7 +401,7 @@ attr(ratingData, "RATING")
411
401
412
402
These data are the discrete measurements of discharge that are made for the purpose of developing or revising the rating curve. Information on the returned data can be found with the `comment` function and attached attributes as described in the [metadata](#embedded-metadata) section.
413
403
414
-
Surface-water measurement data can be obtained with the `readNWISmeas` function.
404
+
Surface-water measurement data can be obtained with the `read_waterdata_field_measurements`` function.
The sensor data ("uv" data) at this particular site has 2 columns of data that are important. The first task is to combine those columns. This is rather unique to this particular site and probably won't need to be done generally.
Next we'll clean up the discrete water quality "qw" data to make it easy to follow in this tutorial.
80
60
@@ -98,9 +78,9 @@ library(data.table)
98
78
99
79
setDT(qw_trim)[, join_date := qw_date]
100
80
101
-
setDT(uv_trim)[, join_date := uv_date]
81
+
setDT(uv_data)[, join_date := time]
102
82
103
-
closest_dt <- uv_trim[qw_trim, on = .(join_date), roll = "nearest"]
83
+
closest_dt <- uv_data[qw_trim, on = .(join_date), roll = "nearest"]
104
84
```
105
85
106
86
`closest_dt` is a `data.table` object. It similar to a data.frame, but not identical. We can convert it to a data.frame and then use `dplyr` commands. Note: the whole analysis can be done via `data.table`, but most examples in `dataRetrieval` have used `dplyr`, which is why we bring it back to data.frame. `dplyr` also has a `join_by(closest())` option, but it is more complicated because you can only specify the closeness in either the forward or backwards direction (and we want either direction).
@@ -109,9 +89,9 @@ We can calculate "delta_time" - the difference in time between the uv and qw dat
Currently this service only allows up to 3 years of data to be requested at once. If no time is specified in the query, the latest year of data is returned.
200
+
184
201
## Field Measurements
185
202
186
203
The `read_waterdata_field_measurements` replaces both the `readNWISgwl` and `readNWISmeas` functions.
0 commit comments