#!/usr/bin/env bash
# Re-runs every analysis on the page from public inputs. Needs Python 3 with Pillow; digitize_a.py also needs numpy
# and scipy. Run from this folder. Outputs go to ./out; compare them with the hosted JSON and CSV files.
set -e
mkdir -p out
python3 fetch_inputs.py inputs
python3 digitize_a.py inputs out
python3 digitize_b.py compute reading_b_pixels.json out
python3 digitize_check.py out . inputs
python3 igrf_tilt.py inputs/igrf14coeffs.txt inputs/pymagglobal_gufm1 out/digitize.json RULES_igrf_tilt.txt out
python3 tilt_sensitivity.py inputs/igrf14coeffs.txt inputs/pymagglobal_gufm1 out/digitize.json RULES_igrf_tilt.txt out
python3 amounts.py out/digitize.json inputs/oxygen-budget.json inputs RULES_amounts.txt out
# Optional, to redo Reading B by eye: python3 digitize_b.py sheets reading_b_approx.json inputs out
