Skip to content

About

Fetches and saves stream weir stage and discharge images from Konza Prairie LTER gauging stations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

37 Commits

Folders and files

Repository files navigation

Konza Prairie Weirs

Fetches and saves weir monitoring images from the Konza Prairie LTER stream gauging stations. The script checks the server's Last-Modified header before downloading and skips the download if the local files are already current.

Latest Discharge

Overview

weir_download.R does three things:

  1. Check — sends a HEAD request to the server and reads the Last-Modified header for the stage image.
  2. Compare — finds the most recently saved *_weir_stage.png in pics/ and compares its filesystem mtime to the server timestamp.
  3. Download — only fetches both images (stage and discharge) if the server has newer data, then saves them as dated PNGs (YYYYMMDD_weir_stage.png / YYYYMMDD_weir_discharge.png) and stamps the files with the server's modification time.

Dependencies

if (!requireNamespace("pak", quietly = TRUE)) {
  install.packages("pak")
}

pak::pak(c(
  "cli",
  "magick",
  "httr2",
  "lubridate"
))

Usage

source("weir_download.R")

Output files are written to pics/.

About

Fetches and saves stream weir stage and discharge images from Konza Prairie LTER gauging stations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages