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

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