Changeset 19961


Ignore:
Timestamp:
May 18, 2020, 5:15:54 PM (3 months ago)
Author:
dorner
Message:
added datacheck and factorcut for binnings smaller than 1 night
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Tools/get_data.sh

    r19943 r19961  
    466466      querybase=$querybase" IF (@night=fNight AND FLOOR((@os+@ot)/"$bin"./60.)<1, @os:=@os + @ot, @os := @ot) AS os, @night :=fNight AS night "
    467467      querybase=$querybase$from" CROSS JOIN (SELECT @night :=0, @ot :=0, @os :=0, @bl:=0) PARAMS "
    468       querybase=$querybase$where" ORDER BY fRunStart) o GROUP BY block HAVING ontime>0.75*"$bin" ORDER BY 'time'"
     468      querybase=$querybase$where
     469      queryend=" ORDER BY fRunStart) o GROUP BY block HAVING ontime>0.75*"$bin" ORDER BY 'time'"
    469470     
    470471      # internal
     
    479480      queryint=$queryint" MIN(o.zdmin) AS zdmin, MAX(o.zdmax) AS zdmax, MIN(o.th) AS thmin, MAX(o.th) AS thmax, "
    480481      queryint=$queryint" ROUND(AVG(o.cufactor), 1) AS cufactor, ROUND(AVG(o.R750cor), 2) AS R750cor,  ROUND(AVG(o.R750ref), 2) AS R750ref "
    481       queryint=$queryint" "$querybase
    482      
     482      if [ "$factorcut" == "" ]
     483      then
     484         queryint=$queryint" "$querybase" "$querydch" "$queryend
     485      else
     486         queryint=$queryint" "$querybase" "$querydch" AND ("$zdfactor" * "$thfactor") > "$factorcut" "$queryend
     487      fi
    483488      # for collaborators
    484489      querycol=$querystart
     
    487492      querycol=$querycol" "$excrateerr2", "$correxcrateerr2", "$cuerr2", "$fluxcorerr2", "
    488493      querycol=$querycol" "$significance2
    489       querycol=$querycol" "$querybase
     494      if [ "$factorcut" == "" ]
     495      then
     496         querycol=$querycol" "$querybase" "$querydch" "$queryend
     497      else
     498         querycol=$querycol" "$querybase" "$querydch" AND ("$zdfactor" * "$thfactor") > "$factorcut" "$queryend
     499      fi
    490500     
    491501      # external
    492       queryext=$querystart" "$excrate2", "$deltat2", "$ontime2", "$excrateerr2" "$querybase
     502      # no datacheck applied for external files
     503      queryext=$querystart" "$excrate2", "$deltat2", "$ontime2", "$excrateerr2" "$querybase" "$queryend
    493504     
    494505   fi
     
    726737
    727738
     739
     740# LC for periodicity studies
     741datapath=/home/dorner/analysis.FACT/flux.states.2020
     742table="AnalysisResultsRunCutsLC" # CutsLC
     743# nightly
     744bin=-1
     745nightmin=20111115
     746nightmax=20201231
     747# 0323
     748name="0323_nightly"
     749source=12
     750get_results
     751
     752exit
     753
     754
     755# LC for Mrk 421 paper with MAGIC  - check IDV
     756# from David: MJD 57030 - 57540 (i.e. 8.1.2015 - 1.6.2016)
     757datapath=/home/dorner/analysis.FACT/421.IDV
     758# include lidar data
     759dch=" AND fR750Cor/fR750Ref > 0.93 "
     760table="AnalysisResultsRunCutsLC" # CutsLC
     761# conversion factor to fluxes for CutsLC
     762#  using slope of -3.35 -> threshold ~685 GeV
     763#  details: https://www.fact-project.org/logbook/showthread.php?tid=6994&pid=28902#pid28902
     764crabfluxconv="3.64"
     765# Mrk 421
     766source=1
     767# 20 min
     768bin=20
     769# time range of MAGIC paper
     770nightmin=20141101
     771nightmax=20160630
     772name="Mrk421_20141101_20160630_20min_forMAGIC_DChLim"
     773get_results
     774# 30 min binning
     775bin=30
     776name="Mrk421_20141101_20160630_30min_forMAGIC_DChLim"
     777get_results
     778# 40 min binning
     779bin=40
     780name="Mrk421_20141101_20160630_40min_forMAGIC_DChLim"
     781get_results
     782# 60 min binning
     783bin=60
     784name="Mrk421_20141101_20160630_60min_forMAGIC_DChLim"
     785get_results
     786# 80 min binning
     787bin=80
     788name="Mrk421_20141101_20160630_80min_forMAGIC_DChLim"
     789get_results
     790# 90 min binning
     791bin=90
     792name="Mrk421_20141101_20160630_90min_forMAGIC_DChLim"
     793get_results
     794# 100 min binning
     795bin=100
     796name="Mrk421_20141101_20160630_100min_forMAGIC_DChLim"
     797get_results
     798# 120 min binning
     799bin=120
     800name="Mrk421_20141101_20160630_120min_forMAGIC_DChLim"
     801get_results
     802# all data
     803nightmin=20111115
     804nightmax=20201231
     805bin=20
     806name="Mrk421_all_20min_DChLim"
     807get_results
     808bin=30
     809name="Mrk421_all_30min_DChLim"
     810get_results
     811bin=40
     812name="Mrk421_all_40min_DChLim"
     813get_results
     814bin=60
     815name="Mrk421_all_60min_DChLim"
     816get_results
     817bin=80
     818name="Mrk421_all_80min_DChLim"
     819get_results
     820bin=90
     821name="Mrk421_all_90min_DChLim"
     822get_results
     823bin=100
     824name="Mrk421_all_100min_DChLim"
     825get_results
     826bin=120
     827name="Mrk421_all_120min_DChLim"
     828get_results
     829
     830
     831
     832exit
     833
     834
     835# IDV LCs for Mrk 421 with MAGIC
     836# Biswajit: MJD 56970-57560
     837#   = 2014-11-09 - 2016-06-21
     838#   is covered in check (below)
     839# IDV in MAGIC: 2015-01-26
     840# IDV in FACT: 2015-03-11
     841# details: https://www.fact-project.org/logbook/showthread.php?tid=7297
     842datapath=/home/dorner/analysis.FACT/corrected.lcs.for.collaborators/lcs
     843table="AnalysisResultsRunCutsLC" # CutsLC
     844# Mrk 421
     845source=1
     846# conversion factor to fluxes for CutsLC
     847#  using slope of -3.35 -> threshold ~685 GeV
     848#  details: https://www.fact-project.org/logbook/showthread.php?tid=6994&pid=28902#pid28902
     849crabfluxconv="3.64"
     850# 20 min
     851bin=20
     852nightmin=20150126
     853nightmax=20150126
     854name="Mrk421_20150126_20min_forMAGIC"
     855get_results
     856nightmin=20150311
     857nightmax=20150311
     858name="Mrk421_20150311_20min_forMAGIC"
     859get_results
     860
     861
     862
     863
     864# LC for Mrk 421 paper with MAGIC  - check IDV
     865# from David: MJD 57030 - 57540 (i.e. 8.1.2015 - 1.6.2016)
     866datapath=/home/dorner/analysis.FACT/421.IDV
     867table="AnalysisResultsRunCutsLC" # CutsLC
     868# conversion factor to fluxes for CutsLC
     869#  using slope of -3.35 -> threshold ~685 GeV
     870#  details: https://www.fact-project.org/logbook/showthread.php?tid=6994&pid=28902#pid28902
     871crabfluxconv="3.64"
     872# Mrk 421
     873source=1
     874# 20 min
     875bin=20
     876# time range of MAGIC paper
     877nightmin=20141101
     878nightmax=20160630
     879name="Mrk421_20141101_20160630_20min_forMAGIC"
     880get_results
     881# 30 min binning
     882bin=30
     883name="Mrk421_20141101_20160630_30min_forMAGIC"
     884get_results
     885# 40 min binning
     886bin=40
     887name="Mrk421_20141101_20160630_40min_forMAGIC"
     888get_results
     889# 60 min binning
     890bin=60
     891name="Mrk421_20141101_20160630_60min_forMAGIC"
     892get_results
     893# 80 min binning
     894bin=80
     895name="Mrk421_20141101_20160630_80min_forMAGIC"
     896get_results
     897# 90 min binning
     898bin=90
     899name="Mrk421_20141101_20160630_90min_forMAGIC"
     900get_results
     901# 100 min binning
     902bin=100
     903name="Mrk421_20141101_20160630_100min_forMAGIC"
     904get_results
     905# 120 min binning
     906bin=120
     907name="Mrk421_20141101_20160630_120min_forMAGIC"
     908get_results
     909# all data
     910nightmin=20111115
     911nightmax=20201231
     912bin=20
     913name="Mrk421_all_20min"
     914get_results
     915bin=30
     916name="Mrk421_all_30min"
     917get_results
     918bin=40
     919name="Mrk421_all_40min"
     920get_results
     921bin=60
     922name="Mrk421_all_60min"
     923get_results
     924bin=80
     925name="Mrk421_all_80min"
     926get_results
     927bin=90
     928name="Mrk421_all_90min"
     929get_results
     930bin=100
     931name="Mrk421_all_100min"
     932get_results
     933bin=120
     934name="Mrk421_all_120min"
     935get_results
     936
     937
     938
     939exit
     940
    728941# LC for periodicity studies
    729942datapath=/home/dorner/analysis.FACT/corrected.lcs.for.collaborators/lcs/
Note: See TracChangeset for help on using the changeset viewer.