source: trunk/www/dch/download.php@ 19047

Last change on this file since 19047 was 19047, checked in by Daniela Dorner, 7 years ago
removed maintenance announcement
File size: 15.7 KB
Line 
1<!DOCTYPE HTML>
2<html>
3<head>
4 <meta name="Author" content="The FACT Group" />
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 <title>FACT Project</title>
7
8 <link rel="StyleSheet" type="text/css" href="../../style.css" />
9 <link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
10 <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
11</head>
12<body>
13 <!--
14 <hr>
15 <p style='font-size:xx-large'> MAINTENANCE ONGOING </p>
16 <p>check again in a few hours...</p>
17 <p>
18 <hr>
19 <p>
20 <p>
21 -->
22<?php
23
24$tables=array(
25 "AnalysisResultsRunLP" => "QLA",
26 "AnalysisResultsRunISDC" => "ISDC",
27 );
28
29$times=array(
30 "time" => "timestamp",
31 "unix" => "unixtime",
32 "mjd" => "MJD",
33 );
34
35$zdcuts=array(
36 "all" => "all data",
37 "75" => "zd<75",
38 "45" => "zd<45",
39 "35" => "zd<35",
40 "30" => "zd<30",
41 );
42
43$thcuts=array(
44 "all" => "all data",
45 "550" => "th<550",
46 "350" => "th<350",
47 );
48$lights=array(
49 "all" => "all data",
50 "nomoon" => "no moon",
51 "dark" => "only dark night",
52 );
53
54
55$dchs=array(
56 "no" => "all data",
57 "yes" => "apply data check (R750)",
58 );
59
60$dusts=array(
61 "all" => "all data",
62 "20" => "dust<20",
63 "10" => "dust<10",
64 "1.0" => "dust<1",
65 );
66
67$timebins=array(
68 "5" => "5 minutes",
69 "10" => "10 minutes",
70 "20" => "20 minutes",
71 "30" => "30 minutes",
72 "40" => "40 minutes",
73 "60" => "1 hour",
74 "90" => "1.5 hours",
75 "120" => "2 hours",
76 "180" => "3 hours",
77 "240" => "4 hours",
78 "300" => "5 hours",
79 "360" => "6 hours",
80 "-1" => "1 night",
81 "-2" => "2 nights",
82 "-3" => "3 nights",
83 "-4" => "4 nights",
84 "-5" => "5 nights",
85 "-6" => "6 nights",
86 "-7" => "7 nights",
87 "-10" => "10 nights",
88 "00" => "period",
89 );
90
91$timebinsext=array(
92 "20" => "20 minutes",
93 "-1" => "1 night",
94 );
95
96// get/define initial values
97
98if (!empty($_GET["dch"]))
99 $dch=$_GET["dch"];
100else
101 $dch="novalue";
102
103if (!empty($_GET["dust"]))
104 $dust=$_GET["dust"];
105else
106 $dust="novalue";
107
108if (!empty($_GET["expert"]))
109 $expert=$_GET["expert"];
110else
111 $expert="no";
112
113if (!empty($_GET["email"]))
114 $email=$_GET["email"];
115else
116 $email="";
117
118if (!empty($_GET["light"]))
119 $light=$_GET["light"];
120else
121 $light="novalue";
122
123if (!empty($_GET["source"]))
124 $source=$_GET["source"];
125else
126 $source=-1;
127
128if (!empty($_GET["timebin"]))
129 $timebin=$_GET["timebin"];
130else
131 $timebin="novalue";
132
133if (!empty($_GET["time"]))
134 $time=$_GET["time"];
135else
136 $time="novalue";
137
138if (!empty($_GET["table"]))
139 $table=$_GET["table"];
140else
141 $table="AnalysisResultsRunLP";
142
143if (!empty($_GET["th"]))
144 $th=$_GET["th"];
145else
146 $th="novalue";
147
148if (!empty($_GET["zd"]))
149 $zd=$_GET["zd"];
150else
151 $zd="novalue";
152
153//variable for non-combinable date/source
154$warn="";
155
156
157include ("db.php");
158$db_id = mysql_connect($host, $user, $pw);
159mysql_select_db($db);
160
161ini_set("display_errors", "On");
162ini_set("mysql.trace_mode", "On");
163
164echo "<h1><u>FACT Quick Look Analysis - Download Area</u></h1>\n";
165//echo "<hr>\n";
166echo "<h2>Data Usage Policy</h2>\n";
167
168if ($expert=="yes")
169{
170 echo "As a member or associated member of the FACT Collaboration, you have access to internal information.<br>\n";
171 echo "Any publication using FACT internal information has to have the full FACT author list.<br><br>\n";
172}
173else
174{
175 echo "<b>Using data from the FACT Quick Look Analysis, you agree to cite the ";
176 echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/8/06/P06008'>FACT design paper</a>\n ";
177 echo "and the <a target='_blank' href='https://fact-project.org/monitoring'>quick look analysis</a>.</b>\n";
178 echo "<br><br>\n \n ";
179 echo "<u>References:</u>\n";
180 echo "<ul>\n";
181 echo "<li>Website Quick Look Analysis: <a target='_blank' href='https://fact-project.org/monitoring'>https://fact-project.org/monitoring </a></li>\n";
182 echo "<li>FACT Design Paper: H. Anderhub et al. JINST 8 P6008 <a target='_blank' href='http://adsabs.harvard.edu/abs/2013JInst...8P6008A'>ADS</a>\n ";
183 echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/8/06/P06008'>open access</a>\n</li>\n";
184 echo "<li>FACT Performance Paper: A. Biland et al. JINST 9 P10012 <a target='_blank' href='http://adsabs.harvard.edu/abs/2014JInst...9P0012B'>ADS</a>\n ";
185 echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/9/10/P10012/'>open access</a>\n</li>\n";
186 echo "<li>Information on the Quick Look Analysis: D. Dorner et al. Proceedings Fermi Symposium 2014 <a target='_blank' href='http://adsabs.harvard.edu/abs/2015arXiv150202582D'>ADS</a>\n ";
187 echo "<a target='_blank' href='https://arxiv.org/pdf/1502.02582v1.pdf'>open access</a>\n</li>\n";
188 echo "</ul>\n";
189}
190
191
192echo "If you intend to use data or information from this website, please let us know for reference.<br>\n";
193
194
195//echo "<hr>\n";
196echo "<form name='formular' action='download.php' METHOD='GET'>\n";
197
198//$query="SELECT fSourceKey, fSourceName, (SELECT COUNT(*) FROM ".$_GET["table"]." LEFT JOIN RunInfo USING(fNight, fRunID) WHERE fRunTypeKey=1 AND RunInfo.fSourceKey=Source.fSourceKey) AS num FROM Source WHERE fSourceTypeKey=1";
199$query="SELECT fSourceKey, fSourceName, COUNT(*) AS num FROM RunInfo LEFT JOIN Source USING(fSourceKey) WHERE fSourceTypeKey=1 AND fRunTypeKey=1 GROUP BY fSourceKey ORDER BY num DESC";
200//echo $query."<br>";
201
202$sources=array();
203$result=mysql_query($query);
204while ($row = mysql_fetch_row($result))
205 $sources[$row[0]]=$row[1];
206mysql_free_result($result);
207
208//$query="SELECT Min(fNight), Max(fNight) FROM ".$_GET["table"];
209$query="SELECT Min(fNight), Max(fNight) FROM RunInfo";
210//echo $query."<br>";
211
212$result=mysql_query($query);
213while ($row = mysql_fetch_row($result))
214{
215 if (empty($start))
216 $start=$row[0];
217 if (empty($stop))
218 $stop=$row[1];
219}
220mysql_free_result($result);
221
222if (strpos($email, "@")!= false && $source>0)
223{
224 echo "<h2>Sending data...</h2>\n";
225 printf("Sent email to %s containing the data of %s from %d till %d for %s binning.<br>\n", $email, $sources[$source], $start, $stop, $timebins[$timebin]);
226 //printf("Sending email to %s containing the data of %s from %d till %d for %s binning...<br>\n", $email, $sources[$source], $start, $stop, $timebins[$timebin]);
227 //echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download.php";
228 //if ($expert == "yes")
229 // echo "?expert=yes";
230 //echo "\"'><br>\n";
231 //echo $start." ".$stop." ".$source." ".$timebin." ".$email." ".$table." ".$time." ".$expert." ".$dch." ".$zd." ".$th." ".$light." ".$dust."<br>\n";
232 $sent=shell_exec("/users/fact/SW.automatic.processing/DataCheck/Tools/get_data.sh ".$start." ".$stop." ".$source." ".$timebin." ".$email." ".$table." ".$time." ".$expert." ".$dch." ".$zd." ".$th." ".$light." ".$dust);
233 echo $sent;
234 // use other return information
235}
236
237echo "<h2>Select here the settings for your data sample:</h2>\n";
238
239// SOURCE
240echo "<select name='source' size='1'>\n";
241if ($source == -1)
242 printf("<option value='-1' selected>Select Source</option>\n");
243else
244 printf("<option value='-1'>Select Source</option>\n");
245foreach ($sources as $key => $sourcename)
246{
247 if ($source==$key)
248 printf("<option value='%s' selected>%s</option>\n", $key, $sourcename);
249 else
250 printf("<option value='%s'>%s</option>\n", $key, $sourcename);
251}
252echo "</select>\n";
253
254// Time Format
255echo "<select name='time' size='1'>\n";
256if ($time == "")
257 printf("<option value='novalue' selected>Select Time Format</option>\n");
258else
259 printf("<option value='novalue'>Select Time Format</option>\n");
260foreach ($times as $key => $name)
261{
262 if ($time == $key)
263 printf("<option value='%s' selected>%s</option>\n", $key, $name);
264 else
265 printf("<option value='%s'>%s</option>\n", $key, $name);
266}
267echo "</select>\n ";
268
269// Binning
270echo "<select name='timebin' size='1'>\n";
271if ($timebin == "novalue")
272 printf("<option value='novalue' selected>Select Binning</option>\n");
273else
274 printf("<option value='novalue'>Select Binning</option>\n");
275if ($expert != "yes")
276 $timebins=$timebinsext;
277foreach ($timebins as $key => $name)
278{
279 if ($timebin == $key)
280 printf("<option value='%s' selected>%s</option>\n", $key, $name);
281 else
282 printf("<option value='%s'>%s</option>\n", $key, $name);
283}
284echo "</select>\n";
285echo "<br>\n";
286
287printf("Time Range: from <input name='start' type='text' size='8' maxlength='8' value='%s'> \n", $start);
288printf("to <input name='stop' type='text' size='8' maxlength='8' value='%s'> \n ", $stop);
289//echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download.php\"'><br>\n";
290echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download.php";
291if ($expert == "yes")
292 echo "?expert=yes";
293echo "\"'><br>\n";
294
295if ($expert == "yes")
296{
297 echo "<h2>Further settings for internal use: </h2>\n";
298 echo "<input type='hidden' name='expert' value='yes'>\n";
299
300 echo "Select Analysis: <select name='table' size='1'>\n";
301 foreach ($tables as $key => $name)
302 {
303 if ($table == $key)
304 printf("<option value='%s' selected>%s</option>\n", $key, $name);
305 else
306 printf("<option value='%s'>%s</option>\n", $key, $name);
307 }
308 echo "</select><br>\n";
309
310 echo "Cuts: \n";
311 //DATACHECK
312 echo "<select name='dch' size='1'>\n";
313 if ($dch == "novalue")
314 printf("<option value='novalue' selected>Select DataCheck</option>\n");
315 else
316 printf("<option value='novalue'>Select DataCheck</option>\n");
317 foreach ($dchs as $key => $name)
318 {
319 if ($dch == $key)
320 printf("<option value='%s' selected>%s</option>\n", $key, $name);
321 else
322 printf("<option value='%s'>%s</option>\n", $key, $name);
323 }
324 echo "</select>\n ";
325
326 //DUST
327 echo "<select name='dust' size='1'>\n";
328 if ($dust == "novalue")
329 printf("<option value='novalue' selected>Select Calima-Cut</option>\n");
330 else
331 printf("<option value='novalue'>Select Calima-Cut</option>\n");
332 foreach ($dusts as $key => $name)
333 {
334 if ($dust == $key)
335 printf("<option value='%s' selected>%s</option>\n", $key, $name);
336 else
337 printf("<option value='%s'>%s</option>\n", $key, $name);
338 }
339 echo "</select>\n ";
340
341 //ZD
342 echo "<select name='zdcut' size='1'>\n";
343 if ($zd == "novalue")
344 printf("<option value='novalue' selected>Select Zd-Cut</option>\n");
345 else
346 printf("<option value='novalue'>Select Zd-Cut</option>\n");
347 foreach ($zdcuts as $key => $name)
348 {
349 if ($zd == $key)
350 printf("<option value='%s' selected>%s</option>\n", $key, $name);
351 else
352 printf("<option value='%s'>%s</option>\n", $key, $name);
353 }
354 echo "</select>\n ";
355
356 //TH
357 echo "<select name='thcut' size='1'>\n";
358 if ($th == "novalue")
359 printf("<option value='novalue' selected>Select Threshold-Cut</option>\n");
360 else
361 printf("<option value='novalue'>Select Threshold-Cut</option>\n");
362 foreach ($thcuts as $key => $name)
363 {
364 if ($th == $key)
365 printf("<option value='%s' selected>%s</option>\n", $key, $name);
366 else
367 printf("<option value='%s'>%s</option>\n", $key, $name);
368 }
369 echo "</select>\n ";
370
371 echo "<select name='light' size='1'>\n";
372 if ($light == "novalue")
373 printf("<option value='novalue' selected>Select Light-Condition-Cut</option>\n");
374 else
375 printf("<option value='novalue'>Select Light-Condition-Cut</option>\n");
376 foreach ($lights as $key => $name)
377 {
378 if ($lightt == $key)
379 printf("<option value='%s' selected>%s</option>\n", $key, $name);
380 else
381 printf("<option value='%s'>%s</option>\n", $key, $name);
382 }
383 echo "</select>\n <br>\n";
384}
385
386echo "<h2>Get data:</h2>\n";
387
388echo "Provide your email address to receive the data: \n";
389printf("<input name='email' type='text' size='20' maxlength='50' value='%s'>\n<br>\n", $email);
390
391echo "Clicking on the button, you agree to the data usage policy: \n";
392echo "<input class='Width' type='button' value='Send data by Email' onClick='submit()'><br>\n";
393
394
395
396echo "</form>\n";
397
398echo "<h2>Remarks:</h2> ";
399
400
401if ($expert="yes")
402{
403 echo "<ul>\n";
404 echo "<li>The correction formula to correct the excess rate for the effects of zd and threshold are not yet final.</li>\n";
405 echo "<li>The CU conversion is currently only valid for QLA and until summer 2016.</li>\n";
406 echo "<li>The data quality selection based on the artificial trigger rate R750 might not work for all data (effect of lidar).</li>\n";
407 //echo "<li></li>\n";
408 echo "</ul>";
409}
410else
411{
412 echo "<ul>\n";
413 //echo "<li>The results shown on this page are <b><i>PRELIMINARY</i></b>.</li>";
414 echo "<li>These are the results of a <b>fast quick look analysis</b> on site, i.e. they are <b>preliminary</b>.</li>\n";
415 echo "<li>The quick look analysis includes all data, i.e. no data selection done.</li>\n";
416 //echo "<li><b>NO data check</b> is included in the analysis.</li>";
417 echo "<li>The shown curves are not fluxes but <b>excess rates</b> (number of excess events per effective ontime), \n";
418 echo "i.e. there is a dependence on trigger threshold and zenith distance of the observation (with the current \n";
419 echo "analysis for zenith distance > 40 degree and trigger threshold > 500 DAC counts).</li>\n";
420 //echo "i.e. a dependence on trigger threshold and zenith distance of the observation is expected ";
421 //echo "for zenith distance larger than 40 degree and very strong moon light.</li>";
422 //echo "<li><b>NO corrections</b> for the dependence on zenith distance and trigger threshold of the observation are applied so far.</li>";
423 //echo "<li>This webpage shows the <b>excess rates</b> (black), i.e. number of excess events ";
424 //echo "(signal minus background in the signal region) devided by the ontime of the observation, ";
425 //echo "and the <b>background rates</b> (blue), i.e. number of background events devided by ontime. </li>";
426 echo "<li>The curves are provided with 20 min binning and nightly binning.</li>\n";
427 echo "<li>In case, you need further details about the data or a different binning, please do not hesitate to contact us.</li>\n";
428 echo "<li>QLA results are available for the data since 12.12.2012. For older data, please contact us.</li>\n";
429 echo "<li>New software versions were introduced at the following dates: 24.5.2014</li>\n";
430 echo "</ul>\n";
431 echo "In case you are interested in more than the public data, please contact us.\n";
432}
433
434echo "<h2>Contact</h2>";
435echo "Daniela Dorner <i>dorner&lt;at&gt;astro.uni-wuerzburg.de</i><br>";
436//echo "You acknowledge these regulations by clicking on the 'Show' button.</b></big> <br><br><br>";
437
438/*
439$ranges=array(
440// "5min" => " 5 min",
441// "10min" => "10 min",
442 "20min" => "20 min",
443 "30min" => "30 min",
444 "40min" => "40 min",
445 "60min" => "60 min",
446 "90min" => "90 min",
447 "120min" => "120 min",
448 "180min" => "180 min",
449 "240min" => "240 min",
450 "300min" => "300 min",
451 "360min" => "360 min",
452// "0001nights" => "1 night",
453// "0002nights" => "2 nights",
454// "0004nights" => "4 nights",
455// "0008nights" => "8 nights",
456// "0016nights" => "16 nights",
457 );
458
459echo "</body>";
460echo "</html>";
461*/
462//$dom = new DOMDocument();
463//$dom->loadHTML("download.php");
464//echo $dom->getElementById("logged");
465
466?>
467</body>
468</html>
Note: See TracBrowser for help on using the repository browser.