| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | echo (file_get_contents("header.html"));
|
|---|
| 4 |
|
|---|
| 5 | if (!empty($_GET["bin"]))
|
|---|
| 6 | $bin=$_GET["bin"];
|
|---|
| 7 | else
|
|---|
| 8 | $bin="1nights";
|
|---|
| 9 | $path="../lightcurves/".$_GET["source"]."/lightcurve".$bin;
|
|---|
| 10 |
|
|---|
| 11 | $sources=array(
|
|---|
| 12 | "1" => "Mrk421",
|
|---|
| 13 | "2" => "Mrk501",
|
|---|
| 14 | "5" => "Crab",
|
|---|
| 15 | "7" => "1ES 1959+650",
|
|---|
| 16 | "11" => "IC 310",
|
|---|
| 17 | );
|
|---|
| 18 |
|
|---|
| 19 | $ranges=array(
|
|---|
| 20 | "005min" => " 5 min",
|
|---|
| 21 | "010min" => "10 min",
|
|---|
| 22 | "020min" => "20 min",
|
|---|
| 23 | "040min" => "40 min",
|
|---|
| 24 | "080min" => "80 min",
|
|---|
| 25 | "160min" => "160 min",
|
|---|
| 26 | "320min" => "320 min",
|
|---|
| 27 | "0001nights" => "1 night",
|
|---|
| 28 | "0002nights" => "2 nights",
|
|---|
| 29 | "0004nights" => "4 nights",
|
|---|
| 30 | "0008nights" => "8 nights",
|
|---|
| 31 | "0016nights" => "16 nights",
|
|---|
| 32 | );
|
|---|
| 33 |
|
|---|
| 34 | echo "<body>";
|
|---|
| 35 | echo "<form action='lightcurves.php' METHOD='GET'>\n";
|
|---|
| 36 | echo "<input type='submit' value='Show'> excess rates for ";
|
|---|
| 37 | echo "source <select name='source' size='1'>";
|
|---|
| 38 | foreach ($sources as $key => $name)
|
|---|
| 39 | {
|
|---|
| 40 | if ($_GET["source"] == $key)
|
|---|
| 41 | printf("<option value='%s' selected>%s</option>", $key, $name);
|
|---|
| 42 | else
|
|---|
| 43 | printf("<option value='%s'>%s</option>", $key, $name);
|
|---|
| 44 | }
|
|---|
| 45 | echo "</select>";
|
|---|
| 46 | echo " for <select name='bin' size='1'>";
|
|---|
| 47 | foreach ($ranges as $range => $name)
|
|---|
| 48 | {
|
|---|
| 49 | if ($_GET["bin"] == $range)
|
|---|
| 50 | printf("<option value='%s' selected>%s</option>", $range, $name);
|
|---|
| 51 | else
|
|---|
| 52 | printf("<option value='%s'>%s</option>", $range, $name);
|
|---|
| 53 | }
|
|---|
| 54 | echo "</select>";
|
|---|
| 55 | echo "</form>";
|
|---|
| 56 |
|
|---|
| 57 | $numplots=7;
|
|---|
| 58 |
|
|---|
| 59 | if (file_exists($path."/lc.root"))
|
|---|
| 60 | {
|
|---|
| 61 | printf("<a href='%s'>more files</a>", $path);
|
|---|
| 62 | echo "<table>";
|
|---|
| 63 | for ($i=1; $i<$numplots+1; $i++)
|
|---|
| 64 | {
|
|---|
| 65 | if (strpos($_GET["bin"], "night"))
|
|---|
| 66 | printf("<tr><td><img src='%s/lc.root-%d.png' alt='%d'></td></tr>", $path, $i, $i);
|
|---|
| 67 | else
|
|---|
| 68 | printf("<tr><td><img src='%s/lc.root-%d.png' alt='%d'></td><td><img src='%s/lc.root-%d.png' alt='%d'></td></tr>", $path, $i, $i, $path, $i+$numplots, $i+$numplots);
|
|---|
| 69 | }
|
|---|
| 70 | echo "</table>";
|
|---|
| 71 | }
|
|---|
| 72 | else
|
|---|
| 73 | echo "<br> No files yet for " . $sources[$_GET["source"]] . " with " . $ranges[$_GET["bin"]]. ". <br>";
|
|---|
| 74 |
|
|---|
| 75 | echo "</body>";
|
|---|
| 76 | echo "</html>";
|
|---|
| 77 | ?>
|
|---|