From 8ac19d85d8dd2fe8f67e5a678d4a8ccadd5a084a Mon Sep 17 00:00:00 2001 From: caes Date: Tue, 26 Jul 2016 20:50:53 -0400 Subject: [PATCH] added scripts for plotting a comparison between error fit types and for changing the analysis filenames to the ref->band order --- scripts/fix_swapped_names.sh | 13 ++++++++ scripts/plot_MC_against_CM.sh | 37 +++++++++++++++++++++ scripts/{create_plots.sh => plot_psdlag.sh} | 0 3 files changed, 50 insertions(+) create mode 100755 scripts/fix_swapped_names.sh create mode 100755 scripts/plot_MC_against_CM.sh rename scripts/{create_plots.sh => plot_psdlag.sh} (100%) diff --git a/scripts/fix_swapped_names.sh b/scripts/fix_swapped_names.sh new file mode 100755 index 0000000..09a6ab9 --- /dev/null +++ b/scripts/fix_swapped_names.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +for analysis in analyses/* +do + # Grab and determine labels of analyses + ref_band=$(basename $analysis|sed 's|[^≻]*_≻_\([^≻_]*\)_[^_]*_[^_]*|\1|') + echo_band=$(basename $analysis|sed 's|\([^≻]*\)_≻_[^≻_]*_[^_]*_[^_]*|\1|') + timestep_str=$(basename $analysis|sed 's|[^≻]*_≻_[^≻_]*_\([^_]*\)_σ∊[CLM][MFC]|\1|') + err_str=$(basename $analysis|sed 's|[^≻]*_≻_[^≻_]*_[^_]*_\(σ∊[CLM][MFC]\)|\1|') + + newname="${ref_band}_≺_${echo_band}_${timestep_str}_${err_str}" + mv $analysis analyses/$newname +done \ No newline at end of file diff --git a/scripts/plot_MC_against_CM.sh b/scripts/plot_MC_against_CM.sh new file mode 100755 index 0000000..09b4710 --- /dev/null +++ b/scripts/plot_MC_against_CM.sh @@ -0,0 +1,37 @@ +for table in analyses/tables/*_σ∊MC_timelag* +do + ref_band=$(basename $table|sed 's|\([^≺]*\)_≺_[^≺_]*_[^_]*_[^_]*\.tab|\1|') + echo_band=$(basename $table|sed 's|[^≺]*_≺_\([^≺_]*\)_[^_]*_[^_]*\.tab|\1|') + if [[ $ref_band == $echo_band ]]; then continue; fi + err_str=$(basename $table|sed 's|[^≺]*_≺_[^≺_]*_\(σ∊[CLM][MFC]\)\_[^_]*.tab|\1|') + + CMtable=$(echo $table|sed 's|∊MC|∊CM|') + + plotfile=analyses/plots/${echo_band}_error_compare.png + + echo_band_noUTF=$(echo $echo_band| + sed 's|𝛌|λ|g'| + #sed 's|(|_|g'| + #sed 's|)|_|g'| + sed 's|=|=|g'| + sed 's|Å|A|g') + + ref_band_noUTF=$(echo $ref_band| + sed 's|𝛌|λ|g'| + #sed 's|(|_|g'| + #sed 's|)|_|g'| + sed 's|=|=|g'| + sed 's|Å|A|g') + + cat scripts/templates/timelag_compare.gp| + sed "s|%TITLE|Error Fit Comparison for Time Lag of $echo_band_noUTF|"| + sed "s|%SUBTITLE|referred to ${ref_band_noUTF}, as reported by Fausnaugh et. al, STORM III, 2016|"| + sed "s|%FILE1|$table|"| + sed "s|%LABEL1|${echo_band_noUTF} with Monte Carlo Fit|"| + sed "s|%FILE2|$CMtable|"| + sed "s|%LABEL2|${echo_band_noUTF} with Covariance Matrix Fit|"| + sed "s|%YMIN|$ymin|"|sed "s|%YMAX|$ymax|"| + sed "s|%OUTPUTFILE|$plotfile|" > tmp.gp + gnuplot tmp.gp + +done \ No newline at end of file diff --git a/scripts/create_plots.sh b/scripts/plot_psdlag.sh similarity index 100% rename from scripts/create_plots.sh rename to scripts/plot_psdlag.sh