options(width=100)
knitr::opts_chunk$set(
  warning = FALSE,
  message = TRUE,
  fig.path = 'man/figures/'
)

Hydrofabric:

R CMD Check Dependencies

This repository serves a few main purposes.

  1. Modular Hydrofabric Processes: This package offers a collection of R packages specifically designed for hydroscience applications, akin to the tidyverse suite for hydrofabric development. It manages dependencies, resolves conflicts, and streamlines the installation process for quick setup.

  2. Hydrographic Network Utilities / Geoscience: The repository includes tools for obtaining, manipulating, and enhancing hydrographic networks.

  3. Subsetting National Datasets: It provides utilities to subset the national dataset for areas upstream of a specified location (XY coordinates), hydrofabric ID, indexed hydrolocation (e.g., NWIS gage, HUC12, or NID), NHDPlus COMID, or NLDI feature.

  4. Comprehensive Documentation: The repository offers extensive documentation, including details on the hydrofabric and cross-section data model, as well as the origins and development of the product. This information can be found on the landing page under articles..

Cloud Native Data Archives

NextGen artifacts are generated from a set of national reference datasets built in collaboration between NOAA, the USGS, and Lynker for federal water modeling efforts. These artifacts are designed to be easily updated, manipulated, and quality controlled to meet the needs of a wide range of modeling tasks while leveraging the best possible input data.

NextGen artifacts are publicly available through lynker-spatial under an ODbL license. If you use data, please ensure you (1) Attribute Lynker-Spatial, (2) Keep the data open, and that (3) any works produced from this data offer that adapted database under the ODbL.

knitr::include_graphics("man/figures/lynker-spatial.png")

Package Installation and Use

# install.packages("remotes")
remotes::install_github("NOAA-OWP/hydrofabric")
library(hydrofabric)

library(hydrofabric) will load the core packages (alphabetical):

Additionally it will load key geospatial data science libraries:

Subsetting

gpkg <- './conus_nextgen.gpkg'

get_hydrofabric(outfile = gpkg)
subset_fabric <- get_subset(gpkg = gpkg, 
                            comid = 101)
subset_fabric = read_hydrofabric("inst/extdata/comid-101-subset.gpkg")
subset_fabric$nexus = sf::read_sf("inst/extdata/comid-101-subset.gpkg", 'nexus')
{
  plot(subset_fabric$catchments$geom, col = "gray90")
  plot(subset_fabric$flowpaths$geom, add = TRUE, col = "blue")
  plot(subset_fabric$nexus, add = TRUE, col = "red", pch = 16)
}

We have also created a CLI cloud based subsetter. Binaries of these can be installed at the release page.

Hydrofabric Characteristic Data

A wide range of data can be appended to the hydrofabric (subsets) from resources including NOAA core modules, streamcat, hydroatlas, USGS catchment characteristics, and more.

Preliminary documentation of these can be found here.

Additionally, open source tools like climateR and zonal can be used to rapidly access and summarize data for a catchment set:

# Get Daymet Data
(tmax = getDaymet(subset_fabric$catchments, 
                  varname = "tmax", 
                  startDate = "2020-10-01"))
plot(tmax$tmax, main = 'Daymet Maximum Temperture')
(summary_stats = zonal::execute_zonal(tmax, 
                                      subset_fabric$catchments, 
                                      ID = "divide_id"))
plot(summary_stats['mean.tmax_2020.10.01_na_total'], main = "Aggregated Mean Temperture")

Background

The NextGen artifacts are a model application dataset built to meet the aims of NextGen. By design, these artifacts are derived from a set of general authoritative data products outlined in figure 1 that have been built in close collaboration with the USGS.

knitr::include_graphics("man/figures/roadmap2.png")

These include a set of base data that improves the network topology and geometry validity while defining a set of community hydrolocations (POIs). These 4 data products are used to build an intermediate refactored network from which one hydrofabric network has been aggregated to a set of community hydrolocations (minimal network), and one has been aggregated to a more consistent size (3-10 sqkm) with enforced POI locations (target distribution). NextGen specifically is derived from the target size aggregated product while the upcoming developments on the National Hydrologic Model (NHM) will be built from the community minimal network.

While these two aggregations serve a wide range of federal modeling needs, our focus on open source software development and workflows allow interested parties to build there own networks starting with either the 4 reference datasets, or the refactored network!

Resources

The hydrofabric builds on the OGC HY_Features conceptual model, the Hydrofabric Logical model, and the proposed Hydrofabric Data Model. A high level introduction to these resources can be found on the USGS Water Data blog.

Citation

Please cite data and use as:

Johnson, J. M. (2022). National Hydrologic Geospatial Fabric (hydrofabric) for the Next Generation (NextGen) Hydrologic Modeling Framework, HydroShare, http://www.hydroshare.org/resource/129787b468aa4d55ace7b124ed27dbde

Questions:

Mike Johnson (Hydrofabric Program Lead)

#knitr::include_graphics(c("man/figures/lynker-logo.png","man/figures/noaa-logo.png", 'man/figures/usgs-logo.png'))
# library(cowplot)
# xx = ggdraw() + 
#   draw_image("man/figures/lynker-logo.png", width = 0.33, height = .25, y = .05) + 
#   draw_image("man/figures/noaa-logo.png", width = 0.33,  height = .35, x = 0.33) + 
#   draw_image("man/figures/usgs-logo.png", width = 0.33,height = .25, x = 0.66, y = .05)
# 
# cowplot::save_plot(xx, filename = "man/figures/logos.png")
knitr::include_graphics("man/figures/logos.png")

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.



NOAA-OWP/hydrofabric documentation built on Dec. 7, 2024, 11:24 a.m.