diff --git a/scripts/analyze_lightcurves.sh b/scripts/analyze_lightcurves.sh index 11842f3..a8eb00f 100755 --- a/scripts/analyze_lightcurves.sh +++ b/scripts/analyze_lightcurves.sh @@ -1,23 +1,24 @@ #!/usr/bin/env bash timestep="0.1" -lc_dir="data/STORM_III/lightcurves/Δt=${timestep}" ref_band='HST(𝛌=1367Å)' # Parameters for HST(𝛌=1367Å) from MC results refpsd_params="6.533e-02 -9.694e-02 -1.175e+00 -1.525e+00 -2.166e+00 -2.492e+00 -3.258e+00 -9.328e+00" # Parameters for HST(𝛌=1367Å) from covariance matrix estimates #refpsd_params="7.376e-02 -1.976e-01 -1.182e+00 -1.521e+00 -2.144e+00 -2.503e+00 -3.580e+00 -1.233e+01" -ref_curve="${lc_dir}/${ref_band}.lc" + error_type="2" # error types: # 0 for covariance matrix, 1 for likelihood function, 2 for monte carlo -case $error_type in +case $error_type in "0") err_src="CM";; "1") err_src="LF";; "2") err_src="MC";; esac +mkdir -p analyses + if [[ $1 == "thor" ]] then echo Setting up Thor environment. @@ -28,16 +29,16 @@ then echo "─────────────────────────────" >> thor/submissions fi -mkdir -p analyses - +lc_dir="data/STORM_III/lightcurves/Δt=${timestep}" echo Using lightcurves in $lc_dir. +ref_curve="${lc_dir}/${ref_band}.lc" for echo_curve in $lc_dir/* do # Determine band and inputs for band echo_band=$(basename $echo_curve|sed 's@\(.*\)\.lc@\1@') echo -n $(date "+%R")\: Running psdlag for $echo_band against $ref_band. - outputfile="analyses/${echo_band}_≻_${ref_band}_Δt=${timestep}_σ∊${err_src}" + outputfile="analyses/${ref_band}_≺_${echo_band}_Δt=${timestep}_σ∊${err_src}" case $echo_band in "g(𝛌=4775Å)") initial_params="$refpsd_params -9.745e-01 -1.384e+00 -2.748e+00 -3.305e+00 -3.314e+00 -3.389e+00 -4.198e+00 -4.465e+00 -4.700e-01 -7.487e-01 -2.046e+00 -2.428e+00 -2.953e+00 -3.086e+00 -3.761e+00 -4.290e+00 9.862e-02 3.899e-01 8.650e-01 5.516e-01 2.228e-01 9.508e-01 -2.872e-01 9.059e-02" @@ -119,19 +120,19 @@ do if [[ $1 == "thor" ]] then echo_band_noUTF=$(echo $echo_band| - sed 's@𝛌@@g'| - sed 's@(@_@g'| - sed 's@)@_@g'| - sed 's@=@@g'| - sed 's@Å@A@g') + sed 's|𝛌||g'| + sed 's|(|_|g'| + sed 's|)|_|g'| + sed 's|=||g'| + sed 's|Å|A|g') outputfile_noUTF=$(echo $outputfile| - sed 's@𝛌@@g'| - sed 's@(@_@g'| - sed 's@)@_@g'| - sed 's@=@@g'| - sed 's@Å@A@g'| - sed 's@≻@_@g'| - sed 's@σ∊@err@') + sed 's|𝛌||g'| + sed 's|(|_|g'| + sed 's|)|_|g'| + sed 's|=||g'| + sed 's|Å|A|g'| + sed 's|≺|_|g'| + sed 's|σ∊|err|') argsfile="thor/arguments/$echo_band_noUTF.args" submitscript="thor/${echo_band_noUTF}.pbs" cp tmp.psdlagargs $argsfile diff --git a/scripts/create_plots.sh b/scripts/create_plots.sh index 35e06a7..d3ce6e2 100755 --- a/scripts/create_plots.sh +++ b/scripts/create_plots.sh @@ -22,18 +22,18 @@ mkdir -p analyses/plots for analysis in analyses/* do # Grab and determine labels of analyses, skip if over the same band. - ref_band=$(basename $analysis|sed 's@[^≻]*_≻_\([^≻_]*\)_[^_]*_[^_]*@\1@') - echo_band=$(basename $analysis|sed 's@\([^≻]*\)_≻_[^≻_]*_[^_]*_[^_]*@\1@') + ref_band=$(basename $analysis|sed 's@\([^≺]*\)_≺_[^≺_]*_[^_]*_[^_]*@\1@') + echo_band=$(basename $analysis|sed 's@[^≺]*_≺_\([^≺_]*\)_[^_]*_[^_]*@\1@') if [[ $ref_band == $echo_band ]]; then continue; fi - err_type=$(basename $analysis|sed 's@[^≻]*_≻_[^≻_]*_[^_]*_\(σ∊[CLM][MFC]\)@\1@') + err_type=$(basename $analysis|sed 's@[^≺]*_≺_[^≺_]*_[^_]*_\(σ∊[CLM][MFC]\)@\1@') # Prepare files echo "Plotting PSD and time lags for $echo_band, referred to ${ref_band}." echoPSD_tabfile=analyses/tables/${echo_band}_${err_type}_PSD.tab refPSD_tabfile=analyses/tables/${ref_band}_${err_type}_PSD.tab - timelag_tabfile=analyses/tables/${echo_band}_≻_${ref_band}_${err_type}_timelag.tab - PSD_plotfile=analyses/plots/${echo_band}_≻_${ref_band}_${err_type}_PSD.png - timelag_plotfile=analyses/plots/${echo_band}_≻_${ref_band}_${err_type}_timelag.png + timelag_tabfile=analyses/tables/${ref_band}_≺_${echo_band}_${err_type}_timelag.tab + PSD_plotfile=analyses/plots/${ref_band}_≺_${echo_band}_${err_type}_PSD.png + timelag_plotfile=analyses/plots/${ref_band}_≺_${echo_band}_${err_type}_timelag.png # Output curves to temporary files using perl script, move tables to # permanent location. This just assumes there are no conflicts. @@ -47,27 +47,26 @@ do # read ymin ymax <<< $(ywindow_of $timelag_tabfile) # echo $ymin $ymax cat scripts/templates/psd_freq.gp| - sed "s@%TITLE@Power Spectrum for Lightcurves $echo_band and $ref_band@"| - sed "s@%SUBTITLE@as reported by Fausnaugh et. al, STORM III, 2016@"| - sed "s@%FILE1@$refPSD_tabfile@"| - sed "s@%LABEL1@${ref_band} PSD@"| - sed "s@%FILE2@$echoPSD_tabfile@"| - sed "s@%LABEL2@${echo_band} PSD@"| - sed "s@%YMIN@$ymin@"|sed "s@%YMAX@$ymax@"| - sed "s@%OUTPUTFILE@$PSD_plotfile@" > tmp.gp + sed "s|%TITLE|Power Spectrum for Lightcurves $echo_band and $ref_band|"| + sed "s|%SUBTITLE|as reported by Fausnaugh et. al, STORM III, 2016|"| + sed "s|%FILE1|$refPSD_tabfile|"| + sed "s|%LABEL1|${ref_band} PSD|"| + sed "s|%FILE2|$echoPSD_tabfile|"| + sed "s|%LABEL2|${echo_band} PSD|"| + sed "s|%YMIN|$ymin|"|sed "s|%YMAX|$ymax|"| + sed "s|%OUTPUTFILE|$PSD_plotfile|" > tmp.gp gnuplot tmp.gp # Plot time lags and save using gnuplot # read ymin ymax <<< $(ywindow_of $timelag_tabfile) cat scripts/templates/timelag_freq.gp| - sed "s@%TITLE@Time Lag for Lightcurve $echo_band relative to $ref_band@"| - sed "s@%SUBTITLE@as reported by Fausnaugh et. al, STORM III, 2016@"| - sed "s@%FILE1@$timelag_tabfile@"| - sed "s@%LABEL1@${echo_band} Lag@"| - sed "s@%YMIN@$ymin@"|sed "s@%YMAX@$ymax@"| - sed "s@%OUTPUTFILE@$timelag_plotfile@" > tmp.gp + sed "s|%TITLE|Time Lag for Lightcurve $echo_band relative to $ref_band|"| + sed "s|%SUBTITLE|as reported by Fausnaugh et. al, STORM III, 2016|"| + sed "s|%FILE1|$timelag_tabfile|"| + sed "s|%LABEL1|${echo_band} Lag|"| + sed "s|%YMIN|$ymin|"|sed "s|%YMAX|$ymax|"| + sed "s|%OUTPUTFILE|$timelag_plotfile|" > tmp.gp gnuplot tmp.gp done rm tmp.* - diff --git a/scripts/fix_thor_names.sh b/scripts/fix_thor_names.sh index 87f4188..195472a 100755 --- a/scripts/fix_thor_names.sh +++ b/scripts/fix_thor_names.sh @@ -6,7 +6,7 @@ do new_name=$(basename $analysis| sed 's|A_|Å\)|g'| sed 's|_\([0-9]\+\)|\(𝛌=\1|g'| - sed 's|_|_≻_|'| + sed 's|_|_≺_|'| sed 's|Δt|Δt=|'| sed 's|err|σ∊|')_σ∊MC mv $analysis analyses/$new_name diff --git a/scripts/templates/psd_freq.gp b/scripts/templates/psd_freq.gp index 307cee4..82eab00 100644 --- a/scripts/templates/psd_freq.gp +++ b/scripts/templates/psd_freq.gp @@ -5,7 +5,7 @@ set output "%OUTPUTFILE" set title "%TITLE\n{/*0.7 %SUBTITLE}" set xlabel "Temporal Frequency [days^{-1}]" -set xrange [0.005:0.603] +set xrange [0.005:0.620] # Use this if you want to show PSD directly on a log axis # set logscale xy diff --git a/scripts/templates/timelag_freq.gp b/scripts/templates/timelag_freq.gp index 4c3a8c9..19217eb 100644 --- a/scripts/templates/timelag_freq.gp +++ b/scripts/templates/timelag_freq.gp @@ -4,7 +4,7 @@ set output "%OUTPUTFILE" set title "%TITLE\n{/*0.7 %SUBTITLE}" set xlabel "Temporal Frequency [days^{-1}]" -set xrange [0.005:0.603] +set xrange [0.005:0.620] set logscale x set ylabel "Lag [days]"