Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 4.47 KB

README.md

File metadata and controls

53 lines (34 loc) · 4.47 KB

From poles to tropics: A multi-biome synthesis investigating the controls on river Si exports

Script Explanations

Data Harmonizing (00)

As with many synthesis projects, this work involves "harmonizing" many separate data files (i.e., rendering them comparable then combining them).

  • 00-harmonize_chemistry.R: Combines individual chemistry files (river / stream gage level) into a single file. This is done with virtually no filtering to minimize data loss from this process

    • When to Use: you want to integrate new chemistry data into the 'master' file
  • 00-harmonize_discharge.R: Combines individual discharge files (river / stream gage level) into a single file. This is done with virtually no filtering to minimize data loss from this process

    • When to Use: you want to integrate new discharge data into the 'master' file

WRTDS (01)

WRTDS (Weighted Regressions on Time, Discharge, and Season) is a group of workflows necessary to process the harmonized discharge and chemistry data (see 00) into data that are analysis-ready for a larger suite of further analyses. It does require several 'steps' be taken--in order--and these are preserved as separate scripts for ease of maintenance.

  • 01-wrtds-step01_find-areas.R: Identifies the drainage basin area (in km^2) for all rivers. Uses either the expert-provided area in the reference table GoogleSheet or calculates it from DEM data.

    • When to Use: you want to add new rivers to the WRTDS workflow
  • 01-wrtds-step02_wrangling.R: Does all pre-WRTDS wrangling to (1) master chemistry, (2) master discharge, and (3) reference table files. Includes a "sabotage check" looking for any sites dropped by that wrangling.

    • When to Use: one of the three input files has been updated
  • 01-wrtds-step03_analysis.R: Actually runs WRTDS.

    • When to Use: you've tweaked the WRTDS workflow and/or want to update results
  • 01-wrtds-step03b_bootstrap.R: Runs the 'bootstrap' variant of WRTDS. This script is optional and is separate from step03 because (A) it takes much longer to run and (B) we don't run it as often as the 'main' WRTDS analysis script

    • When to Use: you've tweaked the bootstrap workflow and/or want to update its results
  • 01-wrtds-step04_results-report.R: Creates single results output files for each type of WRTDS output.

    • When to Use: you want to generate new summary files

Data Down/Upload (99) - INTERNAL USE ONLY

This group makes extensive use of Google Drive for convenient storing/sharing of the outputs of these scripts. However, such interactions do require access to the groups' Shared Google Drive and thus include these operations directly in the code functionally makes the code only run-able by members of the group. To solve this, all Google Drive interactions are isolated into a standalone script. Only a member of this working group can run the script so all others must run the 'actual' workflow scripts (in order) to ensure they have the relevant inputs for each.

  • 99-gdrive_download-upload.R: Downloads inputs and uploads outputs from/to the Shared Google Drive.
    • When to Use: you want to skip 'early' steps in the workflow by downloading their most recent outputs from the Drive

Related Repositories

This working group has several repositories. All are linked and described (briefly) below.