2016-08-06 02:49:11 +00:00
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2016-08-06 03:08:36 +00:00
|
|
|
|
# This script is meant to encapsulate all functions in proper order to produce
|
|
|
|
|
# the analyses. Parameters that this script should control: Δt, σ type, input
|
2017-01-11 06:37:12 +00:00
|
|
|
|
# dataset(lightcurve directory), more?
|
|
|
|
|
|
2017-01-11 06:45:37 +00:00
|
|
|
|
ref_band=$(cat ref_band)
|
2017-01-25 06:19:52 +00:00
|
|
|
|
ref_curve="lightcurves/${ref_band}.lc"
|
2017-01-11 06:45:37 +00:00
|
|
|
|
err_str=$(cat err_type)
|
2017-01-11 06:37:39 +00:00
|
|
|
|
|
2017-01-11 06:37:12 +00:00
|
|
|
|
mkdir -p analyses/tables
|
|
|
|
|
|
2017-01-25 06:19:52 +00:00
|
|
|
|
for echo_curve in lightcurves/*
|
2017-01-11 06:37:12 +00:00
|
|
|
|
do
|
|
|
|
|
# Grab and determine labels of analyses, skip if over the same band.
|
2017-01-11 06:45:37 +00:00
|
|
|
|
echo_band=$(basename $echo_curve|sed 's|\(.*\)\.lc|\1|')
|
2017-01-11 06:37:12 +00:00
|
|
|
|
if [[ $ref_band == $echo_band ]]; then continue; fi
|
2017-01-11 06:45:37 +00:00
|
|
|
|
|
2017-01-30 03:27:16 +00:00
|
|
|
|
echo "Analysing $echo_band ≺ $ref_band."
|
2017-01-11 06:45:37 +00:00
|
|
|
|
|
2017-01-25 06:19:52 +00:00
|
|
|
|
if [[ -e "analyses/${ref_band}_≺_${echo_band}/" ]]; then
|
|
|
|
|
echo "Results already exists. Create tables from stored results."
|
|
|
|
|
cp analyses/${ref_band}_≺_${echo_band}/*.out .
|
|
|
|
|
else
|
|
|
|
|
python scripts/analyze_lightcurve.py $ref_curve $echo_curve >> /dev/null
|
|
|
|
|
mkdir -p "analyses/${ref_band}_≺_${echo_band}"
|
|
|
|
|
cp *.out analyses/${ref_band}_≺_${echo_band}/
|
|
|
|
|
fi
|
2017-01-11 06:37:12 +00:00
|
|
|
|
|
2017-01-30 03:27:16 +00:00
|
|
|
|
echo "Tabling PSD and time lags referred to ${ref_band} for $echo_band{${err_str}}."
|
2017-01-11 06:37:12 +00:00
|
|
|
|
|
|
|
|
|
# Propagate tables into analyses/tables
|
|
|
|
|
echoPSD_tabfile=analyses/tables/PSD_${echo_band}_\{${err_str}\}.tab
|
|
|
|
|
refPSD_tabfile=analyses/tables/PSD_${ref_band}_\{${err_str}\}.tab
|
|
|
|
|
timelag_tabfile=analyses/tables/timelag_${ref_band}_≺_${echo_band}_\{${err_str}\}.tab
|
|
|
|
|
|
|
|
|
|
# Output curves to temporary files using perl script, move tables to
|
|
|
|
|
# permanent location. This just assumes there are no conflicts.
|
2017-01-25 06:19:52 +00:00
|
|
|
|
scripts/extract_tables.pl
|
2017-01-11 06:37:12 +00:00
|
|
|
|
mv tmp.echoPSD $echoPSD_tabfile
|
|
|
|
|
mv tmp.refPSD $refPSD_tabfile
|
|
|
|
|
mv tmp.timelag $timelag_tabfile
|
2017-01-25 06:19:52 +00:00
|
|
|
|
rm *.out
|
2017-01-11 06:37:12 +00:00
|
|
|
|
done
|
|
|
|
|
|
2017-01-25 06:19:52 +00:00
|
|
|
|
rm tmp.*
|