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

Last change on this file since 19042 was 19042, checked in by Daniela Dorner, 6 years ago
added all options needed for download.php
  • Property svn:executable set to *
File size: 24.1 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
34
35# ToDo (notes DD):
36# ----------------
37# must-have
38# - fix bug for timeunit=timestamp (min-binning)
39# - add policy
40# - add email sending and return values
41# - update function for zd/th-correction
42# - update CU for QLA
43# - add CU for ISDC analysis
44# - add < 20121212 data for QLA
45# - check crab flux
46# nice-to-have
47# - add E2dNdE
48# - functionality to determine start time for seaon-binning
49# - offer several predefined datachecks?
50
51#
52# content of files (wish list):
53# -----------------------------
54# REMARK: keep order of columns to allow for reading with TGraph directly from file: X Y EX EY
55#
56# internal
57# --------
58# time: time, delta time, start, stop, ontime
59# flux: excrate, excerr, corrate, corerr, CU CUerr, flux, fluxerr,
60# other info on flux: signif, cu-factor, num exc, num sig, num bg
61# other info: zd th R750cor R750ref
62#
63# external (allow only 20min and nightly binning)
64# --------
65# time: time, delta time, start, stop
66# flux: excrate, excerr
67#
68# collaborators
69# -------------
70# time: time, delta time, start, stop, ontime
71# flux: excrate, excerr, corrate, corerr, flux, flux-err, significance
72#
73# additional information to put:
74# ------------------------------
75# timestamp of creation
76# query (for debugging / answering questions)
77# policy (adapted for internal/collaborators/external) [define in files to be used also by Send_Data*.sh
78#
79
80
81
82function get_results()
83{
84 # some query parts
85
86 # some numbers for flux calculation
87 crabflux="3.37e-11"
88 fluxprec=13
89 crabflux="3.37"
90 fluxprec=2
91
92 # some names and definitions needed several times below
93 # ontime
94 ontime1=" TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn "
95 ontime2=" fOnTimeAfterCuts "
96 ontimeif=" IF(ISNULL(fEffectiveOn), "$ontime2", "$ontime1") "
97 # zd and threshold
98 zenith="fZenithDistance"
99 thresh="IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)"
100 # correction factor for excess rate (formula by TB)
101 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))) "
102 # conversion to CU (determined by DD for QLA)
103 # https://www.fact-project.org/logbook/showthread.php?tid=4927
104 cufactor="CUQLA(fNight)" # missing: ISDC analysis
105 # some calculations
106 excerr="ExcErr(Sum(fNumSigEvts), SUM(fNumBgEvts))"
107 CU="SUM("$correvts"/"$cufactor")/SUM("$ontimeif")*3600"
108 CUerr=$excerr"/SUM("$ontimeif")*3600*SUM("$correvts"/"$cufactor")/SUM(fNumExcEvts)"
109 excerr2="ExcErr(SUM(o.sigevts),SUM(o.bgevts))"
110 CU2="SUM(o.corevts/o.cufactor)/SUM(o.ot)*3600"
111 CUerr2=$excerr2"/SUM(o.ot)*3600*SUM(o.corevts/o.cufactor)/(SUM(o.sigevts)-SUM(o.bgevts))"
112
113 # columns to be selected
114 # for night-binning
115 ontime=" ROUND(SUM("$ontimeif")/60., 1) AS ontime"
116 excrate=" ROUND(SUM(fNumExcEvts)/SUM("$ontimeif")*3600, 1) AS excrate"
117 significance="ROUND(LiMa(Sum(fNumSigEvts), SUM(fNumBgEvts)), 1) AS significance"
118 numexc="Sum(fNumExcEvts) AS numexc"
119 numsig="Sum(fNumSigEvts) AS numsig"
120 numbg="Sum(fNumBgEvts) AS numbg"
121 excrateerr=" ROUND("$excerr"/SUM("$ontimeif")*3600, 1) AS excrateerr"
122 correxcrate=" ROUND(SUM("$correvts")/SUM("$ontimeif")*3600, 1) AS correxcrate"
123 correxcrateerr=" ROUND("$excerr"/SUM("$ontimeif")*3600*SUM("$correvts")/SUM(fNumExcEvts), 1) AS correxcrateerr"
124 cu=" ROUND("$CU", 2) AS cu"
125 cuerr=" ROUND("$CUerr", 2) AS cuerr"
126 flux="ROUND("$CU" * "$crabflux", 2) AS flux"
127 fluxerr="ROUND("$CUerr" * "$crabflux", 2) AS fluxerr"
128 # for minute binning
129 ontime2=" ROUND(SUM(o.ot)/60., 1) AS ontime"
130 excrate2=" ROUND((SUM(o.sigevts)-SUM(o.bgevts))/SUM(o.ot)*3600, 1) AS excrate"
131 significance2=" ROUND(LiMa(SUM(o.sigevts),SUM(o.bgevts)), 1) AS significance"
132 numexc2="Sum(o.sigevts-o.bgevts) AS numexc"
133 numsig2="Sum(o.sigevts) AS numsig"
134 numbg2="Sum(o.bgevts) AS numbg"
135 excrateerr2=" ROUND("$excerr2"/SUM(o.ot)*3600, 1) AS excrateerr"
136 correxcrate2=" ROUND(SUM(o.corevts)/SUM(o.ot)*3600, 1) AS correxcrate"
137 correxcrateerr2=" ROUND("$excerr2"/SUM(o.ot)*3600*SUM(o.corevts)/(SUM(o.sigevts)-SUM(o.bgevts)), 1) AS correxcrateerr"
138 cu2=" ROUND("$CU2", 2) AS cu"
139 cuerr2=" ROUND("$CUerr2", 2) AS cuerr"
140 flux2="ROUND("$CU2" * "$crabflux", "$fluxprec") AS flux"
141 fluxerr2="ROUND("$CUerr2" *"$crabflux", "$fluxprec") AS fluxerr"
142
143 case $timeunit in
144 mjd) delta="(Mjd(MAX(fRunStop))-Mjd(MIN(fRunStart)))/2"
145 start=" Mjd(MIN(fRunStart)) AS start"
146 stop=" Mjd(MAX(fRunStop)) AS stop"
147 deltat=$delta" AS deltat"
148 time=" Mjd(MIN(fRunStart))+"$delta" AS time"
149 delta2="(Mjd(MAX(o.stop))-Mjd(MIN(o.start)))/2"
150 start2=" Mjd(MIN(o.start)) AS start"
151 stop2=" Mjd(MAX(o.stop)) AS stop"
152 deltat2=$delta2" AS deltat"
153 time2=" Mjd(MIN(o.start))+"$delta2" AS time"
154 ;;
155 unix) delta="(Unix_timestamp(CONVERT_TZ(MAX(fRunStop), '+00:00', 'SYSTEM')) - Unix_timestamp(CONVERT_TZ(MIN(fRunStart), '+00:00', 'SYSTEM')))/2"
156 start="Unix_timestamp(CONVERT_TZ(MIN(fRunStart), '+00:00', 'SYSTEM')) AS start"
157 stop="Unix_timestamp(CONVERT_TZ(MAX(fRunStop), '+00:00', 'SYSTEM')) AS stop"
158 deltat=$delta" AS deltat"
159 time=" Unix_timestamp(CONVERT_TZ(MIN(fRunStart), '+00:00', 'SYSTEM'))+"$delta" AS time"
160 delta2="(Unix_timestamp(CONVERT_TZ(MAX(o.stop), '+00:00', 'SYSTEM')) - Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM')))/2"
161 startstop2=" Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM')) AS start"
162 startstop2=$starstop2" Unix_timestamp(CONVERT_TZ(MAX(o.stop), '+00:00', 'SYSTEM')) AS stop"
163 deltat2=$delta2" AS deltat"
164 time2=" Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM'))+"$delta2" AS time"
165 ;;
166 *) delta="sec_to_time(time_to_sec(timediff(MAX(fRunStop), MIN(fRunStart)))/2)"
167 start=" MIN(fRunStart) AS start"
168 stop=" MAX(fRunStop) AS stop"
169 deltat=$delta" AS deltat"
170 time=" addtime(MIN(fRunStart), "$delta") AS time"
171 delta2="sec_to_time(time_to_sec(timediff(MAX(o.stop), MIN(o.start)))/2)"
172 start2=" MIN(o.start) AS start"
173 stop2=" MAX(o.stop) AS stop"
174 deltat2=$delta" AS deltat"
175 time2=" addtime(MIN(o.start), "$delta2") AS time"
176 ;;
177 esac
178
179 # from and join of query
180 from=" FROM RunInfo LEFT JOIN "$table" USING (fNight, fRunID) "
181
182 # data check based on artificial trigger rate
183 # details see https://www.fact-project.org/logbook/showthread.php?tid=5790
184 #dch=" AND fR750Cor/fR750Ref >0.93 "
185 dchstd=" AND fR750Cor/fR750Ref BETWEEN 0.93 AND 1.3 "
186
187 # put together where-clause of query
188 # time range and source
189 where=" WHERE fSourceKey="$source" AND fNight BETWEEN "$nightmin" AND "$nightmax
190 where=$where" AND NOT ISNULL(fNumExcEvts) "
191 # some sanity checks
192 where=$where" AND fRunTypeKey=1 "
193 # zd cut
194 if [ "$zdmax" != "" ]
195 then
196 where=$where" AND fZenithDistanceMax < "$zdmax
197 fi
198 # th cut
199 if [ "$thmax" != "" ]
200 then
201 where=$where" AND "$thresh" < "$thmax
202 fi
203 # dust cut
204 if [ "$dust" != "" ]
205 then
206 where=$where" AND fTNGDust<"$dust
207 fi
208 # light condition cut
209 if [ "$light" == "no moon" ]
210 then
211 where=$where" AND fZenithDistanceMoon>90"
212 fi
213 if [ "$light" == "dark" ]
214 then
215 where=$where" AND fMoonZenithDistance>90 AND fSunZenithDistance>108 "
216 fi
217 querybase=$from$where
218
219 if [ "$usedch" == "yes" ]
220 then
221 if [ "$dch" == "" ]
222 then
223 querydch=$dchstd
224 else
225 echo "you are using for datacheck: "$dch
226 querydch=$dch
227 fi
228 fi
229
230
231 if [ $bin -le 0 ]
232 then
233 num="#bin"
234 # first part of the query
235 querystart="SELECT "
236 if [ $bin -eq 0 ]
237 then
238 querystart=$querystart" fPeriod AS num, "
239 else
240 querystart=$querystart" FLOOR((Mjd(fRunStart)-Mjd("$nightmin")-0.5)/"`echo $bin | sed -e 's/-//'`".) AS num, "
241 fi
242 querystart=$querystart" "$time", "$start", "$stop", "
243
244 # final part of the query
245 queryend=" GROUP BY num "
246 if [ "$ontimelimit" = "" ]
247 then
248 queryend=$queryend" HAVING SUM("$ontimeif")>1200 ORDER BY num " # 20 min
249 else
250 queryend=$queryend" HAVING SUM("$ontimeif")>"$ontimelimit" ORDER BY num "
251 fi
252
253 # internal
254 queryint=$querystart
255 queryint=$queryint" "$excrate", "$correxcrate", "$cu", "$flux", "
256 queryint=$queryint" "$deltat", "$ontime", "
257 queryint=$queryint" "$excrateerr", "$correxcrateerr", "$cuerr", "$fluxerr", "
258 queryint=$queryint" "$significance", "
259 queryint=$queryint" MIN(fNight) AS nightmin, MAX(fNight) AS nightmax, "
260 queryint=$queryint" "$numexc", "$numsig", "$numbg", "
261 queryint=$queryint" MIN("$zenith"Min) AS zdmin, MAX("$zenith"Max) AS zdmax, "
262 queryint=$queryint" MIN("$thresh") AS thmin, MAX("$thresh") AS thmax, "
263 queryint=$queryint" ROUND(AVG("$cufactor"), 1) AS cufactor, ROUND(AVG(fR750Cor), 2) AS R750cor, ROUND(AVG(fR750Ref), 2) AS R750ref "
264 queryint=$queryint" "$querybase" "$querydch" "$queryend
265
266 # for collaborators
267 querycol=$querystart
268 querycol=$querycol" "$excrate", "$correxcrate", "$cu", "$flux", "
269 querycol=$querycol" "$deltat", "$ontime", "
270 querycol=$querycol" "$excrateerr", "$correxcrateerr", "$cuerr", "$fluxerr", "
271 querycol=$querycol" "$significance
272 querycol=$querycol" "$querybase" "$querydch" "$queryend
273
274 # external
275 # no datacheck applied for external files
276 queryext=$querystart" "$excrate", "$deltat", "$excrateerr" "$querybase" "$queryend
277
278 else
279 num=
280 # first part of the query
281 querystart="SELECT "
282 querystart=$querystart" "$time2", "$start2", "$stop2", "
283
284 # final part of the query
285 querybase=" FROM (SELECT fNight, fZenithDistanceMin AS zdmin, fZenithDistanceMax AS zdmax, "$thresh" AS th, "
286 querybase=$querybase" fR750Cor AS R750cor, fR750Ref AS R750ref, "$cufactor" AS cufactor, "
287 querybase=$querybase" @ot:="$ontimeif" AS ot, fRunStart AS start, fRunStop AS stop, "
288 querybase=$querybase" fNumSigEvts AS sigevts, fNumBgEvts AS bgevts, "$correvts" AS corevts, "
289 querybase=$querybase" IF (@night=fNight AND FLOOR((@os+@ot)/"$bin"./60.)<1, @bl, @bl := @bl + 1) AS block, "
290 querybase=$querybase" IF (@night=fNight AND FLOOR((@os+@ot)/"$bin"./60.)<1, @os:=@os + @ot, @os := @ot) AS os, @night :=fNight AS night "
291 querybase=$querybase$from" CROSS JOIN (SELECT @night :=0, @ot :=0, @os :=0, @bl:=0) PARAMS "
292 querybase=$querybase$where" ORDER BY fRunStart) o GROUP BY block HAVING ontime>0.75*"$bin" ORDER BY 'time'"
293
294 # internal
295 queryint=$querystart
296 queryint=$queryint" "$excrate2", "$correxcrate2", "$cu2", "$flux2", "
297 queryint=$queryint" "$deltat2", "$ontime2", "
298 queryint=$queryint" "$excrateerr2", "$correxcrateerr2", "$cuerr2", "$fluxerr2", "
299 queryint=$queryint" "$significance2", "
300 queryint=$queryint" avg(o.night) AS night, "
301 queryint=$queryint" "$numexc2", "$numsig2", "$numbg2", "
302 queryint=$queryint" MIN(o.zdmin) AS zdmin, MAX(o.zdmax) AS zdmax, MIN(o.th) AS thmin, MAX(o.th) AS thmax, "
303 queryint=$queryint" ROUND(AVG(o.cufactor), 1) AS cufactor, ROUND(AVG(o.R750cor), 2) AS R750cor, ROUND(AVG(o.R750ref), 2) AS R750ref "
304 queryint=$queryint" "$querybase
305
306 # for collaborators
307 querycol=$querystart
308 querycol=$querycol" "$excrate2", "$correxcrate2", "$cu2", "$flux2", "
309 querycol=$querycol" "$deltat2", "$ontime2", "
310 querycol=$querycol" "$excrateerr2", "$correxcrateerr2", "$cuerr2", "$fluxerr2", "
311 querycol=$querycol" "$significance2
312 querycol=$querycol" "$querybase
313
314 # external
315 queryext=$querystart" "$excrate2", "$deltat2", "$ontime2", "$excrateerr2" "$querybase
316
317 fi
318
319 # write file for externals only for allowed binnings
320 if [ $bin -eq 20 ] || [ $bin -eq -1 ]
321 then
322 fileext=$datapath"/FACT_preliminary_"$name"_external.dat"
323 if [ "$overwrite" = "yes" ]
324 then
325 echo "creating "$fileext" ..."
326 echo "# This file was created at "`date` > $fileext
327 # add policy here
328 fi
329 headerext="# "$num" time["$timeunit"] start["$timeunit"] stop["$timeunit"] excrate[evts/h] delta_time["$timeunit"] excrate_err[evts/h] "
330 echo $headerext >> $fileext
331 #echo "$queryext"
332 mysql --defaults-file=$sqlpw -u factread --host=$host $dbname -s -e "$queryext" >> $fileext
333 #mysql --defaults-file=$sqlpw -u factread --host=$host $dbname -e "$queryext"
334 fi
335 if [ "$mode" == "auto" ] && [ "$expert" == "no" ]
336 then
337 return
338 fi
339
340 fileint=$datapath"/FACT_preliminary_"$name"_internal.dat"
341 if [ "$overwrite" = "yes" ]
342 then
343 echo "creating "$fileint" ..."
344 echo "# This file was created at "`date` > $fileint
345 echo "# The following query was used: " >> $fileint
346 echo "# "$queryint >> $fileint
347 # add policy here
348 fi
349 headerint="# "$num" time["$timeunit"] start["$timeunit"] stop["$timeunit"] excrate[evts/h] corr.excrate[evts/h] flux[CU] flux[e-11/cm2/s] delta_time["$timeunit"] ontime[min]"
350 headerint=$headerint" excrate_err[evts/h] corr.excrate_err[evts/h] flux_err[CU] flux_err[e-11/cm2/s] significance night num_exc num_sig num_bg "
351 headerint=$headerint" zdmin zdmax thmin thmax avg(cufactor) avg(R750cor) avg(R750ref) "
352 echo $headerint >> $fileint
353 #echo "$queryint"
354 mysql --defaults-file=$sqlpw -u factread --host=$host $dbname -s -e "$queryint" >> $fileint
355 #mysql --defaults-file=$sqlpw -u factread --host=$host $dbname -e "$queryint"
356 if [ "$mode"="auto" ]
357 then
358 return
359 fi
360
361 filecol=$datapath"/FACT_preliminary_"$name"_collaborators.dat"
362 if [ "$overwrite" = "yes" ]
363 then
364 echo "creating "$filecol" ..."
365 echo "# This file was created at "`date` > $filecol
366 echo "# The following query was used: " >> $filecol
367 echo "# "$querycol >> $filecol
368 # add policy here
369 fi
370 headercol="# "$num" time["$timeunit"] start["$timeunit"] stop["$timeunit"] excrate[evts/h] corr.excrate[evts/h] flux[CU] flux[e-11/cm2/s] delta_time["$timeunit"] ontime[min]"
371 headercol=$headercol" excrate_err[evts/h] corr.excrate_err[evts/h] flux_err[CU] flux_err[e-11/cm2/s] significance "
372 echo $headercol >> $filecol
373 #echo "$querycol"
374 mysql --defaults-file=$sqlpw -u factread --host=$host $dbname -s -e "$querycol" >> $filecol
375 #mysql --defaults-file=$sqlpw -u factread --host=$host $dbname -e "$querycol
376
377}
378
379# evaluation of command line options (for usage with download.php)
380
381if [ ${#@} -eq 13 ]
382then
383 #get_data.sh $start $stop $source $timebin $email $table $time $expert $dch $zd $th $light $dust
384 mode="auto"
385 # setup
386 path=`dirname $0`
387 datapath=$path"/data"
388 sqlpw=/home/$USER/.mysql.pw2
389 host=10.0.100.21
390 dbname=factdata
391 nightmin=$1
392 nightmax=$2
393 source=$3
394 bin=$4
395 email=$5
396 table=$6
397 timeunit=$7
398 expert=$8
399 usedch=$9 # novalue gives same result as no
400 if [ "${10}" != "novalue" ] && [ "${10}" != "all" ]
401 then
402 zdmax=${10}
403 fi
404 if [ "${11}" != "novalue" ] && [ "${11}" != "all" ]
405 then
406 thmax=${11}
407 fi
408 if [ "${12}" != "novalue" ] && [ "${12}" != "all" ]
409 then
410 light=${12}
411 fi
412 if [ "${13}" != "novalue" ] && [ "${13}" != "all" ]
413 then
414 dust=${13}
415 fi
416 name=`echo $email | sed -e 's/@/-at-/'`
417 get_results
418
419 if [ "$expert" == "yes" ]
420 then
421 echo $fileint
422 else
423 echo $fileext
424 fi
425
426 # next: light, dust
427 # implement all options
428 # make dch swi
429
430 exit
431fi
432
433
434
435# -------------------------------------------------------------------------------------- #
436# SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP #
437# -------------------------------------------------------------------------------------- #
438# #
439# The lines below define the basic setup for the database and give examples and #
440# explanations for the various options available. #
441# The request of the data itself is done with a smaller setup further down. #
442# #
443# -------------------------------------------------------------------------------------- #
444#
445# ----------
446# DB SETUP
447# ----------
448# path to file with mysql password
449sqlpw=/home/$USER/.mysql.pw
450# host of mysql server with FACT DB
451#host=lp-fact # ISDC
452host=10.0.100.21 # LP or LP via vpn
453#host=localhost # your local machine in case you have a copy of DB
454# name of database
455dbname=factdata
456#
457# -------------
458# BASIC SETUP
459# -------------
460# output path
461path=`dirname $0`
462datapath=$path"/data"
463# create directory for data files
464if ! [ -e $datapath ]
465then
466 mkdir $datapath
467fi
468# time unit
469#timeunit=timestamp # default
470#timeunit=unix
471timeunit=mjd
472# time binning
473# positive values: minutes
474# negative values: days
475# special case 0: period
476# for season binning choose -365 and according start date
477#bin=20 # minutes
478#bin=0 # period
479bin=-1 # nightly
480#bin=-365 # yearly
481# choose analysis
482#table="AnalysisResultsAllQLA" # N/A
483table="AnalysisResultsRunLP" # QLA
484#table="AnalysisResultsRunISDC" # ISDC
485# time range
486nightmin=20111115
487nightmax=20201231
488# overwrite dataset file?
489# (useful to combine different binnings in one file -> set to "no")
490overwrite="yes"
491# optional: require minimal ontime per bin (default 20 min)
492#ontimelimit=30 # 30 min
493ontimelimit= # default 20 min
494# data quality selection
495# if you explicitely don't want a datacheck, you can comment the following line
496usedch="yes"
497# use your own datacheck instead
498# use a line like the following defining your own data quality selection cut
499#dch=" AND fR750Cor/fR750Ref BETWEEN 0.93 AND 1.3 "
500# apply additional predefined cuts
501# light conditions
502#light="no moon" # only data with no moon (but twilight allowed)
503#light="dark" # only dark night data
504# TNG dust - cut away data with calima
505#dust=1
506#dust=10
507
508
509# -------------------------------------------------------------------------------------- #
510# SETUP - GET YOUR DATA HERE - SETUP - GET YOUR DATA HERE - SETUP - GET YOUR DATA HERE #
511# -------------------------------------------------------------------------------------- #
512# #
513# Adapt the lines below to your needs. #
514# Overwrite default settings above. #
515# The data-request is sent with the line 'get_results.' #
516# Minumum setup: Define source key and name for file. #
517# The list of source keys can be found at #
518# https://fact-project.org/run_db/db/printtable.php?fTable=Source&fSortBy=fSourceKEY+ #
519# More examples can be found further down. #
520# #
521# REMARKS: #
522# - correction of effect of zd and threshold not yet finalized and only valid for QLA #
523# - no CU-conversion available for ISDC-analysis so far (that for QLA is used instead) #
524# #
525# -------------------------------------------------------------------------------------- #
526
527# 501 MAGIC
528source=2
529name="Mrk501_2014_forMAGIC"
530bin=-1
531nightmin=20140714
532nightmax=20140805
533get_results
534
535bin=30
536name="Mrk501_2014_forMAGIC30"
537get_results
538
539bin=0
540name="P"
541nightmin=20140501
542nightmax=20140930
543get_results
544
545bin=20
546nightmin=20140623
547nightmax=20140623
548name="Mrk501_test"
549get_results
550
551
552# end script here
553exit
554
555
556
557#
558# more examples
559#
560
561# Mrk 421
562source=1
563name="Mrk421_nightly"
564bin=-1
565get_results
566name="Mrk421_20min"
567bin=20
568get_results
569name="Mrk421_3d"
570bin=-3
571get_results
572name="Mrk421_10d"
573bin=-10
574get_results
575name="Mrk421_period"
576bin=0
577get_results
578
579
580
581# Mrk 501
582source=2
583name="Mrk501_nightly"
584bin=-1
585get_results
586name="Mrk501_20min"
587bin=20
588get_results
589name="Mrk501_3d"
590bin=-3
591get_results
592name="Mrk501_10d"
593bin=-10
594get_results
595name="Mrk501_period"
596bin=0
597get_results
598
599
600
601# 2344
602source=3
603name="2344_nightly"
604bin=-1
605get_results
606name="2344_20min"
607bin=20
608get_results
609name="2344_period"
610bin=0
611get_results
612
613
614
615# 1959
616source=7
617name="1959_nightly"
618bin=-1
619get_results
620name="1959_20min"
621bin=20
622get_results
623name="1959_period"
624bin=0
625get_results
626
627
628
629# 0323
630source=12
631name="0323_nightly"
632bin=-1
633get_results
634name="0323_20min"
635bin=20
636get_results
637name="0323_period"
638bin=0
639get_results
640
641
642
643# crab
644source=5
645name="Crab_nightly"
646bin=-1
647get_results
648name="Crab_20min"
649bin=20
650get_results
651name="Crab_period"
652bin=0
653get_results
654name="Crab_season"
655bin=-365
656nightmin=20110716
657nightmax=20180716
658get_results
659
660
661
662name="1959_2016"
663source=7
664bin=-1
665nightmin=20160201
666nightmax=20161105
667get_results
668
669name="1959_all_variable"
670overwrite="no"
671source=7
672bin=-365
673nightmin=20120201
674nightmax=20130131
675get_results
676nightmin=20130201
677nightmax=20140131
678get_results
679nightmin=20140201
680nightmax=20150131
681get_results
682bin=0
683nightmin=20150201
684nightmax=20160131
685get_results
686bin=-1
687nightmin=20160201
688nightmax=20170131
689get_results
690bin=0
691nightmin=20170201
692nightmax=20180131
693get_results
694
695
696
697overwrite="yes"
698name="1959_all_variable2"
699overwrite="no"
700source=7
701bin=-365
702nightmin=20120201
703nightmax=20130131
704get_results
705nightmin=20130201
706nightmax=20140131
707get_results
708nightmin=20140201
709nightmax=20150131
710get_results
711bin=0
712nightmin=20150201
713nightmax=20160131
714get_results
715bin=-1
716nightmin=20160201
717nightmax=20160817
718get_results
719bin=0
720nightmin=20160818
721nightmax=20180131
722get_results
723
724
725
726overwrite="yes"
727bin=0
728source=3
729name="2344period"
730get_results
731
732
733
734# flare night (HESS)
735name="Mrk501_10min_flarenight"
736source=2
737bin=10
738nightmin=20140623
739nightmax=20140623
740get_results
741
742
743
744# flare night (HESS)
745name="Mrk501_5min_flarenight"
746source=2
747bin=5
748nightmin=20140623
749nightmax=20140623
750get_results
751
752
753
754
755# full sample
756name="Mrk421_all_nightly"
757source=1
758get_results
759
760name="Mrk501_all_nightly"
761source=2
762get_results
763
764name="1959_all_nightly"
765source=7
766get_results
767
768name="2344_all_nightly"
769source=3
770get_results
771
772
773
774name="HESE20160427"
775source=19
776nightmin=20160425
777bin=-10
778get_results
779
780name="AMON20160731"
781source=21
782nightmin=20160730
783bin=-10
784get_results
785
786
787
Note: See TracBrowser for help on using the repository browser.