#!/usr/bin/env bash # Run every script of the paper in order (see README_scripts.md). Set the input variables first, e.g. # export FLOWNEST_RELEASE_ROOT=/data/flownest MERIT_HYDRO_DIR=/data/MERIT_Hydro ... # Usage: bash run_all.sh (all steps, about 70 min) # bash run_all.sh --no-data14 (all but the 20-minute global pass) set -euo pipefail cd "$(dirname "$0")/scripts" mkdir -p ../Data ../Figures ../Drafts PY=${PYTHON:-python} run() { echo "=== $*"; "$PY" "$@"; } # 1-2. the Little Blackfoot, the zoom chain, the GRDC gauges (Data06e about 10 min) run Data04_flownest_littleblackfoot.py run Data05_flownest_zoom_chain_littleblackfoot.py run Data05c_flownest_coarse_maps_level1_group7.py run Data06c_grdc_gauge_table.py run Data06e_grdc_gauge_number_globe.py run Data06j_columbia_gauges_nested.py # 3. release totals; Table 4 (about 25 min, 3 GB of memory) run Data19_release_totals.py run Data21_text_numbers_global_network.py # 4. the Clark Fork in FlowNest, then NHDPlus, HydroSHEDS and TDX-Hydro run DataA4_flownest_clarkfork_gauge50.py run DataA1_nhdplus_clarkfork_littleblackfoot.py run DataA2_hydrosheds_v1_clarkfork_littleblackfoot.py run DataA3_tdx_mmw_clarkfork_littleblackfoot.py # 5. SWORD, the gauge - node pairs, Tables 3 and B1 (Data06m about 8 min) run Data06l_columbia_sword_new_numbers.py run Data06m_sword_reach_land_globe.py run Data06n_sword_numbers_and_gauge_pairs.py run Data22_checks_gauges_sword.py run Data23_sword_confidence_and_name_classes.py run Data24_release_files_rows_and_sizes.py # 6-7. the figures run Fig01_terms_toy_basin.py run Fig02_four_tree_models_toy_basin.py run Fig03_pixel_numbers_toy_basin.py run Fig04_coarser_threshold_toy_basin.py run Fig05_objects_chain_littleblackfoot.py --final run Fig06_how_to_use_the_files_littleblackfoot.py --final run Fig07_subbasins_three_thresholds_littleblackfoot.py --final run Fig08_columbia_gauges_nested_by_number.py run Fig09_global_gauges_and_crosswalk_table.py run Fig10_columbia_sword_reaches_and_nodes_by_number.py run Fig11_global_sword_reaches_and_crosswalk_table.py run Fig12_clarkfork_gauges_and_sword_on_one_number_axis.py run FigA1toA4_variables_clarkfork.py # 8. the one pass over the globe (Section 5.1; about 20 min with 3 workers) if [ "${1:-}" != "--no-data14" ]; then run Data14_one_pass_global.py 3; fi echo "=== done"