- Timestamp:
- 05/28/19 11:39:09 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/QuickLook/FlareAlerts.sh
r19503 r19521 70 70 #cu="20.0" 71 71 #cu="CUQLA(fNight)" 72 cu=" Avg(fCU)"72 cu="fCU" 73 73 corr="1" 74 74 # missing: corrected excessrates … … 92 92 query=$query"ROUND(ExcErr(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM("$ontime")*3600*SUM(fNumExcEvts)/SUM(fNumExcEvts*"$corr"), 2) AS corexcrateerr, " # correctionfactor = exc / exc_cor, put here correction factor 93 93 query=$query"ROUND(LiMa(SUM(fNumSigEvts), SUM(fNumBgEvts)),2) AS signif, " 94 query=$query"ROUND(SUM(fNumExcEvts)/SUM("$ontime")*3600/ "$cu",2) AS cu, "95 query=$query"ROUND(ExcErr(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM("$ontime")*3600/ "$cu", 2) AS cuerr, " # make value time dependent96 query=$query"ROUND(SUM(fNumExcEvts*"$corr")/SUM("$ontime")*3600/ "$cu",2) as corcu, " # make value time dependent # put here correction factor97 query=$query"ROUND(ExcErr(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM("$ontime")*3600*SUM(fNumExcEvts)/SUM(fNumExcEvts*"$corr")/ "$cu", 2) AS corcuerr, " # correctionfactor = exc / exc_cor # make value time dependent # put here correction factor94 query=$query"ROUND(SUM(fNumExcEvts)/SUM("$ontime")*3600/AVG("$cu"),2) AS cu, " 95 query=$query"ROUND(ExcErr(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM("$ontime")*3600/AVG("$cu"), 2) AS cuerr, " # make value time dependent 96 query=$query"ROUND(SUM(fNumExcEvts*"$corr")/SUM("$ontime")*3600/AVG("$cu"),2) as corcu, " # make value time dependent # put here correction factor 97 query=$query"ROUND(ExcErr(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM("$ontime")*3600*SUM(fNumExcEvts)/SUM(fNumExcEvts*"$corr")/AVG("$cu"), 2) AS corcuerr, " # correctionfactor = exc / exc_cor # make value time dependent # put here correction factor 98 98 query=$query"MIN(fZenithDistanceMin) as zdmin, MAX(fZenithDistanceMax) as zdmax, " 99 99 query=$query"MIN("$threshold") as thmin, MAX("$threshold") as thmax " … … 720 720 evaluate_result 721 721 722 # Automatic Follow-Ups 723 triggertype=6 724 printprocesslog "INFO check for [Automatic Follow-Ups]" 725 query="SELECT Count(*) FROM Schedule WHERE fSTART BETWEEN DATE_ADD(DATE_FORMAT("$night", '%Y-%m-%d'), INTERVAL +18 HOUR)" 726 query=$query" AND DATE_ADD(DATE_FORMAT("$night", '%Y-%m-%d'), INTERVAL +35 HOUR) AND fUser='ToO' AND fSourceKey="$sourcekey 727 #echo $query 728 numtoo=`sendquery` 729 if [ $numtoo -gt 0 ] 730 then 731 echo "Found "$numtoo" ToO(s) for "$sourcename >> $logfile 732 case $sourcekey in 733 1|2|7) echo "standard monitoring source ("$sourcekey")" >> $logfile 734 ;; 735 [0-9][0-9][0-9][0-9]) echo "new source ("$sourcekey")" >> $logfile 736 ;; 737 *) echo "some other source ("$sourcekey")" >> $logfile 738 ;; 739 esac 740 triggerfile=$flarealertspath"/"$night"-"$numtoo"-source"$sourcekey".trigger"$triggertype 741 donetriggerfile=$triggerfile".done" 742 touch $triggerfile 743 echo "Found "$numtoo" ToOs." > $triggerfile 744 # write new file only if old files do not agree 745 if [ -e $donetriggerfile ] 746 then 747 diff $donetriggerfile $triggerfile >/dev/null 748 checkstatus=`echo $?` 749 if [ $checkstatus -eq 0 ] 750 then 751 echo " alert already done "$donetriggerfile >> $logfile 752 i=`echo $i +1 | bc -l` 753 continue 754 fi 755 fi 756 if ! [ -e $donetriggerfile ] 757 then 758 query="INSERT FlareAlerts.FlareTriggers SET fTriggerInserted=Now(), fNight="$night", fRunID="$numtoo", fTriggerType="$triggertype", fSourceKey="$sourcekey", fBinning=NULL" 759 echo $query 760 sendquery >> $logfile 761 mv $triggerfile $donetriggerfile 762 fi 763 fi 764 722 765 echo "" >> $logfile 723 766 echo "" >> $logfile
Note:
See TracChangeset
for help on using the changeset viewer.