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

Last change on this file since 19041 was 19041, checked in by Daniela Dorner, 6 years ago
added (scripts for downloading data)
File size: 11.3 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
44if (!empty($_GET["expert"]))
45{
46 $timebins=array(
47 "5" => "5min",
48 "10" => "10min",
49 "20" => "20min",
50 "30" => "30min",
51 "40" => "40min",
52 "60" => "60min",
53 "90" => "90min",
54 "120" => "120min",
55 "180" => "180min",
56 "240" => "240min",
57 "300" => "300min",
58 "360" => "360min",
59 "-1" => "1night",
60 );
61}
62else
63{
64 $timebins=array(
65 "20" => "20min",
66 "-1" => "1night",
67 );
68}
69
70if (!empty($_GET["time"]))
71 $time=$_GET["time"];
72
73if (!empty($_GET["start"]))
74 $start=$_GET["start"];
75//else
76// $start="20111115";
77
78if (!empty($_GET["stop"]))
79 $stop=$_GET["stop"];
80//else
81// $stop="20201231";
82
83if (!empty($_GET["timebin"]))
84 $bin=$_GET["timebin"];
85else
86 $bin="1night";
87
88if (!empty($_GET["email"]))
89 $email=$_GET["email"];
90else
91 $email="";
92
93if (!empty($_GET["source"]))
94 $source=$_GET["source"];
95else
96 $source="-1";
97
98//if (empty($_GET["timebin"]))
99// $_GET["timebin"]="12";
100
101if (empty($_GET["table"]))
102 $_GET["table"]="AnalysisResultsRunLP";
103
104//still to be implemented in Step3.sh
105if (empty($_GET["datacheck"]))
106 $_GET["datacheck"]="1";
107
108//variable for non-combinable date/source
109$warn="";
110
111
112include ("db.php");
113$db_id = mysql_connect($host, $user, $pw);
114mysql_select_db($db);
115
116ini_set("display_errors", "On");
117ini_set("mysql.trace_mode", "On");
118
119echo "<big><big><big><u>FACT Quick Look Analysis</u></big></big></big><br><br>\n";
120//echo "The official release of this webpage will take place on 1.9.2013.</big></big></big><br><br>";
121
122echo "<form name='formular' action='download.php' METHOD='GET'>\n";
123
124$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";
125//echo $query."<br>";
126
127$sources=array();
128$result=mysql_query($query);
129while ($row = mysql_fetch_row($result))
130 $sources[$row[0]]=$row[1];
131mysql_free_result($result);
132
133$query="SELECT Min(fNight), Max(fNight) FROM ".$_GET["table"];
134//echo $query."<br>";
135
136$result=mysql_query($query);
137while ($row = mysql_fetch_row($result))
138{
139 if (empty($start))
140 $start=$row[0];
141 if (empty($stop))
142 $stop=$row[1];
143}
144mysql_free_result($result);
145
146if (strpos($email, "@")!= false && $source>0)
147{
148 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[$bin]);
149 echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download.php\"'><br>\n";
150 $sent=shell_exec("export AUTOMATIONSETUP='fact.lp.gate'; /users/fact/SW.automatic.processing/DataCheck/QuickLook/SendData.sh ".$start." ".$stop." ".$source." ".$bin." ".$email." ".$_GET["table"]." ".$time);
151 echo $sent;
152 return;
153}
154
155printf("From <input name='start' type='text' size='8' maxlength='8' value='%s'> (YYYYMMDD)\n", $start);
156printf("to <input name='stop' type='text' size='8' maxlength='8' value='%s'> (YYYYMMDD)\n <br>\n", $stop);
157
158echo "source <select name='source' size='1'>\n";
159if ($source == 0)
160 printf("<option value='-1' selected>Select Source</option>\n");
161else
162 printf("<option value='-1'>Select Source</option>\n");
163foreach ($sources as $key => $sourcename)
164{
165 if ($source==$key)
166 printf("<option value='%s' selected>%s</option>\n", $key, $sourcename);
167 else
168 printf("<option value='%s'>%s</option>\n", $key, $sourcename);
169}
170echo "</select>\n";
171
172echo "binning <select name='timebin' size='1'>\n";
173foreach ($timebins as $key => $name)
174{
175 if ($_GET["timebin"] == $key)
176 printf("<option value='%s' selected>%s</option>\n", $key, $name);
177 else
178 printf("<option value='%s'>%s</option>\n", $key, $name);
179}
180echo "</select>\n <br>\n";
181
182echo "format of time <select name='time' size='1'>\n";
183foreach ($times as $key => $name)
184{
185 if ($_GET["time"] == $key)
186 printf("<option value='%s' selected>%s</option>\n", $key, $name);
187 else
188 printf("<option value='%s'>%s</option>\n", $key, $name);
189}
190echo "</select>\n <br>\n";
191
192echo "Please provide your email address here to receive the data: <br>\n";
193printf("<input name='email' type='text' size='20' maxlength='50' value='%s'>\n<br>\n", $email);
194
195echo "By clicking on the button, you agree to the data usage policy: <br>\n";
196echo "<input class='Width' type='button' value='Send data by Email' onClick='submit()'><br>\n";
197echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download.php\"'><br>\n";
198
199
200if (!empty($_GET["expert"]))
201{
202 echo "Expert mode: <br>\n";
203 echo "<input type='hidden' name='expert' value='yes'>\n";
204
205 echo "&nbsp;&nbsp;&nbsp;Select Analysis: <select name='table' size='1'>\n";
206 foreach ($tables as $key => $name)
207 {
208 if ($_GET["table"] == $key)
209 printf("<option value='%s' selected>%s</option>\n", $key, $name);
210 else
211 printf("<option value='%s'>%s</option>\n", $key, $name);
212 }
213 echo "</select> <br>\n";
214
215 echo "&nbsp;&nbsp;&nbsp;Select Datacheck: <select name='datacheck' size='1'>\n";
216 foreach ($datachecks as $key => $name)
217 {
218 if ($_GET["datacheck"] == $key)
219 printf("<option value='%s' selected>%s</option>\n", $key, $name);
220 else
221 printf("<option value='%s'>%s</option>\n", $key, $name);
222 }
223 echo "</select> (not yet implemented)<br>\n";
224
225}
226
227echo "</form>\n";
228
229echo "<br>\n";
230echo "<b>REMARKS:</b> ";
231echo "<ul>";
232//echo "<li>The results shown on this page are <b><i>PRELIMINARY</i></b>.</li>";
233echo "<li>These are the results of a <b>fast quick look analysis</b> on site, i.e. they are <b>preliminary</b>.</li>\n";
234echo "<li>The quick look analysis includes all data, i.e. no data selection done.</li>\n";
235//echo "<li><b>NO data check</b> is included in the analysis.</li>";
236echo "<li>The shown curves are not fluxes but <b>excess rates</b> (number of excess events per effective ontime), \n";
237echo "i.e. there is a dependence on trigger threshold and zenith distance of the observation (with the current \n";
238echo "analysis for zenith distance > 40 degree and trigger threshold > 500 DAC counts).</li>\n";
239//echo "i.e. a dependence on trigger threshold and zenith distance of the observation is expected ";
240//echo "for zenith distance larger than 40 degree and very strong moon light.</li>";
241//echo "<li><b>NO corrections</b> for the dependence on zenith distance and trigger threshold of the observation are applied so far.</li>";
242//echo "<li>This webpage shows the <b>excess rates</b> (black), i.e. number of excess events ";
243//echo "(signal minus background in the signal region) devided by the ontime of the observation, ";
244//echo "and the <b>background rates</b> (blue), i.e. number of background events devided by ontime. </li>";
245echo "<li>The curves are provided with 20 min binning and nightly binning.</li>\n";
246echo "<li>In case, you need further details about the data or a different binning, please do not hesitate to contact us.</li>\n";
247echo "<li>QLA results are available for the data since 12.12.2012. For older data, please contact us.</li>\n";
248echo "<li>New software versions were introduced at the following dates: 24.5.2014</li>\n";
249echo "</ul>";
250echo "If you intend to use the data or information from this website, please let us know for reference.<br>\n";
251echo "<big><b>Please cite this webpage and the ";
252echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/8/06/P06008'>FACT design paper</a>\n ";
253echo "when using information from this webpage or any FACT data.</b></big>\n";
254echo "<br><br>\n \n ";
255echo "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 ";
256echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/8/06/P06008'>open access</a>\n<br>\n";
257echo "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 ";
258echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/9/10/P10012/'>open access</a>\n<br>\n";
259echo "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 ";
260echo "<a target='_blank' href='https://arxiv.org/pdf/1502.02582v1.pdf'>open access</a>\n<br><br>\n";
261echo "Contact: Daniela Dorner <i>dorner&lt;at&gt;astro.uni-wuerzburg.de</i>.<br>";
262//echo "You acknowledge these regulations by clicking on the 'Show' button.</b></big> <br><br><br>";
263
264/*
265$ranges=array(
266// "5min" => " 5 min",
267// "10min" => "10 min",
268 "20min" => "20 min",
269 "30min" => "30 min",
270 "40min" => "40 min",
271 "60min" => "60 min",
272 "90min" => "90 min",
273 "120min" => "120 min",
274 "180min" => "180 min",
275 "240min" => "240 min",
276 "300min" => "300 min",
277 "360min" => "360 min",
278// "0001nights" => "1 night",
279// "0002nights" => "2 nights",
280// "0004nights" => "4 nights",
281// "0008nights" => "8 nights",
282// "0016nights" => "16 nights",
283 );
284
285echo "</body>";
286echo "</html>";
287*/
288//$dom = new DOMDocument();
289//$dom->loadHTML("download.php");
290//echo $dom->getElementById("logged");
291
292?>
293</body>
294</html>
Note: See TracBrowser for help on using the repository browser.