Changeset 18799


Ignore:
Timestamp:
04/02/17 07:04:46 (8 years ago)
Author:
Daniela Dorner
Message:
fixed bug in xml-filename; only create xml file when alert is new
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/QuickLook/FlareAlerts.sh

    r18794 r18799  
    3030   finish
    3131fi
    32 voeventpath=$flarealertspath"/amon"
     32voeventpath="/home/fact/amon/flare_alerts/"
    3333
    3434logfile=$runlogpath"/FlareAlerts-"$datetime".log"
     
    113113      bin2=$bin
    114114   fi
    115    echo "binning:-"$bin2"- 1+"$1"+ b_"$bin"_"
    116115   # query to get information from DB
    117116   query="SELECT MAX(o.b) AS num, "
     
    150149   query=$query"CROSS JOIN (SELECT @night :=0, @ot :=0, @os :=0, @bl:=0) PARAMS "
    151150   query=$query"WHERE fSourceKey="$sourcekey" AND fNight="$night" AND NOT ISNULL(fNumExcEvts) "
    152    if [ "$1" != "" ]
    153    then
    154       query=$query" AND fRunID <="${results[$num+3]}
    155    fi
     151#   if [ "$1" != "" ]
     152#   then
     153#      query=$query" AND fRunID <="${results[$num+3]}
     154#   fi
    156155   query=$query" ORDER BY fRunStart "
    157    if [ "$1" != "" ]
    158    then
    159       query=$query"DESC"
    160    fi
     156#   if [ "$1" != "" ]
     157#   then
     158#      query=$query"DESC"
     159#   fi
    161160   query=$query" ) o GROUP BY b HAVING ontime > "$bin2"*0.75 ORDER BY start "
    162    if [ "$1" != "" ]
    163    then
    164       query=$query"DESC"
    165    fi
     161#   if [ "$1" != "" ]
     162#   then
     163#      query=$query"DESC"
     164#   fi
    166165   #echo $query
    167166}
     
    475474            if [ $checkstatus -gt 0 ]
    476475            then
    477                rm $donetriggerfile
     476               # keep history of non-sent triggers
     477               donetriggerfile2=$donetriggerfile"-changed-"`date +%Y%m%d%H%M%S`
     478               mv $donetriggerfile $donetriggerfile2
    478479            fi
    479480         fi
    480481         # missing: get summary of whole observation
    481482         
    482          # AMON case: create VOEvent-File
    483          if [ $triggertype -eq 4 ]
    484          then
    485             voeventfile=$voeventpath"/"$night"_"`printf %03d $runid`"-"$exclimit"_"$siglimit"-source"$sourcekey".trigger"$triggertype".xml"
    486             echo $voeventfile
    487             echo ${sourceinfo[@]}
    488             #print_voevent_file
    489             print_voevent_file > $voeventfile
    490          fi
    491 
    492483         # send email only of $donetriggerfile doesn't exists
    493484         if ! [ -e $donetriggerfile ]
    494485         then
     486            # AMON case: create VOEvent-File
     487            if [ $triggertype -eq 4 ]
     488            then
     489               voeventfile=$voeventpath"/"`basename $triggerfile`".xml"
     490               # missing: check for archive file
     491               #   if exist -> do revision
     492               echo "creating "$voeventfile
     493               echo "Creating "$voeventfile >> $logfile
     494               #print_voevent_file
     495               print_voevent_file > $voeventfile
     496               # in amon-case no email needs to be sent
     497               continue
     498            fi
     499
    495500            cat $triggerfile | mail -s 'test flare alert ' -b $emailfrom -r $emailfrom $emailto
    496501         fi
Note: See TracChangeset for help on using the changeset viewer.