Changeset 19446
- Timestamp:
- 03/12/19 14:36:12 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Tools/get_data.sh
r19066 r19446 31 31 32 32 33 34 35 33 # ToDo (notes DD): 36 34 # ---------------- 37 # - finalize policy and references 38 # must-have 39 # - update function for zd/th-correction 40 # - update CU for QLA 41 # - add CU for ISDC analysis 35 # - check ETh and crabflux factor for QLA 36 # - do conversion to fluxes using FACT Crab spectrum 42 37 # - add < 20121212 data for QLA 43 # - check crab flux38 # - new version of zd/th-correction and CU from Aachen when ready 44 39 # nice-to-have 45 40 # - add E2dNdE 46 41 # - functionality to determine start time for seaon-binning 47 # - offer several predefined datachecks? 48 # - file as attachment to email ofr download.php 42 # - file as attachment to email for download.php 49 43 50 44 # … … 97 91 echo "# If you intend to use data or information from this website, please let us know for reference." 98 92 else 99 echo "# As a member or associated member of the FACT Collaboration, you have access to internal information."93 echo "# As a member, associated member or collaborator of the FACT Collaboration, you have access to internal information." 100 94 echo "# Any publication using FACT internal information has to have the full FACT author list." 101 95 fi … … 107 101 echo "#" 108 102 echo "# Your Selection: " 109 sourcename=`mysql --defaults-file=$sqlpw - u factread --host=$host $dbname -s -e "SELECT fSourceName FROM Source WHERE fSourceKey="$source`103 sourcename=`mysql --defaults-file=$sqlpw -s -e "SELECT fSourceName FROM Source WHERE fSourceKey="$source` 110 104 echo "# Source: "$sourcename 111 105 echo "# Time range: "$nightmin"-"$nightmax … … 124 118 binning=`echo $bin | sed -e 's/-//'`" "$unit 125 119 echo "# Binning: "$binning 126 if [ "$expert" = "yes" ]120 if [ "$expert" != "no" ] 127 121 then 128 122 echo "# Additional Internal Selection: " … … 146 140 if [ "$usedch" == "yes" ] 147 141 then 148 echo "# Data quality selection based on the cosmic ray rate was applied." 142 echo "# Data quality selection was applied. " 143 if [ "$dch" == "" ] 144 then 145 echo "# Standard data check based on cosmic-ray rate: "$dchstd 146 else 147 echo "# You selected a custom datacheck: "$dch 148 fi 149 149 fi 150 150 fi … … 155 155 { 156 156 # some query parts 157 158 # some numbers for flux calculation 159 crabflux="3.37e-11" 160 fluxprec=13 161 crabflux="3.37" 157 158 # these values use the Crab spectrum from HESS 2006 159 case "$table" in 160 "AnalysisResultsRunISDC") 161 zdfactor="pow(cos(fZenithDistanceMean*PI()/180)*exp(1-cos(fZenithDistanceMean*PI()/180)),4.2)" 162 thfactor="(1.18-IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)*0.00062)" 163 # ETh: 764 GeV 164 crabflux="3.3" 165 ;; 166 "AnalysisResultsRunCutsLC") 167 zdfactor="pow(cos(fZenithDistanceMean*PI()/180)*exp(1-cos(fZenithDistanceMean*PI()/180)),4.5)" 168 thfactor="(1.37-IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)*0.00118)" 169 # ETh: 543 GeV 170 crabflux="5.7" 171 ;; 172 "AnalysisResultsRunLP") 173 zdfactor="(pow(cos(fZenithDistanceMean*PI()/180),3)+14.8/21.9*pow(sin(2*fZenithDistanceMean*PI()/180),5))" 174 #zdfactor="(1/(pow(cos(fZenithDistanceMean*PI()/180),3)+14.8/21.9*pow(sin(2*fZenithDistanceMean*PI()/180),5)))" 175 thfactor="(1-0.00124/1.21*(fThresholdMinSet-500)*(fThresholdMinSet>=500))" 176 # ETh: 750 GeV ----> CHECK 177 crabflux="3.37" 178 ;; 179 "*") 180 zdfactor="0" 181 thfactor="0" 182 crabflux="0" 183 ;; 184 esac 185 186 # conversion from crab units to fluxes (if a different value is given in setup 187 if [ "$crabfluxconv" != "" ] 188 then 189 crabflux=$crabfluxconv #e-11 190 fi 191 #echo "crabflux: "$crabflux 162 192 fluxprec=2 163 193 … … 170 200 zenith="fZenithDistance" 171 201 thresh="IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)" 172 # correction factor for excess rate (formula by TB) 173 correvts=" fNumExcEvts*(pow(cos("$zenith"Mean*PI()/180),3)+14.8/21.9*pow(sin(2*"$zenith"Mean*PI()/180),5))/((1-0.00124/1.21*("$thresh"-500)*("$thresh">=500))) " 174 # conversion to CU (determined by DD for QLA) 175 # https://www.fact-project.org/logbook/showthread.php?tid=4927 176 cufactor="CUQLA(fNight)" # missing: ISDC analysis 202 # correction for zd- and th-dependence 203 correvts=" fNumExcEvts/"$zdfactor"/"$thfactor 204 # conversion to CU - stored in each result-table (determined by DD Feb 2019) 205 cufactor="fCU" 177 206 # some calculations 178 207 excerr="ExcErr(Sum(fNumSigEvts), SUM(fNumBgEvts))" … … 412 441 echo $headerext >> $fileext 413 442 #echo "$queryext" 414 mysql --defaults-file=$sqlpw - u factread --host=$host $dbname -s -e "$queryext" >> $fileext415 #mysql --defaults-file=$sqlpw - u factread --host=$host $dbname -e "$queryext"443 mysql --defaults-file=$sqlpw -s -e "$queryext" >> $fileext 444 #mysql --defaults-file=$sqlpw -e "$queryext" 416 445 fi 417 446 if [ "$mode" == "auto" ] && [ "$expert" == "no" ] … … 439 468 echo $headerint >> $fileint 440 469 #echo "$queryint" 441 mysql --defaults-file=$sqlpw - u factread --host=$host $dbname -s -e "$queryint" >> $fileint442 #mysql --defaults-file=$sqlpw - u factread --host=$host $dbname -e "$queryint"470 mysql --defaults-file=$sqlpw -s -e "$queryint" >> $fileint 471 #mysql --defaults-file=$sqlpw -e "$queryint" 443 472 if [ "$mode" == "auto" ] 444 473 then … … 453 482 print_policy >> $filecol 454 483 print_selection >> $filecol 455 echo "# The following query was used: " >> $filecol456 echo "# "$querycol >> $filecol457 echo "#" >> $filecol484 #echo "# The following query was used: " >> $filecol 485 #echo "# "$querycol >> $filecol 486 #echo "#" >> $filecol 458 487 fi 459 488 headercol="# time["$timeunit"] start["$timeunit"] stop["$timeunit"] excess-rate[evts/h] corrected_excess-rate[evts/h] flux[CU] flux[e-11/cm2/s] (stop-start)/2["$timeunit"] ontime[min]" … … 461 490 echo $headercol >> $filecol 462 491 #echo "$querycol" 463 mysql --defaults-file=$sqlpw - u factread --host=$host $dbname -s -e "$querycol" >> $filecol464 #mysql --defaults-file=$sqlpw - u factread --host=$host $dbname -e "$querycol492 mysql --defaults-file=$sqlpw -s -e "$querycol" >> $filecol 493 #mysql --defaults-file=$sqlpw -e "$querycol 465 494 } 466 495 … … 472 501 mode="auto" 473 502 overwrite="yes" 474 # setup 503 # setup for usage with download.php 475 504 datapath="/home/factwww/dch/data" 476 505 #datapath="./data" 477 506 sqlpw=/home/fact/.mysql.pw 478 #sqlpw=/home/fact/.mysql.pw2 479 host=10.0.100.21480 dbname=factdata507 #sqlpw=/home/fact/.mysql.pw2 508 #host=10.0.100.21 509 #dbname=factdata 481 510 nightmin=$1 482 511 nightmax=$2 … … 537 566 # DB SETUP 538 567 # ---------- 539 # path to file with mysql password 540 sqlpw=/home/$USER/.mysql.pw 541 # host of mysql server with FACT DB 542 #host=lp-fact # ISDC 543 host=10.0.100.21 # LP or LP via vpn 544 #host=localhost # your local machine in case you have a copy of DB 545 # name of database 546 dbname=factdata 568 # path to file with mysql setup (user, password, host, db-name) 569 sqlpw=/home/$USER/.mysql.pw.local 547 570 # 548 571 # ------------- … … 572 595 # choose analysis 573 596 #table="AnalysisResultsAllQLA" # N/A 574 table="AnalysisResultsRunLP" # QLA597 #table="AnalysisResultsRunLP" # QLA 575 598 #table="AnalysisResultsRunISDC" # ISDC 599 table="AnalysisResultsRunCutsLC" # CutsLC 576 600 # time range 577 601 nightmin=20111115 … … 596 620 #dust=1 597 621 #dust=10 622 # use different conversion from CU to fluxes 623 #crabfluxconv="2.5" 598 624 599 625 … … 604 630 # Adapt the lines below to your needs. # 605 631 # Overwrite default settings above. # 606 # The data-request is sent with the line 'get_results .'#632 # The data-request is sent with the line 'get_results'. # 607 633 # Minumum setup: Define source key and name for file. # 608 634 # The list of source keys can be found at # … … 610 636 # More examples can be found further down. # 611 637 # # 612 # REMARKS: #613 # - correction of effect of zd and threshold not yet finalized and only valid for QLA #614 # - no CU-conversion available for ISDC-analysis so far (that for QLA is used instead) #615 # #616 638 # -------------------------------------------------------------------------------------- # 639 640 #expert="yes" 641 642 # Mrk 501 643 source=2 644 zdmax=90 645 thmax=1500 646 # new analysis 647 table="AnalysisResultsRunCutsLC" # CutsLC 648 nightmin=20140520 649 nightmax=20140930 650 name="Mrk501_nightly_newAnalysis_forHESS" 651 bin=-1 652 get_results 653 name="Mrk501_7d_newAnalysis_forHESS" 654 bin=-7 655 get_results 656 nightmin=20140623 657 nightmax=20140623 658 name="Mrk501_5min_FlareNight_newAnalysis_forHESS" 659 bin=5 660 get_results 661 # isdc analysis 662 thmax=850 663 table="AnalysisResultsRunISDC" 664 nightmin=20140520 665 nightmax=20140930 666 name="Mrk501_nightly_stdAnalysis_forHESS" 667 bin=-1 668 get_results 669 name="Mrk501_7d_stdAnalysis_forHESS" 670 bin=-7 671 get_results 672 nightmin=20140623 673 nightmax=20140623 674 name="Mrk501_5min_FlareNight_stdAnalysis_forHESS" 675 bin=5 676 get_results 677 # qla 678 thmax=500 679 table="AnalysisResultsRunLP" 680 nightmin=20140520 681 nightmax=20140930 682 name="Mrk501_nightly_QLA_forHESS" 683 bin=-1 684 get_results 685 686 exit 617 687 618 688 # 501 MAGIC … … 620 690 name="Mrk501_2014_forMAGIC" 621 691 bin=-1 692 crabfluxconv="2.87" # using threshold of 830GeV 693 crabfluxconv="3.01" # using threshold of 830GeV and MAGIC Crab spectrum 622 694 nightmin=20140714 623 695 nightmax=20140805 624 696 get_results 697 698 name="Mrk501_2014_forMAGIC_20min" 699 bin=20 700 get_results 701 702 703 exit 625 704 626 705 bin=30
Note:
See TracChangeset
for help on using the changeset viewer.