source: trunk/DataCheck/Tools/get_data.sh@ 19740

Last change on this file since 19740 was 19732, checked in by Daniela Dorner, 5 years ago
added new options for download-website
  • Property svn:executable set to *
File size: 39.4 KB
Line 
1#!/bin/bash
2
3# ---------------------------------------------------------------- #
4# README README README README README README README README README #
5# ---------------------------------------------------------------- #
6# #
7# To use this script, you need #
8# - a computer with access to the FACT database in La Palma #
9# - a file with the password of a valid mysql-user #
10# - to define the setup below for #
11# a) the DB access #
12# b) the data you want to have #
13# #
14# To define the setup, search for SETUP in this script and #
15# read the details there #
16# #
17# Per data request, you get up to 3 files: #
18# *_internal.dat #
19# *_collaborators.dat #
20# *_external.dat (only if binning is 20min or nightly) #
21# #
22# Please have in mind that this started as a tool for myself, then #
23# others started using it. Also the script is not yet finalized. #
24# In case you find problems and/or have a feature request, please #
25# send and email to dorner@astro.uni-wuerzburg.de #
26# #
27# ---------------------------------------------------------------- #
28# README README README README README README README README README #
29# ---------------------------------------------------------------- #
30
31
32
33# ToDo (notes DD):
34# ----------------
35# - do conversion to fluxes using FACT Crab spectrum
36# - add < 20121212 data for QLA
37# - new version of zd/th-correction and CU from Aachen when ready
38# nice-to-have
39# - add E2dNdE
40# - functionality to determine start time for seaon-binning
41# - file as attachment to email for download.php
42
43#
44# content of files (wish list):
45# -----------------------------
46# REMARK: keep order of columns to allow for reading with TGraph directly from file: X Y EX EY
47#
48# internal
49# --------
50# time: time, delta time, start, stop, ontime
51# flux: excrate, excerr, CU, CUerr, flux, fluxerr corrate, corerr, CUcor CUcorerr, fluxcor, fluxcorerr,
52# other info on flux: signif, cu-factor, num exc, num sig, num bg
53# other info: zd th R750cor R750ref
54#
55# external (allow only 20min and nightly binning)
56# --------
57# time: time, delta time, start, stop
58# flux: excrate, excerr
59#
60# collaborators
61# -------------
62# time: time, delta time, start, stop, ontime
63# flux: excrate, excerr, corrate, corerr, CUcor CUcorerr, fluxcor, fluxcorrerr, significance
64#
65# additional information to put:
66# ------------------------------
67# timestamp of creation
68# query (for debugging / answering questions)
69# policy (adapted for internal/collaborators/external) [define in files to be used also by Send_Data*.sh
70#
71
72
73function print_policy()
74{
75 echo "#"
76 echo "# Data Usage Policy: "
77 if [ "$expert" == "no" ]
78 then
79 echo "# Using data from the FACT Quick Look Analysis, you agree to cite the FACT design"
80 echo "# paper (H. Anderhub et al. JINST 8 P6008) and the quick look analysis website "
81 echo "# (https://fact-project.org/monitoring)."
82 echo "#"
83 echo "# References: "
84 echo "# FACT design paper: http://adsabs.harvard.edu/abs/2013JInst...8P6008A"
85 echo "# http://iopscience.iop.org/1748-0221/8/06/P06008 "
86 echo "# FACT Performance Paper: http://adsabs.harvard.edu/abs/2014JInst...9P0012B"
87 echo "# http://iopscience.iop.org/1748-0221/9/10/P10012"
88 echo "# FACT quick look analysis: https://fact-project.org/monitoring"
89 echo "# http://adsabs.harvard.edu/abs/2015arXiv150202582D"
90 echo "# If you intend to use data or information from this website, please let us know for reference."
91 else
92 echo "# As a member, associated member or collaborator of the FACT Collaboration, you have access to internal information."
93 echo "# Any publication using FACT internal information has to have the full FACT author list."
94 fi
95 echo "#"
96}
97
98print_selection()
99{
100 echo "#"
101 echo "# Your Selection: "
102 sourcename=`mysql --defaults-file=$sqlpw -s -e "SELECT fSourceName FROM Source WHERE fSourceKey="$source`
103 echo "# Source: "$sourcename
104 echo "# Time range: "$nightmin"-"$nightmax
105 echo "# Time format: "$timeunit
106 if [ $bin -lt 0 ]
107 then
108 unit="night(s)"
109 else
110 if [ $bin -eq 0 ]
111 then
112 unit="periods"
113 else
114 unit="minutes"
115 fi
116 fi
117 binning=`echo $bin | sed -e 's/-//'`" "$unit
118 echo "# Binning: "$binning
119 if [ "$expert" != "no" ]
120 then
121 echo "# Additional Internal Selection: "
122 echo "# "`echo $table | sed -e 's/AnalysisResultsRun//'`"-Analysis was used."
123 if [ "$zdmax" != "" ]
124 then
125 echo "# Maximum Zenith Distance: "$zdmax" degree"
126 fi
127 if [ "$thmax" != "" ]
128 then
129 echo "# Maximum Trigger Threshold: "$thmax" DAC counts"
130 fi
131 if [ "$light" != "" ]
132 then
133 echo "# Light Condition Cut: "$lightcut
134 fi
135 if [ "$dust" != "" ]
136 then
137 echo "# Calima Cut: dust < "$dust" ug/cm3"
138 fi
139 if [ "$factorcut" != "" ]
140 then
141 echo "# Factor Cut: zdfactor*thfactor > "$factorcut
142 fi
143 if [ "$usedch" == "yes" ]
144 then
145 echo "# Data quality selection was applied. "
146 if [ "$dch" == "" ]
147 then
148 echo "# Standard data check based on cosmic-ray rate: "$dchstd
149 else
150 echo "# You selected a custom datacheck: "$dch
151 fi
152 fi
153 fi
154 echo "#"
155}
156
157function get_results()
158{
159 # some query parts
160
161 # these values use the Crab spectrum from HESS 2006
162 # hess 2006 http://www.aanda.org/articles/aa/pdf/2006/39/aa5351-06.pdf
163 # PL.SetParameter(1,-2.63);
164 # PL.SetParameter(0, 3.45e-11);
165 case "$table" in
166 "AnalysisResultsRunISDC")
167 zdfactor="pow(cos(fZenithDistanceMean*PI()/180)*exp(1-cos(fZenithDistanceMean*PI()/180)),4.2)"
168 thfactor="(1.18-IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)*0.00062)"
169 # ETh: 1070 GeV
170 crabflux="1.89"
171 ;;
172 "AnalysisResultsRunCutsLC")
173 zdfactor="pow(cos(fZenithDistanceMean*PI()/180)*exp(1-cos(fZenithDistanceMean*PI()/180)),4.5)"
174 thfactor="(1.37-IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)*0.00118)"
175 # ETh: 785 GeV
176 crabflux="3.14"
177 ;;
178 "AnalysisResultsRunLP")
179 zdfactor="(pow(cos(fZenithDistanceMean*PI()/180),3)+14.8/21.9*pow(sin(2*fZenithDistanceMean*PI()/180),5))"
180 #zdfactor="(1/(pow(cos(fZenithDistanceMean*PI()/180),3)+14.8/21.9*pow(sin(2*fZenithDistanceMean*PI()/180),5)))"
181 thfactor="(1-0.00124/1.21*(fThresholdMinSet-500)*(fThresholdMinSet>=500))"
182 # ETh: 1100 GeV
183 crabflux="1.81"
184 ;;
185 "*")
186 zdfactor="0"
187 thfactor="0"
188 crabflux="0"
189 ;;
190 esac
191
192 # conversion from crab units to fluxes (if a different value is given in setup
193 if [ "$crabfluxconv" != "" ]
194 then
195 crabflux=$crabfluxconv #e-11
196 fi
197 #echo "crabflux: "$crabflux
198 fluxprec=2
199
200 # some names and definitions needed several times below
201 # ontime
202 ontime1=" TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn "
203 ontime2=" fOnTimeAfterCuts "
204 ontimeif=" IF(ISNULL(fEffectiveOn), "$ontime2", "$ontime1") "
205 # zd and threshold
206 zenith="fZenithDistance"
207 thresh="IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)"
208 # correction for zd- and th-dependence
209 correvts=" fNumExcEvts/"$zdfactor"/"$thfactor
210 # conversion to CU - stored in each result-table (determined by DD Feb 2019)
211 cufactor="fCU"
212 # some calculations
213 #excerr="ExcErr(SUM(fNumSigEvts), SUM(fNumBgEvts))"
214 excerr="ExcErr(fNumSigEvts, fNumBgEvts)"
215 CU="SUM(fNumExcEvts/"$cufactor")/SUM("$ontimeif")*3600"
216 #CUerr=$excerr"/SUM("$ontimeif")*3600*SUM(fNumExcEvts/"$cufactor")/SUM(fNumExcEvts)"
217 CUerr="SQRT(SUM(POW("$excerr"/"$cufactor",2)))/SUM("$ontimeif")*3600"
218 CUcor="SUM("$correvts"/"$cufactor")/SUM("$ontimeif")*3600"
219 #CUcorerr=$excerr"/SUM("$ontimeif")*3600*SUM("$correvts"/"$cufactor")/SUM(fNumExcEvts)"
220 CUcorerr="SQRT(SUM(POW("$excerr"/"$cufactor"/"$zdfactor"/"$thfactor",2)))/SUM("$ontimeif")*3600"
221 #excerr2="ExcErr(SUM(o.sigevts),SUM(o.bgevts))"
222 excerr2="ExcErr(o.sigevts,o.bgevts)"
223 CU2="SUM((o.sigevts-o.bgevts)/o.cufactor)/SUM(o.ot)*3600"
224 #CUerr2=$excerr2"/SUM(o.ot)*3600*SUM((o.sigevts-o.bgevts)/o.cufactor)/(SUM(o.sigevts)-SUM(o.bgevts))"
225 CUerr2="SQRT(SUM(POW("$excerr2"/o.cufactor,2)))/SUM(o.ot)*3600"
226 #CUcor2="SUM(o.corevts/o.cufactor)/SUM(o.ot)*3600"
227 CUcor2="SUM(o.excevts/o.zdfactor/o.thfactor/o.cufactor)/SUM(o.ot)*3600"
228 #CUcorerr2=$excerr2"/SUM(o.ot)*3600*SUM(o.corevts/o.cufactor)/(SUM(o.sigevts)-SUM(o.bgevts))"
229 CUcorerr2="SQRT(SUM(POW("$excerr2"/o.cufactor/o.zdfactor/o.thfactor,2)))/SUM(o.ot)*3600"
230
231 #"ROUND(SQRT(SUM(POW(ExcErr(fNumSigEvts, fNumBgEvts)/pow(cos(fZenithDistanceMean*PI()/180)*exp(1-cos(fZenithDistanceMean*PI()/180)),4.5)/(1.37-IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)*0.00118), 2)))/SUM( IF(ISNULL(fEffectiveOn), fOnTimeAfterCuts , TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn ) )*3600, 1)"
232
233 # columns to be selected
234 # for night-binning
235 ontime=" ROUND(SUM("$ontimeif")/60., 1) AS ontime"
236 excrate=" ROUND(SUM(fNumExcEvts)/SUM("$ontimeif")*3600, 1) AS excrate"
237 significance="ROUND(LiMa(Sum(fNumSigEvts), SUM(fNumBgEvts)), 1) AS significance"
238 numexc="SUM(fNumExcEvts) AS numexc"
239 numsig="SUM(fNumSigEvts) AS numsig"
240 numbg="SUM(fNumBgEvts) AS numbg"
241 #excrateerr=" ROUND("$excerr"/SUM("$ontimeif")*3600, 1) AS excrateerr"
242 excrateerr=" ROUND(ExcErr(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM("$ontimeif")*3600, 1) AS excrateerr"
243 correxcrate=" ROUND(SUM("$correvts")/SUM("$ontimeif")*3600, 1) AS correxcrate"
244 #correxcrateerr=" ROUND("$excerr"/SUM("$ontimeif")*3600*SUM("$correvts")/SUM(fNumExcEvts), 1) AS correxcrateerr"
245 correxcrateerr=" ROUND(SQRT(SUM(POW("$excerr"/"$zdfactor"/"$thfactor", 2)))/SUM("$ontimeif")*3600, 1) AS correxcrateerr"
246 cu=" ROUND("$CU", 2) AS cu"
247 cuerr=" ROUND("$CUerr", 2) AS cuerr"
248 cucor=" ROUND("$CUcor", 2) AS cucor"
249 cucorerr=" ROUND("$CUcorerr", 2) AS 'cucorerr'"
250 flux="ROUND("$CU" * "$crabflux", 2) AS flux"
251 fluxerr="ROUND("$CUerr" * "$crabflux", 2) AS fluxerr"
252 fluxcor="ROUND("$CUcor" * "$crabflux", 2) AS fluxcor"
253 fluxcorerr="ROUND("$CUcorerr" * "$crabflux", 2) AS fluxcorerr"
254 # for minute binning
255 ontime2=" ROUND(SUM(o.ot)/60., 1) AS ontime"
256 #excrate2=" ROUND((SUM(o.sigevts)-SUM(o.bgevts))/SUM(o.ot)*3600, 1) AS excrate"
257 excrate2=" ROUND((SUM(o.excevts))/SUM(o.ot)*3600, 1) AS excrate"
258 significance2=" ROUND(LiMa(SUM(o.sigevts),SUM(o.bgevts)), 1) AS significance"
259 #numexc2="Sum(o.sigevts-o.bgevts) AS numexc"
260 numexc2="SUM(o.excevts) AS numexc"
261 numsig2="SUM(o.sigevts) AS numsig"
262 numbg2="SUM(o.bgevts) AS numbg"
263 excrateerr2=" ROUND(ExcErr(SUM(o.sigevts),SUM(o.bgevts))/SUM(o.ot)*3600, 1) AS excrateerr"
264 correxcrate2=" ROUND(SUM(o.excevts/o.zdfactor/o.thfactor)/SUM(o.ot)*3600, 1) AS correxcrate"
265 #correxcrateerr2=" ROUND("$excerr2"/SUM(o.ot)*3600*SUM(o.corevts)/(SUM(o.sigevts)-SUM(o.bgevts)), 1) AS correxcrateerr"
266 correxcrateerr2=" ROUND(SQRT(SUM(POW("$excerr2"/o.zdfactor/o.thfactor,2)))/SUM(o.ot)*3600,1) AS correxcrateerr"
267 cu2=" ROUND("$CU2", 2) AS cu"
268 cuerr2=" ROUND("$CUerr2", 2) AS cuerr"
269 cucor2=" ROUND("$CUcor2", 2) AS cucor"
270 cucorerr2=" ROUND("$CUcorerr2", 2) AS 'cucorerr'"
271 flux2="ROUND("$CU2" * "$crabflux", "$fluxprec") AS flux"
272 fluxerr2="ROUND("$CUerr2" *"$crabflux", "$fluxprec") AS fluxerr"
273 fluxcor2="ROUND("$CUcor2" * "$crabflux", "$fluxprec") AS fluxcor"
274 fluxcorerr2="ROUND("$CUcorerr2" *"$crabflux", "$fluxprec") AS fluxcorerr"
275
276 case $timeunit in
277 mjd) delta="(Mjd(MAX(fRunStop))-Mjd(MIN(fRunStart)))/2"
278 start=" Mjd(MIN(fRunStart)) AS start"
279 stop=" Mjd(MAX(fRunStop)) AS stop"
280 deltat=$delta" AS deltat"
281 time=" Mjd(MIN(fRunStart))+"$delta" AS time"
282 delta2="(Mjd(MAX(o.stop))-Mjd(MIN(o.start)))/2"
283 start2=" Mjd(MIN(o.start)) AS start"
284 stop2=" Mjd(MAX(o.stop)) AS stop"
285 deltat2=$delta2" AS deltat"
286 time2=" Mjd(MIN(o.start))+"$delta2" AS time"
287 ;;
288 unix) delta="(Unix_timestamp(CONVERT_TZ(MAX(fRunStop), '+00:00', 'SYSTEM')) - Unix_timestamp(CONVERT_TZ(MIN(fRunStart), '+00:00', 'SYSTEM')))/2"
289 start="Unix_timestamp(CONVERT_TZ(MIN(fRunStart), '+00:00', 'SYSTEM')) AS start"
290 stop="Unix_timestamp(CONVERT_TZ(MAX(fRunStop), '+00:00', 'SYSTEM')) AS stop"
291 deltat=$delta" AS deltat"
292 time=" Unix_timestamp(CONVERT_TZ(MIN(fRunStart), '+00:00', 'SYSTEM'))+"$delta" AS time"
293 delta2="(Unix_timestamp(CONVERT_TZ(MAX(o.stop), '+00:00', 'SYSTEM')) - Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM')))/2"
294 start2=" Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM')) AS start"
295 stop2=" Unix_timestamp(CONVERT_TZ(MAX(o.stop), '+00:00', 'SYSTEM')) AS stop"
296 deltat2=$delta2" AS deltat"
297 time2=" Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM'))+"$delta2" AS time"
298 ;;
299 *) delta="sec_to_time(time_to_sec(timediff(MAX(fRunStop), MIN(fRunStart)))/2)"
300 start=" MIN(fRunStart) AS start"
301 stop=" MAX(fRunStop) AS stop"
302 deltat=$delta" AS deltat"
303 time=" addtime(MIN(fRunStart), "$delta") AS time"
304 delta2="sec_to_time(time_to_sec(timediff(MAX(o.stop), MIN(o.start)))/2)"
305 start2=" MIN(o.start) AS start"
306 stop2=" MAX(o.stop) AS stop"
307 deltat2=$delta2" AS deltat"
308 time2=" addtime(MIN(o.start), "$delta2") AS time"
309 ;;
310 esac
311
312 # from and join of query
313 from=" FROM RunInfo LEFT JOIN "$table" USING (fNight, fRunID) "
314
315 # data check based on artificial trigger rate
316 # details see https://www.fact-project.org/logbook/showthread.php?tid=5790
317 #dch=" AND fR750Cor/fR750Ref >0.93 "
318 dchstd=" AND fR750Cor/fR750Ref BETWEEN 0.93 AND 1.3 "
319
320 # put together where-clause of query
321 # time range and source
322 where=" WHERE fSourceKey="$source" AND fNight BETWEEN "$nightmin" AND "$nightmax
323 where=$where" AND NOT ISNULL(fNumExcEvts) "
324 # some sanity checks
325 where=$where" AND fRunTypeKey=1 "
326 # remove empty rows
327 if [ "$rmemptyrows" == "yes" ]
328 then
329 where=$where" AND NOT ISNULL(fZenithDistanceMean) AND (NOT ISNULL(fThresholdMinSet) OR NOT ISNULL(fThresholdMedian)) AND NOT ISNULL(fCU) "
330 fi
331 # zd cut
332 if [ "$zdmax" != "" ]
333 then
334 where=$where" AND fZenithDistanceMax < "$zdmax
335 fi
336 # th cut
337 if [ "$thmax" != "" ]
338 then
339 where=$where" AND "$thresh" < "$thmax
340 fi
341 # dust cut
342 if [ "$dust" != "" ]
343 then
344 where=$where" AND fTNGDust<"$dust
345 fi
346 # light condition cut
347 if [ "$light" == "nomoon" ]
348 then
349 lightcut=" fZenithDistanceMoon>90"
350 fi
351 if [ "$light" == "dark" ]
352 then
353 lightcut=" fMoonZenithDistance>90 AND fSunZenithDistance>108 "
354 fi
355 if [ "$light" != "" ]
356 then
357 where=$where" AND "$lightcut
358 fi
359# if [ "$factorcut" != "" ]
360# then
361# where=$where" AND ( ("$zdfactor") * ("$thfactor")) > "$factorcut" "
362# fi
363 querybase=$from$where
364
365 if [ "$usedch" == "yes" ]
366 then
367 if [ "$dch" == "" ]
368 then
369 querydch=$dchstd
370 else
371 echo "you are using for datacheck: "$dch
372 querydch=$dch
373 fi
374 else
375 querydch=
376 fi
377
378
379 if [ $bin -le 0 ]
380 then
381 # first part of the query
382 querystart="SELECT "
383 querystart=$querystart" "$time", "$start", "$stop", "
384 # final part of the query
385 if [ $bin -eq 0 ]
386 then
387 orderby=" ORDER BY fPeriod "
388 #querystart=$querystart" fPeriod AS num, "
389 queryend=" GROUP BY fPeriod "
390 else
391 num=" FLOOR((Mjd(fRunStart)-Mjd("$nightmin")-0.5)/"`echo $bin | sed -e 's/-//'`".) "
392 orderby=" ORDER BY "$num
393 #querystart=$querystart" FLOOR((Mjd(fRunStart)-Mjd("$nightmin")-0.5)/"`echo $bin | sed -e 's/-//'`".) AS num, "
394 queryend=" GROUP BY "$num
395 fi
396 #queryend=" GROUP BY num "
397 if [ "$ontimelimit" = "" ]
398 then
399 queryend=$queryend" HAVING SUM("$ontimeif")>1200 "
400 else
401 queryend=$queryend" HAVING SUM("$ontimeif")>"$ontimelimit
402 fi
403# if [ "$ontimelimit" = "" ]
404# then
405# queryend=$queryend" HAVING abs(cucorerr) < 1 AND SUM("$ontimeif")>1200 ORDER BY "$orderby
406# else
407# queryend=$queryend" HAVING abs(cucorerr) < 1 AND SUM("$ontimeif")>"$ontimelimit" ORDER BY "$orderby
408# fi
409
410 # internal
411 queryint=$querystart
412 queryint=$queryint" "$excrate", "$cu", "$flux", "$correxcrate", "$cucor", "$fluxcor", "
413 queryint=$queryint" "$deltat", "$ontime", "
414 queryint=$queryint" "$excrateerr", "$cuerr", "$fluxerr", "$correxcrateerr", "$cucorerr", "$fluxcorerr", "
415 queryint=$queryint" "$significance", "
416 queryint=$queryint" MIN(fNight) AS nightmin, MAX(fNight) AS nightmax, "
417 queryint=$queryint" "$numexc", "$numsig", "$numbg", "
418 queryint=$queryint" MIN("$zenith"Min) AS zdmin, MAX("$zenith"Max) AS zdmax, "
419 queryint=$queryint" MIN("$thresh") AS thmin, MAX("$thresh") AS thmax, "
420 queryint=$queryint" ROUND(AVG("$cufactor"), 1) AS cufactor, ROUND(AVG("$zdfactor"), 1) AS zdfactor, ROUND(AVG("$thfactor"), 1) AS thfactor, "
421 queryint=$queryint" ROUND(AVG(fR750Cor), 2) AS R750cor, ROUND(AVG(fR750Ref), 2) AS R750ref "
422 if [ "$factorcut" == "" ]
423 then
424 queryint=$queryint" "$querybase" "$querydch" "$queryend" "$orderby
425 else
426# queryint=$queryint" "$querybase" "$querydch" "$queryend" "$orderby
427 queryint=$queryint" "$querybase" "$querydch" "$queryend" AND ( zdfactor * thfactor > "$factorcut") "$orderby
428 fi
429
430 # for collaborators
431 querycol=$querystart
432 querycol=$querycol" "$excrate", "$correxcrate", "$cucor", "$fluxcor", "
433 querycol=$querycol" "$deltat", "$ontime", "
434 querycol=$querycol" "$excrateerr", "$correxcrateerr", "$cucorerr", "$fluxcorerr", "
435 querycol=$querycol" "$significance
436 if [ "$factorcut" == "" ]
437 then
438 querycol=$querycol" "$querybase" "$querydch" "$queryend" "$orderby
439 else
440# querycol=$querycol" "$querybase" "$querydch" "$queryend" "$orderby
441 querycol=$querycol" "$querybase" "$querydch" "$queryend" AND (AVG("$zdfactor") * AVG("$thfactor") > "$factorcut") "$orderby
442 fi
443
444 # external
445 # no datacheck applied for external files
446 # no cut on factors
447 queryext=$querystart" "$excrate", "$deltat", "$excrateerr" "$querybase" "$queryend" "$orderby
448
449 else
450 # first part of the query
451 querystart="SELECT "
452 querystart=$querystart" "$time2", "$start2", "$stop2", "
453
454 # final part of the query
455 querybase=" FROM (SELECT fNight, fZenithDistanceMin AS zdmin, fZenithDistanceMax AS zdmax, "$thresh" AS th, "
456 querybase=$querybase" fR750Cor AS R750cor, fR750Ref AS R750ref, "$cufactor" AS cufactor, "
457 querybase=$querybase" "$zdfactor" AS zdfactor, "$thfactor" AS thfactor, "
458 querybase=$querybase" @ot:="$ontimeif" AS ot, fRunStart AS start, fRunStop AS stop, "
459 #querybase=$querybase" fNumSigEvts AS sigevts, fNumBgEvts AS bgevts, "$correvts" AS corevts, "
460 querybase=$querybase" fNumSigEvts AS sigevts, fNumBgEvts AS bgevts, fNumExcEvts AS excevts, "
461 querybase=$querybase" IF (@night=fNight AND FLOOR((@os+@ot)/"$bin"./60.)<1, @bl, @bl := @bl + 1) AS block, "
462 querybase=$querybase" IF (@night=fNight AND FLOOR((@os+@ot)/"$bin"./60.)<1, @os:=@os + @ot, @os := @ot) AS os, @night :=fNight AS night "
463 querybase=$querybase$from" CROSS JOIN (SELECT @night :=0, @ot :=0, @os :=0, @bl:=0) PARAMS "
464 querybase=$querybase$where" ORDER BY fRunStart) o GROUP BY block HAVING ontime>0.75*"$bin" ORDER BY 'time'"
465
466 # internal
467 queryint=$querystart
468 queryint=$queryint" "$excrate2", "$cu2", "$flux2", "$correxcrate2", "$cucor2", "$fluxcor2", "
469 queryint=$queryint" "$deltat2", "$ontime2", "
470 queryint=$queryint" "$excrateerr2", "$cuerr2", "$fluxerr2", "$correxcrateerr2", "$cucorerr2", "$fluxcorerr2", "
471 queryint=$queryint" "$significance2", "
472 #queryint=$queryint" avg(o.night) AS night, "
473 queryint=$queryint" min(o.night) AS nightmin, max(o.night) AS nightmax, "
474 queryint=$queryint" "$numexc2", "$numsig2", "$numbg2", "
475 queryint=$queryint" MIN(o.zdmin) AS zdmin, MAX(o.zdmax) AS zdmax, MIN(o.th) AS thmin, MAX(o.th) AS thmax, "
476 queryint=$queryint" ROUND(AVG(o.cufactor), 1) AS cufactor, ROUND(AVG(o.R750cor), 2) AS R750cor, ROUND(AVG(o.R750ref), 2) AS R750ref "
477 queryint=$queryint" "$querybase
478
479 # for collaborators
480 querycol=$querystart
481 querycol=$querycol" "$excrate2", "$correxcrate2", "$cu2", "$fluxcor2", "
482 querycol=$querycol" "$deltat2", "$ontime2", "
483 querycol=$querycol" "$excrateerr2", "$correxcrateerr2", "$cuerr2", "$fluxcorerr2", "
484 querycol=$querycol" "$significance2
485 querycol=$querycol" "$querybase
486
487 # external
488 queryext=$querystart" "$excrate2", "$deltat2", "$ontime2", "$excrateerr2" "$querybase
489
490 fi
491
492 # write file for externals only for allowed binnings
493 if [ $bin -eq 20 ] || [ $bin -eq -1 ]
494 then
495 fileext=$datapath"/FACT_preliminary_"$name"_external.dat"
496 if [ "$overwrite" = "yes" ]
497 then
498 if [ "$mode" != "auto" ]
499 then
500 echo "creating "$fileext" ..."
501 fi
502 echo "# This file was created at "`date` > $fileext
503 print_policy >> $fileext
504 fi
505 print_selection >> $fileext
506 headerext="# time["$timeunit"] start["$timeunit"] stop["$timeunit"] excess-rate[evts/h] (stop-start)/2["$timeunit"] excess-rate_error[evts/h] "
507 echo $headerext >> $fileext
508 #echo "$queryext"
509 mysql --defaults-file=$sqlpw -s -e "$queryext" >> $fileext
510 #mysql --defaults-file=$sqlpw -e "$queryext"
511 fi
512 if [ "$mode" == "auto" ] && [ "$expert" == "no" ]
513 then
514 return
515 fi
516
517 fileint=$datapath"/FACT_preliminary_"$name"_internal.dat"
518 if [ "$overwrite" = "yes" ]
519 then
520 if [ "$mode" != "auto" ]
521 then
522 echo "creating "$fileint" ..."
523 fi
524 echo "# This file was created at "`date` > $fileint
525 print_policy >> $fileint
526 fi
527 print_selection >> $fileint
528 echo "# The following query was used: " >> $fileint
529 echo "# $queryint" >> $fileint
530 echo "#" >> $fileint
531 headerint="# time["$timeunit"] start["$timeunit"] stop["$timeunit"] excess-rate[evts/h] flux[CU] flux[e-11ph/cm2/s] corrected_excess-rate[evts/h] corrected_flux[CU] corrected_flux[e-11ph/cm2/s] (stop-start)/2["$timeunit"] ontime[min]"
532 headerint=$headerint" excess-rate_error[evts/h] flux_error[CU] flux_error[e-11ph/cm2/s] corrected_excess-rate_error[evts/h] corrected_flux_error[CU] corrected_flux_error[e-11/cm2/s] significance nightmin nightmax num_exc num_sig num_bg "
533 headerint=$headerint" zdmin zdmax thmin thmax avg(cufactor) avg(zdfactor) avg(thfactor) avg(R750cor) avg(R750ref) "
534 echo $headerint >> $fileint
535 #echo "$queryint"
536 mysql --defaults-file=$sqlpw -s -e "$queryint" >> $fileint
537 #mysql --defaults-file=$sqlpw -e "$queryint"
538 if [ "$mode" == "auto" ]
539 then
540 return
541 fi
542
543 filecol=$datapath"/FACT_preliminary_"$name"_collaborators.dat"
544 if [ "$overwrite" = "yes" ]
545 then
546 echo "creating "$filecol" ..."
547 echo "# This file was created at "`date` > $filecol
548 print_policy >> $filecol
549 fi
550 print_selection >> $filecol
551 #echo "# The following query was used: " >> $filecol
552 #echo "# $querycol" >> $filecol
553 #echo "#" >> $filecol
554 headercol="# time["$timeunit"] start["$timeunit"] stop["$timeunit"] excess-rate[evts/h] corrected_excess-rate[evts/h] corrected_flux[CU] corrected_flux[e-11ph/cm2/s] (stop-start)/2["$timeunit"] ontime[min]"
555 headercol=$headercol" excess-rate_error[evts/h] corrected_excess-rate_error[evts/h] corrected_flux_error[CU] corrected_flux_error[e-11ph/cm2/s] significance "
556 echo $headercol >> $filecol
557 #echo "$querycol"
558 mysql --defaults-file=$sqlpw -s -e "$querycol" >> $filecol
559 #mysql --defaults-file=$sqlpw -e "$querycol
560}
561
562# evaluation of command line options (for usage with download.php)
563
564if [ ${#@} -eq 15 ]
565then
566 #get_data.sh $start $stop $source $timebin $email $table $time $expert $dch $zd $th $light $dust $rmemptyrows $factorcut
567 mode="auto"
568 overwrite="yes"
569 # setup for usage with download.php
570 datapath="/home/factwww/dch/data"
571 #datapath="./data"
572 sqlpw=/home/fact/.mysql.pw
573 #sqlpw=/home/fact/.mysql.pw2
574 #host=10.0.100.21
575 #dbname=factdata
576 nightmin=$1
577 nightmax=$2
578 source=$3
579 bin=$4
580 if [ "$bin" == "00" ]
581 then
582 bin=0
583 fi
584 email=$5
585 table=$6
586 timeunit=$7
587 expert=$8
588 usedch=$9 # novalue gives same result as no
589 if [ "${10}" != "novalue" ] && [ "${10}" != "all" ]
590 then
591 zdmax=${10}
592 fi
593 if [ "${11}" != "novalue" ] && [ "${11}" != "all" ]
594 then
595 thmax=${11}
596 fi
597 if [ "${12}" != "novalue" ] && [ "${12}" != "all" ]
598 then
599 light=${12}
600 fi
601 if [ "${13}" != "novalue" ] && [ "${13}" != "all" ]
602 then
603 dust=${13}
604 fi
605 rmemptyrows=${14}
606 if [ "${15}" != "novalue" ] && [ "${15}" != "all" ]
607 then
608 factorcut=${15}
609 fi
610 name=`echo $email | sed -e 's/@/-at-/'`
611 get_results
612
613 # sending email
614 if [ "$expert" == "yes" ]
615 then
616 cat $fileint | mail -s 'FACT internal data download' -b qla@fact-project.org -r qla@fact-project.org $email
617 else
618 cat $fileext | mail -s 'FACT data download' -b qla@fact-project.org -r qla@fact-project.org $email
619 fi
620
621 exit
622fi
623
624
625
626# -------------------------------------------------------------------------------------- #
627# SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP #
628# -------------------------------------------------------------------------------------- #
629# #
630# The lines below define the basic setup for the database and give examples and #
631# explanations for the various options available. #
632# The request of the data itself is done with a smaller setup further down. #
633# #
634# -------------------------------------------------------------------------------------- #
635#
636# ----------
637# DB SETUP
638# ----------
639# path to file with mysql setup (user, password, host, db-name)
640sqlpw=/home/$USER/.mysql.pw.local
641sqlpw=/home/$USER/.mysql.pw.ethz.fact
642#
643# -------------
644# BASIC SETUP
645# -------------
646# output path
647path=`dirname $0`
648datapath=$path"/data"
649# create directory for data files
650if ! [ -e $datapath ]
651then
652 mkdir $datapath
653fi
654# time unit
655#timeunit=timestamp # default
656#timeunit=unix
657timeunit=mjd
658# time binning
659# positive values: minutes
660# negative values: days
661# special case 0: period
662# for season binning choose -365 and according start date
663#bin=20 # minutes
664#bin=0 # period
665bin=-1 # nightly
666#bin=-365 # yearly
667# choose analysis
668#table="AnalysisResultsAllQLA" # N/A
669#table="AnalysisResultsRunLP" # QLA
670#table="AnalysisResultsRunISDC" # ISDC
671table="AnalysisResultsRunCutsLC" # CutsLC
672# time range
673nightmin=20111115
674nightmax=20201231
675# overwrite dataset file?
676# (useful to combine different binnings in one file -> set to "no")
677overwrite="yes"
678# optional: require minimal ontime per bin (default 20 min)
679#ontimelimit=30 # 30 min
680ontimelimit= # default 20 min
681# data quality selection
682# if you explicitely don't want a datacheck, you can comment the following line
683usedch="yes"
684# use your own datacheck instead
685# use a line like the following defining your own data quality selection cut
686#dch=" AND fR750Cor/fR750Ref BETWEEN 0.93 AND 1.3 "
687# apply additional predefined cuts
688# light conditions
689#light="nomoon" # only data with no moon (but twilight allowed)
690#light="dark" # only dark night data
691# TNG dust - cut away data with calima
692#dust=1
693#dust=10
694# use different conversion from CU to fluxes
695#crabfluxconv="2.5"
696# remove lines which contain NULL (e.g. zd-corrected flux when zd=NULL)
697rmemptyrows="yes"
698# remove lines with zdfactor * thfactor > value
699factorcut=0.3
700
701
702# -------------------------------------------------------------------------------------- #
703# SETUP - GET YOUR DATA HERE - SETUP - GET YOUR DATA HERE - SETUP - GET YOUR DATA HERE #
704# -------------------------------------------------------------------------------------- #
705# #
706# Adapt the lines below to your needs. #
707# Overwrite default settings above. #
708# The data-request is sent with the line 'get_results'. #
709# Minumum setup: Define source key and name for file. #
710# The list of source keys can be found at #
711# https://fact-project.org/run_db/db/printtable.php?fTable=Source&fSortBy=fSourceKEY+ #
712# More examples can be found further down. #
713# #
714# -------------------------------------------------------------------------------------- #
715
716
717datapath=/home/dorner/FACT.analysis/corrected.lcs.for.collaborators/lcs
718
719# put your data request here, examples below
720
721# LCs for 421 campaign with Astrosat Jan 2019
722table="AnalysisResultsRunLP"
723# Mrk 421
724source=1
725# nightly
726bin=-1
727nightmin=20190109
728nightmax=20190113
729name="QLA_Mrk421_nightly_Astrosat-Jan-2019"
730get_results
731# 20min
732bin=20
733name="QLA_Mrk421_20min_Astrosat-Jan-2019"
734get_results
735# 30min
736bin=30
737name="QLA_Mrk421_30min_Astrosat-Jan-2019"
738get_results
739# 40min
740bin=40
741name="QLA_Mrk421_40min_Astrosat-Jan-2019"
742get_results
743# 60min
744bin=60
745name="QLA_Mrk421_60min_Astrosat-Jan-2019"
746get_results
747# 80min
748bin=80
749name="QLA_Mrk421_80min_Astrosat-Jan-2019"
750get_results
751# 90min
752bin=90
753name="QLA_Mrk421_90min_Astrosat-Jan-2019"
754get_results
755
756
757
758
759exit
760
761# LCs for SED project 2013
762table="AnalysisResultsRunCutsLC" # CutsLC
763# Mrk 421
764source=1
765# nightly
766bin=-1
767nightmin=20120901
768nightmax=20130516
769name="Mrk421_nightly_SED-project-2013"
770get_results
771
772
773
774# LCs for XMM proposal
775table="AnalysisResultsRunCutsLC" # CutsLC
776# Mrk 421
777source=1
778# nightly
779bin=-1
780nightmin=20111115
781nightmax=20201231
782name="Mrk421_nightly_XMM-proposal-2019"
783get_results
784# Mrk 501
785source=2
786name="Mrk501_nightly_XMM-proposal-2019"
787get_results
788# 1959
789source=7
790name="1959_nightly_XMM-proposal-2019"
791get_results
792
793
794
795# LCs for 421 campaign with Astrosat Jan 2019
796table="AnalysisResultsRunCutsLC" # CutsLC
797# Mrk 421
798source=1
799# nightly
800bin=-1
801nightmin=20190109
802nightmax=20190113
803name="Mrk421_nightly_Astrosat-Jan-2019"
804get_results
805# 20min
806bin=20
807name="Mrk421_20min_Astrosat-Jan-2019"
808get_results
809# 30min
810bin=30
811name="Mrk421_30min_Astrosat-Jan-2019"
812get_results
813# 40min
814bin=40
815name="Mrk421_40min_Astrosat-Jan-2019"
816get_results
817# 60min
818bin=60
819name="Mrk421_60min_Astrosat-Jan-2019"
820get_results
821# 80min
822bin=80
823name="Mrk421_80min_Astrosat-Jan-2019"
824get_results
825# 90min
826bin=90
827name="Mrk421_90min_Astrosat-Jan-2019"
828get_results
829
830
831
832# LCs for flaring pattern project
833table="AnalysisResultsRunCutsLC" # CutsLC
834# Mrk 421
835source=1
836# nightly
837bin=-1
838nightmin=20111115
839nightmax=20201231
840name="Mrk421_nightly_Flaring-pattern-project"
841get_results
842# 2d
843bin=-2
844nightmin=20111115
845nightmax=20201231
846name="Mrk421_2day_Flaring-pattern-project"
847get_results
848
849
850
851# LCs for ToO-Trigger project
852table="AnalysisResultsRunCutsLC" # CutsLC
853# Mrk 421
854source=1
855# nightly for 2019
856bin=-1
857nightmin=20190101
858nightmax=20190630
859name="Mrk421_nightly_20190101-20190630_ToO-project-2019"
860get_results
861# 20 min around flare
862bin=20
863nightmin=20190609
864nightmax=20190612
865name="Mrk421_20min_20190609-20190612_ToO-project-2019"
866get_results
867
868exit
869
870table="AnalysisResultsRunLP" # QLA
871# Mrk 421
872source=1
873# nightly for 2019
874bin=-1
875nightmin=20190101
876nightmax=20190630
877name="QLA_Mrk421_nightly_20190101-20190630_ToO-project-2019"
878get_results
879# 20 min around flare
880bin=20
881nightmin=20190609
882nightmax=20190612
883name="QLA_Mrk421_20min_20190609-20190612_ToO-project-2019"
884get_results
885
886
887table="AnalysisResultsRunISDC" # ISDC
888# Mrk 421
889source=1
890# nightly for 2019
891bin=-1
892nightmin=20190101
893nightmax=20190630
894name="ISDC_Mrk421_nightly_20190101-20190630_ToO-project-2019"
895get_results
896# 20 min around flare
897bin=20
898nightmin=20190609
899nightmax=20190612
900name="ISDC_Mrk421_20min_20190609-20190612_ToO-project-2019"
901get_results
902
903
904exit
905
906# LC for ICRC
907table="AnalysisResultsRunCutsLC" # CutsLC
908bin=-1
909# Mrk 421
910source=1
911name="Mrk421_all_nightly"
912get_results
913# Mrk 501
914source=2
915name="Mrk501_all_nightly"
916get_results
917# 1959
918source=7
919name="1959_all_nightly"
920get_results
921
922# 2344
923source=3
924name="2344_all_nightly"
925get_results
926
927# Crab
928source=5
929name="Crab_all_nightly"
930get_results
931
932
933exit
934
935# Mrk 501
936source=2
937zdmax=90
938thmax=1500
939# new analysis
940table="AnalysisResultsRunCutsLC" # CutsLC
941nightmin=20140520
942nightmax=20140930
943name="Mrk501_nightly_newAnalysis_forHESS"
944bin=-1
945get_results
946name="Mrk501_7d_newAnalysis_forHESS"
947bin=-7
948get_results
949nightmin=20140623
950nightmax=20140623
951name="Mrk501_5min_FlareNight_newAnalysis_forHESS"
952bin=5
953get_results
954nightmin=20140622
955nightmax=20140624
956name="Mrk501_5min_Flare_newAnalysis_forHESS"
957bin=5
958get_results
959
960exit
961
962# LC for INTEGRAL Proposal
963table="AnalysisResultsRunCutsLC" # CutsLC
964bin=-1
965# Mrk 421
966source=1
967name="Mrk421_all_nightly"
968get_results
969# Mrk 501
970source=2
971name="Mrk501_all_nightly"
972get_results
973# 1959
974source=7
975name="1959_all_nightly"
976get_results
977# for other INTEGRAL proposal
978# Mrk 421
979bin=0
980source=1
981name="Mrk421_all_period"
982get_results
983
984exit
985
986
987# Crab
988source=5
989nightmin=20121214
990nightmax=20180418
991table="AnalysisResultsRunCutsLC" # CutsLC
992bin=-1
993zdmax=30
994thmax=330
995name="testCrabnightlycheck"
996get_results
997
998exit
999
1000# Crab
1001source=5
1002nightmin=20121214
1003nightmax=20180418
1004table="AnalysisResultsRunCutsLC" # CutsLC
1005bin=20
1006name="testCrab20min"
1007get_results
1008
1009exit
1010
1011# Crab
1012source=5
1013nightmin=20121214
1014nightmax=20180418
1015table="AnalysisResultsRunCutsLC" # CutsLC
1016bin=-1
1017name="testCrabnightly"
1018get_results
1019
1020exit
1021
1022# Crab
1023source=5
1024#nightmin=20121214
1025#nightmax=20180418
1026table="AnalysisResultsRunCutsLC" # CutsLC
1027bin=-1
1028name="testCraball"
1029get_results
1030
1031exit
1032
1033
1034# Crab
1035source=5
1036nightmin=20121214
1037nightmax=20180418
1038table="AnalysisResultsRunCutsLC" # CutsLC
1039bin=60
1040name="testCrab"
1041get_results
1042
1043exit
1044
1045
1046# for 2344 paper with MAGIC
1047
1048source=3
1049zdmax=90
1050thmax=1500
1051
1052# new analysis
1053table="AnalysisResultsRunCutsLC" # CutsLC
1054nightmin=20160618
1055nightmax=20160815
1056name="2344_2016flare_newAnalysis"
1057bin=-7
1058get_results
1059overwrite="no"
1060bin=-28
1061nightmin=20160816
1062nightmax=20161031
1063get_results
1064overwrite="yes"
1065
1066# ISDC analysis
1067table="AnalysisResultsRunISDC"
1068nightmin=20160618
1069nightmax=20160815
1070name="2344_2016flare_stdAnalysis"
1071bin=-7
1072get_results
1073overwrite="no"
1074bin=-28
1075nightmin=20160816
1076nightmax=20161031
1077get_results
1078overwrite="yes"
1079
1080
1081usedch="no"
1082# new analysis
1083table="AnalysisResultsRunCutsLC" # CutsLC
1084nightmin=20160618
1085nightmax=20160815
1086name="2344_2016flare_newAnalysis_noDCh"
1087bin=-7
1088get_results
1089overwrite="no"
1090bin=-28
1091nightmin=20160816
1092nightmax=20161031
1093get_results
1094overwrite="yes"
1095
1096# ISDC analysis
1097table="AnalysisResultsRunISDC"
1098nightmin=20160618
1099nightmax=20160815
1100name="2344_2016flare_stdAnalysis_noDCh"
1101bin=-7
1102get_results
1103overwrite="no"
1104bin=-28
1105nightmin=20160816
1106nightmax=20161031
1107get_results
1108overwrite="yes"
1109
1110usedch="yes"
1111
1112
1113exit
1114
1115# Mrk 501
1116source=2
1117zdmax=90
1118thmax=1500
1119# new analysis
1120table="AnalysisResultsRunCutsLC" # CutsLC
1121nightmin=20140520
1122nightmax=20140930
1123name="Mrk501_nightly_newAnalysis_forHESS"
1124bin=-1
1125get_results
1126name="Mrk501_7d_newAnalysis_forHESS"
1127bin=-7
1128get_results
1129nightmin=20140623
1130nightmax=20140623
1131name="Mrk501_5min_FlareNight_newAnalysis_forHESS"
1132bin=5
1133get_results
1134# isdc analysis
1135thmax=850
1136table="AnalysisResultsRunISDC"
1137nightmin=20140520
1138nightmax=20140930
1139name="Mrk501_nightly_stdAnalysis_forHESS"
1140bin=-1
1141get_results
1142name="Mrk501_7d_stdAnalysis_forHESS"
1143bin=-7
1144get_results
1145nightmin=20140623
1146nightmax=20140623
1147name="Mrk501_5min_FlareNight_stdAnalysis_forHESS"
1148bin=5
1149get_results
1150# qla
1151thmax=500
1152table="AnalysisResultsRunLP"
1153nightmin=20140520
1154nightmax=20140930
1155name="Mrk501_nightly_QLA_forHESS"
1156bin=-1
1157get_results
1158
1159exit
1160
1161# 501 MAGIC
1162source=2
1163name="Mrk501_2014_forMAGIC"
1164bin=-1
1165crabfluxconv="2.87" # using threshold of 830GeV
1166crabfluxconv="3.01" # using threshold of 830GeV and MAGIC Crab spectrum
1167nightmin=20140714
1168nightmax=20140805
1169get_results
1170
1171name="Mrk501_2014_forMAGIC_20min"
1172bin=20
1173get_results
1174
1175
1176exit
1177
1178bin=30
1179name="Mrk501_2014_forMAGIC30"
1180get_results
1181
1182bin=0
1183name="P"
1184nightmin=20140501
1185nightmax=20140930
1186get_results
1187
1188bin=20
1189nightmin=20140623
1190nightmax=20140623
1191name="Mrk501_test"
1192get_results
1193
1194
1195# end script here
1196exit
1197
1198
1199
1200#
1201# more examples
1202#
1203
1204# Mrk 421
1205source=1
1206name="Mrk421_nightly"
1207bin=-1
1208get_results
1209name="Mrk421_20min"
1210bin=20
1211get_results
1212name="Mrk421_3d"
1213bin=-3
1214get_results
1215name="Mrk421_10d"
1216bin=-10
1217get_results
1218name="Mrk421_period"
1219bin=0
1220get_results
1221
1222
1223
1224# Mrk 501
1225source=2
1226name="Mrk501_nightly"
1227bin=-1
1228get_results
1229name="Mrk501_20min"
1230bin=20
1231get_results
1232name="Mrk501_3d"
1233bin=-3
1234get_results
1235name="Mrk501_10d"
1236bin=-10
1237get_results
1238name="Mrk501_period"
1239bin=0
1240get_results
1241
1242
1243
1244# 2344
1245source=3
1246name="2344_nightly"
1247bin=-1
1248get_results
1249name="2344_20min"
1250bin=20
1251get_results
1252name="2344_period"
1253bin=0
1254get_results
1255
1256
1257
1258# 1959
1259source=7
1260name="1959_nightly"
1261bin=-1
1262get_results
1263name="1959_20min"
1264bin=20
1265get_results
1266name="1959_period"
1267bin=0
1268get_results
1269
1270
1271
1272# 0323
1273source=12
1274name="0323_nightly"
1275bin=-1
1276get_results
1277name="0323_20min"
1278bin=20
1279get_results
1280name="0323_period"
1281bin=0
1282get_results
1283
1284
1285
1286# crab
1287source=5
1288name="Crab_nightly"
1289bin=-1
1290get_results
1291name="Crab_20min"
1292bin=20
1293get_results
1294name="Crab_period"
1295bin=0
1296get_results
1297name="Crab_season"
1298bin=-365
1299nightmin=20110716
1300nightmax=20180716
1301get_results
1302
1303
1304
1305name="1959_2016"
1306source=7
1307bin=-1
1308nightmin=20160201
1309nightmax=20161105
1310get_results
1311
1312name="1959_all_variable"
1313overwrite="no"
1314source=7
1315bin=-365
1316nightmin=20120201
1317nightmax=20130131
1318get_results
1319nightmin=20130201
1320nightmax=20140131
1321get_results
1322nightmin=20140201
1323nightmax=20150131
1324get_results
1325bin=0
1326nightmin=20150201
1327nightmax=20160131
1328get_results
1329bin=-1
1330nightmin=20160201
1331nightmax=20170131
1332get_results
1333bin=0
1334nightmin=20170201
1335nightmax=20180131
1336get_results
1337
1338
1339
1340overwrite="yes"
1341name="1959_all_variable2"
1342overwrite="no"
1343source=7
1344bin=-365
1345nightmin=20120201
1346nightmax=20130131
1347get_results
1348nightmin=20130201
1349nightmax=20140131
1350get_results
1351nightmin=20140201
1352nightmax=20150131
1353get_results
1354bin=0
1355nightmin=20150201
1356nightmax=20160131
1357get_results
1358bin=-1
1359nightmin=20160201
1360nightmax=20160817
1361get_results
1362bin=0
1363nightmin=20160818
1364nightmax=20180131
1365get_results
1366
1367
1368
1369overwrite="yes"
1370bin=0
1371source=3
1372name="2344period"
1373get_results
1374
1375
1376
1377# flare night (HESS)
1378name="Mrk501_10min_flarenight"
1379source=2
1380bin=10
1381nightmin=20140623
1382nightmax=20140623
1383get_results
1384
1385
1386
1387# flare night (HESS)
1388name="Mrk501_5min_flarenight"
1389source=2
1390bin=5
1391nightmin=20140623
1392nightmax=20140623
1393get_results
1394
1395
1396
1397
1398# full sample
1399name="Mrk421_all_nightly"
1400source=1
1401get_results
1402
1403name="Mrk501_all_nightly"
1404source=2
1405get_results
1406
1407name="1959_all_nightly"
1408source=7
1409get_results
1410
1411name="2344_all_nightly"
1412source=3
1413get_results
1414
1415
1416
1417name="HESE20160427"
1418source=19
1419nightmin=20160425
1420bin=-10
1421get_results
1422
1423name="AMON20160731"
1424source=21
1425nightmin=20160730
1426bin=-10
1427get_results
1428
1429
1430
Note: See TracBrowser for help on using the repository browser.