Skip to content

Commit 9c45347

Browse files
authored
Merge pull request #338 from BrandiDowns/update-hydrocron-with-R-tutorial
updates to R notebook
2 parents 37d3868 + c900116 commit 9c45347

2 files changed

Lines changed: 13 additions & 594 deletions

File tree

‎notebooks/datasets/SWOT_River_Time_Series_Tutorial_in_R.html‎

Lines changed: 0 additions & 580 deletions
This file was deleted.

notebooks/datasets/SWOT_River_Time_Series_Tutorial_in_R.Rmd renamed to notebooks/datasets/SWOT_River_Time_Series_Tutorial_in_R.qmd

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
SWOT River Time-Series Tutorial in R
2-
================
1+
---
2+
title: "SWOT River Time-Series Tutorial in R"
3+
---
34
Navid Khizri (NASA JPL PO.DAAC Summer Intern; Alaska Pacific University
45
Student)
56

7+
Created: Aug 2026
8+
9+
Last Updated: Oct 2026
10+
611
**Summary**
712

813
This introductory tutorial guides students through plotting a river
@@ -62,17 +67,17 @@ Visit the interactive dashboard:
6267
``` r
6368
library(knitr)
6469
```
65-
![](../../images/SWOT_RiverDB_Basin.png?raw=true)
70+
![](../../images/SWOT_RiverDB_Basin.png)
6671

6772
Click on the North American basin, then click on one of the numbers that
6873
has your river in it. I will click on Alaska which is \#81.
6974

70-
![](../../images/Alaska.png?raw=true)
75+
![](../../images/Alaska.png)
7176

7277
After clicking on the basin you will see colorful lines which represent
7378
reach_ids. You can zoom in on the map into the river area of interest.
7479

75-
![](../../images/Area_Of_interest.png?raw=true)
80+
![](../../images/Area_Of_interest.png)
7681

7782
The example in this tutorial uses reaches from the Kuskokwim River in
7883
Southwestern Alaska. In the right-hand corner, you can see fields that
@@ -187,21 +192,15 @@ plot_reach <- function(data, title = "SWOT River Time-Series") {
187192
**Fetch, Clean, and Plot SWOT Data**
188193

189194
In this example, we request all observations for reach `81181700021`
190-
from 2023–2026. A user can change these inputs to request different time
195+
from 2025-06-01 through 2026-07-25. A user can change these inputs to request different time
191196
periods and/or river IDs. User only needs to re-run the cell below when
192197
modifying the query parameters(reach_id,start_time,end_time).
193198

194-
Note: At the time of writing this tutorial, there is a limit on how much
195-
data the API can query. If you’re reach is too large, consider breaking
196-
the query up into smaller requests. If interested in 2023 to 2027 data,
197-
you could do two queries: 2023-10-01 to 2025-05-31 and 2025-06-01 to
198-
2027-07-25.
199-
200199
``` r
201200
data_raw <- get_reach_data(
202201
reach_id = "81181700021", # Insert your reach ID here
203202
start_time = "2025-06-01T00:00:00Z", # Insert Start Date
204-
end_time = "2027-07-25T00:00:00Z" # Insert End Date
203+
end_time = "2026-07-25T00:00:00Z" # Insert End Date
205204
)
206205
```
207206

@@ -213,7 +212,7 @@ data <- clean_hydrocron(data_raw)
213212
plot_reach(data, title = "Kuskokwim River")
214213
```
215214

216-
![](SWOT_River_Time_Series_Tutorial_in_R4_files/figure-gfm/unnamed-chunk-7-1.png)
215+
![](../../images/Kuskokwim.png)
217216

218217
**Conclusion**
219218

0 commit comments

Comments
 (0)