source: trunk/www/dch/download_internal.php@ 19041

Last change on this file since 19041 was 19041, checked in by Daniela Dorner, 7 years ago
added (scripts for downloading data)
File size: 12.6 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 href="flotsetup.css" rel="stylesheet" type="text/css">
10 <link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
11 <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../flot/excanvas.js"></script><![endif]-->
12 <script language="javascript" type="text/javascript" src="../../flot/jquery.js"></script>
13 <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.js"></script>
14 <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.errorbars.js"></script>
15 <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.navigate.js"></script>
16 <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.selection.js"></script>
17 <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.time.js"></script>
18 <script language="javascript" type="text/javascript" src="include.js"></script>
19 <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
20</head>
21<body>
22
23 <input type="button" size="8" id="login" style="float:right;" value='login' onclick='login("yes")'>
24 <input type="hidden" id="logged" value="no">
25
26<?php
27
28$tables=array(
29 "AnalysisResultsRunLP" => "LP",
30 "AnalysisResultsRunISDC" => "ISDC",
31 );
32
33$datachecks=array(
34 "1" => "off",
35 "2" => "on",
36 );
37
38$times=array(
39 "time" => "time",
40 "unix" => "unix",
41 "mjd" => "mjd",
42 );
43
44$zdcuts=array(
45 "90" => "zd<90",
46 "45" => "zd<45",
47 "35" => "zd<35",
48 "30" => "zd<30",
49 );
50
51$thcuts=array(
52 "1500" => "th<1500",
53 "550" => "th<550",
54 "350" => "th<350",
55 );
56$darknights=array(
57 "0" => "all data",
58 "90" => "dark night",
59 );
60
61
62$dchs=array(
63 "0" => "no datacheck",
64 "1" => "datacheck",
65 );
66
67$dusts=array(
68 "1000" => "dust<1000",
69 "20" => "dust<20",
70 "1.0" => "dust<1",
71 );
72
73$timebins=array(
74 "5" => "5min",
75 "10" => "10min",
76 "20" => "20min",
77 "30" => "30min",
78 "40" => "40min",
79 "60" => "60min",
80 "90" => "90min",
81 "120" => "120min",
82 "180" => "180min",
83 "240" => "240min",
84 "300" => "300min",
85 "360" => "360min",
86 "-1" => "1night",
87 );
88
89$expert="yes";
90
91if (!empty($_GET["time"]))
92 $time=$_GET["time"];
93
94if (!empty($_GET["start"]))
95 $start=$_GET["start"];
96//else
97// $start="20111115";
98
99if (!empty($_GET["stop"]))
100 $stop=$_GET["stop"];
101//else
102// $stop="20201231";
103
104if (!empty($_GET["dch"]))
105 $dch=$_GET["dch"];
106else
107 $dch="0";
108
109if (!empty($_GET["dust"]))
110 $dust=$_GET["dust"];
111else
112 $dust="1000";
113
114if (!empty($_GET["zdcut"]))
115 $zdcut=$_GET["zdcut"];
116else
117 $zdcut="90";
118
119if (!empty($_GET["darknight"]))
120 $darknight=$_GET["darknight"];
121else
122 $darknight="0";
123
124if (!empty($_GET["thcut"]))
125 $thcut=$_GET["thcut"];
126else
127 $thcut="1500";
128
129if (!empty($_GET["email"]))
130 $email=$_GET["email"];
131else
132 $email="";
133
134if (!empty($_GET["source"]))
135 $source=$_GET["source"];
136else
137 $source="-1";
138
139if (empty($_GET["timebin"]))
140 $_GET["timebin"]="-1";
141
142if (empty($_GET["table"]))
143 $_GET["table"]="AnalysisResultsRunLP";
144
145//still to be implemented in Step3.sh
146if (empty($_GET["datacheck"]))
147 $_GET["datacheck"]="1";
148
149//variable for non-combinable date/source
150$warn="";
151
152
153include ("db.php");
154$db_id = mysql_connect($host, $user, $pw);
155mysql_select_db($db);
156
157ini_set("display_errors", "On");
158ini_set("mysql.trace_mode", "On");
159
160echo "<big><big><big><u>FACT Quick Look Analysis</u></big></big></big><br><br>\n";
161//echo "The official release of this webpage will take place on 1.9.2013.</big></big></big><br><br>";
162
163echo "<form name='formular' action='download_internal.php' METHOD='GET'>\n";
164
165$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";
166//echo $query."<br>";
167
168$sources=array();
169$result=mysql_query($query);
170while ($row = mysql_fetch_row($result))
171 $sources[$row[0]]=$row[1];
172mysql_free_result($result);
173
174$query="SELECT Min(fNight), Max(fNight) FROM ".$_GET["table"];
175//echo $query."<br>";
176
177$result=mysql_query($query);
178while ($row = mysql_fetch_row($result))
179{
180 if (empty($start))
181 $start=$row[0];
182 if (empty($stop))
183 $stop=$row[1];
184}
185mysql_free_result($result);
186
187if (strpos($email, "@")!= false && $source>0)
188{
189 printf("Sent email to %s containing the data of %s from %d till %d for %s binning.<br>\n", $email, $sources[$source], $start, $stop, $_GET["timebin"]);
190 echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download_internal.php\"'><br>\n";
191 $sent=shell_exec("export AUTOMATIONSETUP='fact.lp.gate'; /users/fact/SW.automatic.processing/DataCheck/QuickLook/SendData_Internal.sh ".$start." ".$stop." ".$source." ".$_GET["timebin"]." ".$email." ".$_GET["table"]." ".$time." ".$expert." ".$dch." ".$zdcut." ".$thcut." ".$darknight." ".$dust);
192 echo $sent;
193 return;
194}
195
196printf("From <input name='start' type='text' size='8' maxlength='8' value='%s'> (YYYYMMDD)\n", $start);
197printf("to <input name='stop' type='text' size='8' maxlength='8' value='%s'> (YYYYMMDD)\n <br>\n", $stop);
198
199echo "source <select name='source' size='1'>\n";
200if ($source == 0)
201 printf("<option value='-1' selected>Select Source</option>\n");
202else
203 printf("<option value='-1'>Select Source</option>\n");
204foreach ($sources as $key => $sourcename)
205{
206 if ($source==$key)
207 printf("<option value='%s' selected>%s</option>\n", $key, $sourcename);
208 else
209 printf("<option value='%s'>%s</option>\n", $key, $sourcename);
210}
211echo "</select>\n";
212
213echo "binning <select name='timebin' size='1'>\n";
214foreach ($timebins as $key => $name)
215{
216 if ($_GET["timebin"] == $key)
217 printf("<option value='%s' selected>%s</option>\n", $key, $name);
218 else
219 printf("<option value='%s'>%s</option>\n", $key, $name);
220}
221echo "</select>\n <br>\n";
222
223echo "datacheck <select name='dch' size='1'>\n";
224foreach ($dchs as $key => $name)
225{
226 if ($_GET["dch"] == $key)
227 printf("<option value='%s' selected>%s</option>\n", $key, $name);
228 else
229 printf("<option value='%s'>%s</option>\n", $key, $name);
230}
231echo "</select>\n ";
232
233echo "calima <select name='dust' size='1'>\n";
234foreach ($dusts as $key => $name)
235{
236 if ($dust == $key)
237 printf("<option value='%s' selected>%s</option>\n", $key, $name);
238 else
239 printf("<option value='%s'>%s</option>\n", $key, $name);
240}
241echo "</select>\n ";
242
243echo "zd <select name='zdcut' size='1'>\n";
244foreach ($zdcuts as $key => $name)
245{
246 if ($_GET["zdcut"] == $key)
247 printf("<option value='%s' selected>%s</option>\n", $key, $name);
248 else
249 printf("<option value='%s'>%s</option>\n", $key, $name);
250}
251echo "</select>\n ";
252
253echo "th <select name='thcut' size='1'>\n";
254foreach ($thcuts as $key => $name)
255{
256 if ($_GET["thcut"] == $key)
257 printf("<option value='%s' selected>%s</option>\n", $key, $name);
258 else
259 printf("<option value='%s'>%s</option>\n", $key, $name);
260}
261echo "</select>\n ";
262
263echo "Select Analysis: <select name='table' size='1'>\n";
264foreach ($tables as $key => $name)
265{
266 if ($_GET["table"] == $key)
267 printf("<option value='%s' selected>%s</option>\n", $key, $name);
268 else
269 printf("<option value='%s'>%s</option>\n", $key, $name);
270}
271echo "</select>\n";
272
273echo "darknight <select name='darknight' size='1'>\n";
274foreach ($darknights as $key => $name)
275{
276 if ($_GET["darknight"] == $key)
277 printf("<option value='%s' selected>%s</option>\n", $key, $name);
278 else
279 printf("<option value='%s'>%s</option>\n", $key, $name);
280}
281echo "</select>\n <br>\n";
282
283echo "format of time <select name='time' size='1'>\n";
284foreach ($times as $key => $name)
285{
286 if ($_GET["time"] == $key)
287 printf("<option value='%s' selected>%s</option>\n", $key, $name);
288 else
289 printf("<option value='%s'>%s</option>\n", $key, $name);
290}
291echo "</select>\n <br>\n";
292
293echo "warning: datacheck doesn't so far work with ISDC <br>\n";
294
295echo "Please provide your email address here to receive the data: <br>\n";
296printf("<input name='email' type='text' size='20' maxlength='50' value='%s'>\n<br>\n", $email);
297
298echo "By clicking on the button, you agree to the data usage policy: <br>\n";
299echo "<input class='Width' type='button' value='Send data by Email' onClick='submit()'><br>\n";
300echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download_internal.php\"'><br>\n";
301
302
303
304echo "</form>\n";
305
306echo "<br>\n";
307echo "<b>REMARKS:</b> ";
308echo "<ul>";
309//echo "<li>The results shown on this page are <b><i>PRELIMINARY</i></b>.</li>";
310echo "<li>These are the results of a <b>fast quick look analysis</b> on site, i.e. they are <b>preliminary</b>.</li>\n";
311echo "<li>The quick look analysis includes all data, i.e. no data selection done.</li>\n";
312//echo "<li><b>NO data check</b> is included in the analysis.</li>";
313echo "<li>The shown curves are not fluxes but <b>excess rates</b> (number of excess events per effective ontime), \n";
314echo "i.e. there is a dependence on trigger threshold and zenith distance of the observation (with the current \n";
315echo "analysis for zenith distance > 40 degree and trigger threshold > 500 DAC counts).</li>\n";
316//echo "i.e. a dependence on trigger threshold and zenith distance of the observation is expected ";
317//echo "for zenith distance larger than 40 degree and very strong moon light.</li>";
318//echo "<li><b>NO corrections</b> for the dependence on zenith distance and trigger threshold of the observation are applied so far.</li>";
319//echo "<li>This webpage shows the <b>excess rates</b> (black), i.e. number of excess events ";
320//echo "(signal minus background in the signal region) devided by the ontime of the observation, ";
321//echo "and the <b>background rates</b> (blue), i.e. number of background events devided by ontime. </li>";
322echo "<li>The curves are provided with 20 min binning and nightly binning.</li>\n";
323echo "<li>In case, you need further details about the data or a different binning, please do not hesitate to contact us.</li>\n";
324echo "<li>QLA results are available for the data since 12.12.2012. For older data, please contact us.</li>\n";
325echo "<li>New software versions were introduced at the following dates: 24.5.2014</li>\n";
326echo "</ul>";
327echo "If you intend to use the data or information from this website, please let us know for reference.<br>\n";
328echo "<big><b>Please cite this webpage and the ";
329echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/8/06/P06008'>FACT design paper</a>\n ";
330echo "when using information from this webpage or any FACT data.</b></big>\n";
331echo "<br><br>\n \n ";
332echo "Reference FACT Design Paper: H. Anderhub et al. JINST 8 P6008 <a target='_blank' href='http://adsabs.harvard.edu/abs/2013JInst...8P6008A'>ADS</a>\n ";
333echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/8/06/P06008'>open access</a>\n<br>\n";
334echo "Reference FACT Performance Paper: A. Biland et al. JINST 9 P10012 <a target='_blank' href='http://adsabs.harvard.edu/abs/2014JInst...9P0012B'>ADS</a>\n ";
335echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/9/10/P10012/'>open access</a>\n<br><br>\n";
336echo "Contact: Daniela Dorner <i>dorner&lt;at&gt;astro.uni-wuerzburg.de</i>.<br>";
337//echo "You acknowledge these regulations by clicking on the 'Show' button.</b></big> <br><br><br>";
338
339/*
340$ranges=array(
341// "5min" => " 5 min",
342// "10min" => "10 min",
343 "20min" => "20 min",
344 "30min" => "30 min",
345 "40min" => "40 min",
346 "60min" => "60 min",
347 "90min" => "90 min",
348 "120min" => "120 min",
349 "180min" => "180 min",
350 "240min" => "240 min",
351 "300min" => "300 min",
352 "360min" => "360 min",
353// "0001nights" => "1 night",
354// "0002nights" => "2 nights",
355// "0004nights" => "4 nights",
356// "0008nights" => "8 nights",
357// "0016nights" => "16 nights",
358 );
359
360echo "</body>";
361echo "</html>";
362*/
363//$dom = new DOMDocument();
364//$dom->loadHTML("download.php");
365//echo $dom->getElementById("logged");
366
367?>
368</body>
369</html>
Note: See TracBrowser for help on using the repository browser.