#! /usr/local/bin/bash -v # #--> Get ifo list ifolist=$1 if [ "x$ifolist" = "x" ]; then ifolist="H1 H2 L1"; fi echo "Processing ifo list: $ifolist" # #--> Loop over ifos for ifo in $ifolist ; do echo "Processing ifo: $ifo" # #--> Get the trigger list dbfile="${ifo}-table_temp.xml" if [ ! -f $dbfile ]; then smax=0.001; xcond=""; if [ "$ifo" = "L1" ]; then site=llo; elif [ "$ifo" = "H1" ]; then site=lho; smax=0.01; xcond="((start_time < 816730000) OR (start_time > 816750000))" else site=lho; fi tcond="(name = 'Glitch') AND (subtype = '$ifo:LSC-DARM_CTRL_EXC_DAQ')"; scond="(size > $smax)"; query="SELECT * FROM GDS_TRIGGER WHERE $tcond AND $scond"; if [ "x$xcond" != "x" ]; then query="$query AND $xcond"; fi query="$query order by start_time"; echo "Getting data for ifo: ${ifo}..."; getMeta -a -d $site -o $dbfile -q "$query"; echo "`wc -l $dbfile` lines read from database" fi # #--> Trash all the unused columns tablepgm -i - $dbfile > /dev/null < Filter out the science mode triggers echo "Filter $ifo triggers..." seglist="../segments/S5${ifo}v00_segs.txt" scimode="${ifo}-cal_line-table.txt" segfilt -segfile $seglist -in $scimode table-temp.txt # #--> Tag the lines. echo "Tag $ifo lines..." segfile="${ifo}-cal_line_segs.txt" query="`grep 'SELECT' $dbfile | sed -e 's|[ \t]*<[/]*Comment>||g'`" echo "# Meta-DB query: $query" > $segfile echo "# Query results in: $dbfile `stat -c %y $dbfile`" >> $segfile echo "# Total lines: `wc -l table-temp.txt`" >> $segfile echo "# Science segment list file: $seglist `stat -c %y $seglist`" >> $segfile echo "# Query lines in science mode: `wc -l $scimode`" >> $segfile tablepgm -i - $scimode >> $segfile <250.0" -with "'one-sample'" replace -column sgtype -rows "b==875000000 && d>21 && d<25" -with "'one-second3'" replace -column sgtype -rows "a(_prev) == a-1 && b==875000000 && d>30 && d<34 && d(_prev)>30 && d(_prev)<34" -with "'one-second2'" remove -rows "sgtype(_next) == 'one-second2'" addcolumn -title stop_gps -before b -eval 0 replace -column stop_gps -rows "sgtype == 'one-second2'" -with "a+1" replace -column a -rows "sgtype == 'one-second2'" -with "a-1" replace -column stop_gps -rows "sgtype == 'one-second3'" -with "a+2" replace -column a -rows "sgtype == 'one-second3'" -with "a-1" replace -column stop_gps -rows "sgtype == 'one-sample'" -with "a+1" replace -column sgtype -rows "a(_prev) == a-4 && b(_prev) == b && c(_prev) == c" -with "'awg-stuck'" replace -column stop_gps -with a+4 -rows "sgtype == 'awg-stuck'" replace -column a -with "a(_prev)" -rows "sgtype == 'awg-stuck'" remove -rows "sgtype(_next) == 'awg-stuck' && a == a(_next)" replace -column stop_gps -rows "sgtype == 0" -with "a+1" setcolumn a -title start_gps setcolumn b -title start_ns setcolumn c -title size setcolumn d -title significance EOF # done