clag-agn/scripts/compute_psdlags.sh

46 lines
1.2 KiB
Bash
Raw Normal View History

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
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
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 10:49:53 +00:00
# process_tables perl script reads *.out files from the python script,
# then creates other useful tables
2017-06-22 11:11:39 +00:00
scripts/process_tables.pl $echo_band
2017-06-22 10:10:46 +00:00
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