2017-06-22 10:10:46 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-06-22 11:11:39 +00:00
|
|
|
mkdir -p data/tables
|
|
|
|
mkdir -p logs
|
|
|
|
|
2017-06-22 19:39:56 +00:00
|
|
|
analysis_script="psdlag_4bin.py"
|
2017-06-22 10:10:46 +00:00
|
|
|
|
|
|
|
ref_band="1367A"
|
2017-06-22 10:36:22 +00:00
|
|
|
refpsd_tabfile=data/tables/psd_${ref_band}.tab
|
2017-06-22 10:10:46 +00:00
|
|
|
|
2017-06-22 10:49:53 +00:00
|
|
|
err_str="LF"
|
|
|
|
|
2017-06-22 10:10:46 +00:00
|
|
|
for lightcurve in data/lc/*.lc
|
|
|
|
do
|
|
|
|
|
2017-06-22 10:49:53 +00:00
|
|
|
echo_band=$(basename $lightcurve|sed 's|\([0-9]\{4\}A\).lc|\1|')
|
2017-06-22 10:10:46 +00:00
|
|
|
if [[ $ref_band == $echo_band ]]; then continue; fi
|
2017-06-22 10:19:42 +00:00
|
|
|
|
2017-06-22 10:36:22 +00:00
|
|
|
# Save tables with these filenames
|
|
|
|
echopsd_tabfile=data/tables/psd_${echo_band}.tab
|
|
|
|
timelag_tabfile=data/tables/lag_${ref_band}_${echo_band}.tab
|
2017-06-22 10:19:42 +00:00
|
|
|
|
2017-06-22 10:36:22 +00:00
|
|
|
echo -n "Running psdlag using ref band ${ref_band}"
|
2017-06-22 10:49:53 +00:00
|
|
|
echo " and echo band $echo_band."
|
2017-06-22 10:10:46 +00:00
|
|
|
|
2017-06-22 11:11:39 +00:00
|
|
|
echo $(date) >> logs/$echo_band
|
2017-06-22 13:45:46 +00:00
|
|
|
echo "using ${analysis_script}"
|
2017-06-22 11:11:39 +00:00
|
|
|
echo " " >> logs/$echo_band
|
|
|
|
|
|
|
|
# psdlag python script will call clag and print rudimentary tables to *.out,
|
|
|
|
# and is logged to the log file
|
|
|
|
time scripts/${analysis_script} data/lc/${ref_band}.lc $lightcurve >> logs/${echo_band}
|
2017-06-22 10:10:46 +00:00
|
|
|
|
|
|
|
|
2017-06-22 11:40:19 +00:00
|
|
|
# process_output perl script reads *.out files from the python script,
|
2017-06-22 10:49:53 +00:00
|
|
|
# then creates other useful tables
|
2017-06-22 11:11:39 +00:00
|
|
|
|
2017-06-22 11:40:19 +00:00
|
|
|
scripts/process_output.pl $echo_band
|
2017-06-22 10:10:46 +00:00
|
|
|
|
2017-06-22 13:28:23 +00:00
|
|
|
# So if one fails we don't read the previous output
|
|
|
|
rm *.out
|
|
|
|
|
2017-06-22 10:49:53 +00:00
|
|
|
# saves the tables to data/tables/
|
|
|
|
mv -v tmp.echopsd $echopsd_tabfile
|
|
|
|
mv -v tmp.refpsd $refpsd_tabfile
|
|
|
|
mv -v tmp.lag $timelag_tabfile
|
2017-06-22 11:11:39 +00:00
|
|
|
|
|
|
|
echo ""
|
2017-06-22 10:49:53 +00:00
|
|
|
done
|