From 539cb359ed47f855c5aa918700dafbd18773ff25 Mon Sep 17 00:00:00 2001 From: caes Date: Thu, 22 Jun 2017 06:49:53 -0400 Subject: [PATCH] update --- scripts/compute_psdlags.sh | 28 ++++++++++++++-------------- scripts/plot.sh | 7 ++++--- scripts/process_tables.pl | 8 ++++---- scripts/psdlag_4bin.py | 0 4 files changed, 22 insertions(+), 21 deletions(-) mode change 100644 => 100755 scripts/psdlag_4bin.py diff --git a/scripts/compute_psdlags.sh b/scripts/compute_psdlags.sh index 54b9b47..7bd8895 100755 --- a/scripts/compute_psdlags.sh +++ b/scripts/compute_psdlags.sh @@ -5,31 +5,31 @@ mkdir -p data ref_band="1367A" refpsd_tabfile=data/tables/psd_${ref_band}.tab +err_str="LF" + for lightcurve in data/lc/*.lc do - echo_band=$(basename $lightcurve|sed 's|\([0-9]????A\).lc|\1|') + echo_band=$(basename $lightcurve|sed 's|\([0-9]\{4\}A\).lc|\1|') if [[ $ref_band == $echo_band ]]; then continue; fi - err_str="LF" # Save tables with these filenames echopsd_tabfile=data/tables/psd_${echo_band}.tab timelag_tabfile=data/tables/lag_${ref_band}_${echo_band}.tab echo -n "Running psdlag using ref band ${ref_band}" - echo " and echo band $echo_band{${err_str}}." + echo " and echo band $echo_band." - # psdlag python script will call clag and print tables - # tmp.* files. - echo scripts/psdlag_4bin.py ${ref_band}.lc $lightcurve + # psdlag python script will call clag and print rudimentary tables to *.out + time scripts/psdlag_4bin.py data/lc/${ref_band}.lc $lightcurve > /dev/null - # process_tables perl script reads tmp.* files and creates some - # other useful tables - scripts/process_tables.pl $lightcurve > /dev/null - mv tmp.echoPSD $echoPSD_tabfile - mv tmp.refPSD $refPSD_tabfile - mv tmp.timelag $timelag_tabfile + # process_tables perl script reads *.out files from the python script, + # then creates other useful tables + scripts/process_tables.pl $echo_band > /dev/null + + # saves the tables to data/tables/ + mv -v tmp.echopsd $echopsd_tabfile + mv -v tmp.refpsd $refpsd_tabfile + mv -v tmp.lag $timelag_tabfile done - -rm tmp.* \ No newline at end of file diff --git a/scripts/plot.sh b/scripts/plot.sh index be8db59..4c1e03a 100755 --- a/scripts/plot.sh +++ b/scripts/plot.sh @@ -9,11 +9,12 @@ case $1 in "PSD"|"psd"|"PSDs"|"PSDS"|"psds") gnuplot_file=psd_atlas.gp scripts/propagate_tables.sh - gnuplot_input=$(cat scripts/templates/${gnuplot_file}|perl -pe 's|\n|␤|g') - for tabfile in data/tables/PSD_*${errtype}*.tab; + gnuplot_input=$(cat scripts/templates/${gnuplot_file}| + perl -pe 's|\n|␤|g') + for tabfile in data/tables/psd_*.tab; do echo_band=$(basename $tabfile| - sed 's|PSD[_ ]\(.\{5\}\)[_ ]{[^_ ]*}.tab|\1|') + sed 's|psd_\([0-9]????A\).tab|\1|') if [[ "$echo_band" == "$ref_band" ]] ; then continue; fi gnuplot_input_edit=$(echo "$gnuplot_input"| sed "s|%FILE%|$tabfile|"| diff --git a/scripts/process_tables.pl b/scripts/process_tables.pl index 12d4752..a76487a 100755 --- a/scripts/process_tables.pl +++ b/scripts/process_tables.pl @@ -138,7 +138,7 @@ if($debug) { close($outputfile); -open($datafile,'>',"tmp.refPSD") or die $!; +open($datafile,'>',"tmp.refpsd") or die $!; while( each %function_bin) { say $datafile $_ . " " . @@ -148,7 +148,7 @@ while( each %function_bin) { } close($datafile); -open($datafile,'>',"tmp.echoPSD") or die $!; +open($datafile,'>',"tmp.echopsd") or die $!; while( each %function_bin) { say $datafile $_ . " " . @@ -158,7 +158,7 @@ while( each %function_bin) { } close($datafile); -open($datafile,'>',"tmp.crsspctrmPSD") or die $!; +open($datafile,'>',"tmp.crsspctrm") or die $!; while( each %function_bin) { say $datafile $_ . " " . @@ -168,7 +168,7 @@ while( each %function_bin) { } close($datafile); -open($datafile,'>',"tmp.timelag") or die $!; +open($datafile,'>',"tmp.lag") or die $!; while( each %function_bin) { say $datafile $_ . " " . diff --git a/scripts/psdlag_4bin.py b/scripts/psdlag_4bin.py old mode 100644 new mode 100755