Index: trunk/www/dch/download_internal.php
===================================================================
--- trunk/www/dch/download_internal.php	(revision 19044)
+++ 	(revision )
@@ -1,369 +1,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta name="Author" content="The FACT Group" />
-  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-    <title>FACT Project</title>
-
-  <link rel="StyleSheet" type="text/css" href="../../style.css" />
-  <link href="flotsetup.css" rel="stylesheet" type="text/css">
-  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
-  <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../flot/excanvas.js"></script><![endif]-->
-  <script language="javascript" type="text/javascript" src="../../flot/jquery.js"></script>
-  <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.js"></script>
-  <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.errorbars.js"></script>
-  <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.navigate.js"></script>
-  <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.selection.js"></script>
-  <script language="javascript" type="text/javascript" src="../../flot/jquery.flot.time.js"></script>
-  <script language="javascript" type="text/javascript" src="include.js"></script>
-  <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
-</head>
-<body>
-
-    <input type="button" size="8" id="login" style="float:right;" value='login' onclick='login("yes")'>
-    <input type="hidden" id="logged" value="no">
-
-<?php
-
-$tables=array(
-              "AnalysisResultsRunLP"   => "LP",
-              "AnalysisResultsRunISDC" => "ISDC",
-               );
-
-$datachecks=array(
-              "1"   => "off",
-              "2"   => "on",
-               );
-
-$times=array(
-      "time"   => "time",
-      "unix"   => "unix",
-      "mjd"   => "mjd",
-      );
-
-$zdcuts=array(
-      "90"   => "zd<90",
-      "45"   => "zd<45",
-      "35"   => "zd<35",
-      "30"   => "zd<30",
-      );
-
-$thcuts=array(
-      "1500"   => "th<1500",
-      "550"   => "th<550",
-      "350"   => "th<350",
-      );
-$darknights=array(
-      "0"   => "all data",
-      "90"   => "dark night",
-      );
-
-
-$dchs=array(
-      "0"   => "no datacheck",
-      "1"   => "datacheck",
-      );
-
-$dusts=array(
-      "1000"   => "dust<1000",
-      "20"   => "dust<20",
-      "1.0"   => "dust<1",
-      );
-
-$timebins=array(
-                "5"    => "5min",
-                "10"    => "10min",
-                "20"    => "20min",
-                "30"    => "30min",
-                "40"    => "40min",
-                "60"    => "60min",
-                "90"    => "90min",
-                "120"    => "120min",
-                "180"    => "180min",
-                "240"   => "240min",
-                "300"   => "300min",
-                "360"   => "360min",
-                "-1"   => "1night",
-               );
-
-$expert="yes";
-
-if (!empty($_GET["time"]))
-    $time=$_GET["time"];
-
-if (!empty($_GET["start"]))
-    $start=$_GET["start"];
-//else
-//    $start="20111115";
-
-if (!empty($_GET["stop"]))
-    $stop=$_GET["stop"];
-//else
-//    $stop="20201231";
-
-if (!empty($_GET["dch"]))
-    $dch=$_GET["dch"];
-else
-    $dch="0";
-
-if (!empty($_GET["dust"]))
-    $dust=$_GET["dust"];
-else
-    $dust="1000";
-
-if (!empty($_GET["zdcut"]))
-    $zdcut=$_GET["zdcut"];
-else
-    $zdcut="90";
-
-if (!empty($_GET["darknight"]))
-    $darknight=$_GET["darknight"];
-else
-    $darknight="0";
-
-if (!empty($_GET["thcut"]))
-    $thcut=$_GET["thcut"];
-else
-    $thcut="1500";
-
-if (!empty($_GET["email"]))
-    $email=$_GET["email"];
-else
-    $email="";
-
-if (!empty($_GET["source"]))
-    $source=$_GET["source"];
-else
-    $source="-1";
-
-if (empty($_GET["timebin"]))
-    $_GET["timebin"]="-1";
-
-if (empty($_GET["table"]))
-    $_GET["table"]="AnalysisResultsRunLP";
-
-//still to be implemented in Step3.sh
-if (empty($_GET["datacheck"]))
-    $_GET["datacheck"]="1";
-
-//variable for non-combinable date/source
-$warn="";
-
-
-include ("db.php");
-$db_id = mysql_connect($host, $user, $pw);
-mysql_select_db($db);
-
-ini_set("display_errors",   "On");
-ini_set("mysql.trace_mode", "On");
-
-echo "<big><big><big><u>FACT Quick Look Analysis</u></big></big></big><br><br>\n";
-//echo "The official release of this webpage will take place on 1.9.2013.</big></big></big><br><br>";
-
-echo "<form name='formular' action='download_internal.php' METHOD='GET'>\n";
-
-$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";
-//echo $query."<br>";
-
-$sources=array();
-$result=mysql_query($query);
-while ($row = mysql_fetch_row($result))
-    $sources[$row[0]]=$row[1];
-mysql_free_result($result);
-
-$query="SELECT Min(fNight), Max(fNight) FROM ".$_GET["table"];
-//echo $query."<br>";
-
-$result=mysql_query($query);
-while ($row = mysql_fetch_row($result))
-{
-    if (empty($start))
-        $start=$row[0];
-    if (empty($stop))
-        $stop=$row[1];
-}
-mysql_free_result($result);
-
-if (strpos($email, "@")!= false && $source>0)
-{
-    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"]);
-    echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download_internal.php\"'><br>\n";
-    $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);
-    echo $sent;
-    return;
-}
-
-printf("From <input name='start' type='text' size='8' maxlength='8' value='%s'> (YYYYMMDD)\n", $start);
-printf("to <input name='stop' type='text' size='8' maxlength='8' value='%s'> (YYYYMMDD)\n <br>\n", $stop);
-
-echo "source <select name='source' size='1'>\n";
-if ($source == 0)
-    printf("<option value='-1' selected>Select Source</option>\n");
-else
-    printf("<option value='-1'>Select Source</option>\n");
-foreach ($sources as $key => $sourcename)
-{
-    if ($source==$key)
-        printf("<option value='%s' selected>%s</option>\n", $key, $sourcename);
-    else
-        printf("<option value='%s'>%s</option>\n", $key, $sourcename);
-}
-echo "</select>\n";
-
-echo "binning <select name='timebin' size='1'>\n";
-foreach ($timebins as $key => $name)
-{
-    if ($_GET["timebin"] == $key)
-        printf("<option value='%s' selected>%s</option>\n", $key, $name);
-    else
-        printf("<option value='%s'>%s</option>\n", $key, $name);
-}
-echo "</select>\n <br>\n";
-
-echo "datacheck <select name='dch' size='1'>\n";
-foreach ($dchs as $key => $name)
-{
-    if ($_GET["dch"] == $key)
-        printf("<option value='%s' selected>%s</option>\n", $key, $name);
-    else
-        printf("<option value='%s'>%s</option>\n", $key, $name);
-}
-echo "</select>\n ";
-
-echo "calima <select name='dust' size='1'>\n";
-foreach ($dusts as $key => $name)
-{
-    if ($dust == $key)
-        printf("<option value='%s' selected>%s</option>\n", $key, $name);
-    else
-        printf("<option value='%s'>%s</option>\n", $key, $name);
-}
-echo "</select>\n ";
-
-echo "zd <select name='zdcut' size='1'>\n";
-foreach ($zdcuts as $key => $name)
-{
-    if ($_GET["zdcut"] == $key)
-        printf("<option value='%s' selected>%s</option>\n", $key, $name);
-    else
-        printf("<option value='%s'>%s</option>\n", $key, $name);
-}
-echo "</select>\n ";
-
-echo "th <select name='thcut' size='1'>\n";
-foreach ($thcuts as $key => $name)
-{
-    if ($_GET["thcut"] == $key)
-        printf("<option value='%s' selected>%s</option>\n", $key, $name);
-    else
-        printf("<option value='%s'>%s</option>\n", $key, $name);
-}
-echo "</select>\n ";
-
-echo "Select Analysis: <select name='table' size='1'>\n";
-foreach ($tables as $key => $name)
-{
-    if ($_GET["table"] == $key)
-        printf("<option value='%s' selected>%s</option>\n", $key, $name);
-    else
-        printf("<option value='%s'>%s</option>\n", $key, $name);
-}
-echo "</select>\n";
-
-echo "darknight <select name='darknight' size='1'>\n";
-foreach ($darknights as $key => $name)
-{
-    if ($_GET["darknight"] == $key)
-        printf("<option value='%s' selected>%s</option>\n", $key, $name);
-    else
-        printf("<option value='%s'>%s</option>\n", $key, $name);
-}
-echo "</select>\n <br>\n";
-
-echo "format of time <select name='time' size='1'>\n";
-foreach ($times as $key => $name)
-{
-    if ($_GET["time"] == $key)
-        printf("<option value='%s' selected>%s</option>\n", $key, $name);
-    else
-        printf("<option value='%s'>%s</option>\n", $key, $name);
-}
-echo "</select>\n <br>\n";
-
-echo "warning: datacheck doesn't so far work with ISDC <br>\n";
-
-echo "Please provide your email address here to receive the data: <br>\n";
-printf("<input name='email' type='text' size='20' maxlength='50' value='%s'>\n<br>\n", $email);
-
-echo "By clicking on the button, you agree to the data usage policy: <br>\n";
-echo "<input class='Width' type='button' value='Send data by Email' onClick='submit()'><br>\n";
-echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download_internal.php\"'><br>\n";
-
-
-
-echo "</form>\n";
-
-echo "<br>\n";
-echo "<b>REMARKS:</b> ";
-echo "<ul>";
-//echo "<li>The results shown on this page are <b><i>PRELIMINARY</i></b>.</li>";
-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";
-echo "<li>The quick look analysis includes all data, i.e. no data selection done.</li>\n";
-//echo "<li><b>NO data check</b> is included in the analysis.</li>";
-echo "<li>The shown curves are not fluxes but <b>excess rates</b> (number of excess events per effective ontime), \n";
-echo "i.e. there is a dependence on trigger threshold and zenith distance of the observation (with the current \n";
-echo "analysis for zenith distance > 40 degree and trigger threshold > 500 DAC counts).</li>\n";
-//echo "i.e. a dependence on trigger threshold and zenith distance of the observation is expected ";
-//echo "for zenith distance larger than 40 degree and very strong moon light.</li>";
-//echo "<li><b>NO corrections</b> for the dependence on zenith distance and trigger threshold of the observation are applied so far.</li>";
-//echo "<li>This webpage shows the <b>excess rates</b> (black), i.e. number of excess events ";
-//echo "(signal minus background in the signal region) devided by the ontime of the observation, ";
-//echo "and the <b>background rates</b> (blue), i.e. number of background events devided by ontime. </li>";
-echo "<li>The curves are provided with 20 min binning and nightly binning.</li>\n";
-echo "<li>In case, you need further details about the data or a different binning, please do not hesitate to contact us.</li>\n";
-echo "<li>QLA results are available for the data since 12.12.2012. For older data, please contact us.</li>\n";
-echo "<li>New software versions were introduced at the following dates: 24.5.2014</li>\n";
-echo "</ul>";
-echo "If you intend to use the data or information from this website, please let us know for reference.<br>\n";
-echo "<big><b>Please cite this webpage and the ";
-echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/8/06/P06008'>FACT design paper</a>\n ";
-echo "when using information from this webpage or any FACT data.</b></big>\n";
-echo "<br><br>\n \n ";
-echo "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 ";
-echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/8/06/P06008'>open access</a>\n<br>\n";
-echo "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 ";
-echo "<a target='_blank' href='http://iopscience.iop.org/1748-0221/9/10/P10012/'>open access</a>\n<br><br>\n";
-echo "Contact: Daniela Dorner <i>dorner&lt;at&gt;astro.uni-wuerzburg.de</i>.<br>";
-//echo "You acknowledge these regulations by clicking on the 'Show' button.</b></big> <br><br><br>";
-
-/*
-$ranges=array(
-//              "5min" => " 5 min",
-//              "10min" => "10 min",
-              "20min" => "20 min",
-              "30min" => "30 min",
-              "40min" => "40 min",
-              "60min" => "60 min",
-              "90min" => "90 min",
-              "120min" => "120 min",
-              "180min" => "180 min",
-              "240min" => "240 min",
-              "300min" => "300 min",
-              "360min" => "360 min",
-//              "0001nights" => "1 night",
-//              "0002nights" => "2 nights",
-//              "0004nights" => "4 nights",
-//              "0008nights" => "8 nights",
-//              "0016nights" => "16 nights",
-              );
-
-echo "</body>";
-echo "</html>";
-*/
-//$dom = new DOMDocument();
-//$dom->loadHTML("download.php");
-//echo $dom->getElementById("logged");
-
-?>
-</body>
-</html>
