Skip to content

Commit

Permalink
update core
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejohnson51 committed Oct 13, 2023
1 parent 969231b commit 101e075
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ depriciate
dead
inst/doc
vignettes/cihro-data
data
data
check
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Imports:
purrr,
magrittr
Remotes:
USGS-R/nhdplusTools,
mikejohnson51/hydrofab,
mikejohnson51/ngen.hydrofab,
mikejohnson51/zonal,
Expand Down
3 changes: 2 additions & 1 deletion R/attach.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
core <- c("dplyr", "terra", "ngen.hydrofab","climateR",
"sf", "nhdplusTools", "hydrofab","zonal", "glue")
"sf", "nhdplusTools", "hydrofab","zonal",
"glue", 'arrow')

core_unloaded <- function() {
search <- paste0("package:", core)
Expand Down
8 changes: 7 additions & 1 deletion R/subset_network.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ get_fabric = function(VPU,
cache_dir = NULL,
cache_overwrite = FALSE){

Key <- NULL

xx = get_bucket_df(bucket = dirname(base_s3), prefix = basename(base_s3), region = 'us-west-2') %>%
filter(grepl(basename(base_s3), Key) &
grepl(paste0(VPU, ".gpkg$"), Key)) %>%
Expand Down Expand Up @@ -77,6 +79,8 @@ subset_network = function(id = NULL,
cache_dir = NULL,
cache_overwrite = FALSE) {

Key <- hf_hydroseq <- hf_id <- hydroseq <- member_COMID <- toid <- vpu <- NULL

net = tryCatch({
open_dataset(glue(base_s3, "conus_net.parquet")) %>%
select(id, toid, hf_id, hl_uri, hf_hydroseq, hydroseq, vpu) %>%
Expand Down Expand Up @@ -126,7 +130,9 @@ subset_network = function(id = NULL,
get_nhdplus(comid = comid)
})

vpuid = vpu_boundaries$VPUID[which(lengths(st_intersects(st_transform(vpu_boundaries, st_crs(xx)), xx)) > 0)]
v = nhdplusTools::vpu_boundaries

vpuid = v$VPUID[which(lengths(st_intersects(st_transform(v, st_crs(xx)), xx)) > 0)]
} else {
vpuid = unique(pull(filter(net, id == origin |
toid == origin), vpu))
Expand Down
14 changes: 9 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ output: github_document
```{r, include = FALSE}
options(width=100)
knitr::opts_chunk$set(
#collapse = TRUE,
#comment = "#>",
#fig.path = "man/figures"
#warning = FALSE,
message = TRUE
)
```

<br>

## NOAA Next Generation Modeling Framework Hydrofabric
## Next Generation Water Resource Modeling Framework Hydrofabric(s)

<!-- badges: start -->

Expand Down Expand Up @@ -44,6 +43,9 @@ NextGen artifacts are publicly available through a partnership with Lynker and t

### [Lynker's NextGen Data Artifacts](https://lynker-spatial.s3.amazonaws.com/index.html)

```{r, fig.align='center', echo = FALSE}
knitr::include_graphics("man/figures/lynker-spatial.png")
```

## Package Installation

Expand Down Expand Up @@ -110,6 +112,8 @@ knitr::include_graphics("man/figures/logos.png")

<a href = "mailto:[email protected]?subject=Nexgen Hydrofabric Questions">
Mike Johnson</a> (Hydrofabric Lead), <a href = "mailto:[email protected]?subject=Nexgen Hydrofabric Questions"> Trey Flowers </a> (Director, OWP Analysis and Prediction Division)



**Disclaimer**: These data are preliminary or provisional and are subject to revision. They are being provided to meet the need for timely best science. The data have not received final approval by the National Oceanic and Atmospheric Administration (NOAA) or the U.S. Geological Survey (USGS) and are provided on the condition that neither NOAA, the USGS, nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the data.
## Disclaimer: These data are preliminary or provisional and are subject to revision. They are being provided to meet the need for timely best science. The data have not received final approval by the National Oceanic and Atmospheric Administration (NOAA) or the U.S. Geological Survey (USGS) and are provided on the condition that the U.S. Government shall not be held liable for any damages resulting from use of the data.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ tables, spatial data, and lookups relevant to a hydrofabric data model

### [Lynker’s NextGen Data Artifacts](https://lynker-spatial.s3.amazonaws.com/index.html)

<img src="man/figures/lynker-spatial.png" width="1529" style="display: block; margin: auto;" />

## Package Installation

``` r
Expand All @@ -63,7 +65,7 @@ library(hydrofabric)

## ── Attaching packages ────────────────────────────────────────────────────────── hydrofabric0.0.6 ──

## ✔ dplyr 1.1.3 ✔ nhdplusTools 1.0.0
## ✔ dplyr 1.1.3 ✔ nhdplusTools 1.0.1
## ✔ terra 1.7.46 ✔ hydrofab 0.5.0
## ✔ ngen.hydrofab 0.0.3 ✔ zonal 0.0.2
## ✔ climateR 0.3.1.4 ✔ glue 1.6.2
Expand Down Expand Up @@ -148,12 +150,10 @@ page](https://github.com/LynkerIntel/hfsubset/releases).

## Questions:

<a href = "mailto:[email protected]?subject=Nexgen Hydrofabric Questions">
<a href = "mailto:[email protected]?subject=Nexgen Hydrofabric Questions">
Mike Johnson</a> (Hydrofabric Lead),
<a href = "mailto:[email protected]?subject=Nexgen Hydrofabric Questions">
Trey Flowers </a> (Director, OWP Analysis and Prediction Division),
<a href = "mailto:[email protected]?subject=Nexgen Hydrofabric Questions">
Fernando Salas </a> (Director, OWP Geospatial Intellegence Division)
Trey Flowers </a> (Director, OWP Analysis and Prediction Division)

**Disclaimer**: These data are preliminary or provisional and are
subject to revision. They are being provided to meet the need for timely
Expand Down
Binary file added man/figures/lynker-spatial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion man/subset_network.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 101e075

Please sign in to comment.