source: trunk/www/dch/lightcurves.php@ 15404

Last change on this file since 15404 was 15404, checked in by Daniela Dorner, 12 years ago
implemented date-menu and weekly plots
File size: 3.4 KB
Line 
1<html>
2<head>
3 <meta name="Author" content="Daniela Dorner" />
4 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5 <title>QLA</title>
6 <link rel="StyleSheet" type="text/css" href="../style.css" />
7</head>
8<?php
9
10//echo (file_get_contents("header.html"));
11
12include ("dates.php");
13
14if (!empty($_GET["bin"]))
15 $bin=$_GET["bin"];
16else
17 $bin="1nights";
18//$path="../lightcurves/".$_GET["source"]."/lightcurve".$bin;
19
20$sources=array(
21 "1" => "Mrk421",
22 "2" => "Mrk501",
23 "5" => "Crab",
24 "7" => "1ES 1959+650",
25 "11" => "IC 310",
26 );
27
28$ranges=array(
29 "5min" => " 5 min",
30 "10min" => "10 min",
31 "20min" => "20 min",
32 "30min" => "30 min",
33 "40min" => "40 min",
34 "60min" => "60 min",
35 "80min" => "80 min",
36 "120min" => "120 min",
37 "180min" => "180 min",
38 "240min" => "240 min",
39 "300min" => "300 min",
40// "0001nights" => "1 night",
41// "0002nights" => "2 nights",
42// "0004nights" => "4 nights",
43// "0008nights" => "8 nights",
44// "0016nights" => "16 nights",
45 );
46
47echo "<body>\n";
48echo "<form name='formular' action='lightcurves.php' METHOD='GET'>\n";
49echo "<input type='submit' value='Show'> result of Quick-Look-Analysis for ";
50
51echo "source <select name='source' size='1'>\n";
52foreach ($sources as $key => $name)
53{
54 if ($_GET["source"] == $key)
55 printf("<option value='%s' selected>%s</option>\n", $key, $name);
56 else
57 printf("<option value='%s'>%s</option>\n", $key, $name);
58}
59echo "</select>\n";
60echo " for <select name='bin' size='1'>\n";
61foreach ($ranges as $range => $name)
62{
63 if ($_GET["bin"] == $range)
64 printf("<option value='%s' selected>%s</option>\n", $range, $name);
65 else
66 printf("<option value='%s'>%s</option>\n", $range, $name);
67}
68echo "</select>\n<br>\n";
69
70$date=GetDates($_GET["date"], "lightcurves");
71$date2=date("Ymd", strtotime($date));
72$path="../lightcurves/".date("Y/m/d", strtotime($date));
73
74echo "</form>\n";
75
76$numplots=8;
77
78$filename="lightcurve".$_GET["source"]."_".$_GET["bin"]."_all.root";
79$filename2="lightcurve".$_GET["source"]."_".$_GET["bin"]."_week.root";
80$filename3="lightcurve".$_GET["source"]."_".$_GET["bin"]."_".$date2.".root";
81$rootfile=$path."/".$filename2;
82//echo $filename;
83if (file_exists($rootfile))
84{
85 printf("<a href='%s'>more files</a>", $path);
86 echo "<table>";
87 printf("<tr><th>Night %s</th><th>Last Week</th><th>All Nights</th></tr>\n", $date);
88 for ($i=1; $i<$numplots+1; $i++)
89 {
90 if (strpos($_GET["bin"], "night"))
91 printf("<tr><td><img src='%s/%s-%d.png' alt='%d'></td></tr>", $path, $filename, $i, $i);
92 else
93 {
94 printf("<tr>\n");
95 printf("<td><img src='%s/%s-%d.png' alt='%d'></td>\n", $path, $filename3, $i, $i);
96 printf("<td><img src='%s/%s-%d.png' alt='%d'></td>\n", $path, $filename2, $i, $i);
97 printf("<td><img src='%s/%s-%d.png' alt='%d'></td>\n", $path, $filename, $i, $i);
98 printf("</tr>\n");
99 }
100 }
101 echo "</table>";
102}
103else
104 echo "<br> No files available for " . $sources[$_GET["source"]] . " with " . $ranges[$_GET["bin"]]. " for night ".$date.". <br>";
105
106echo "</body>";
107echo "</html>";
108?>
Note: See TracBrowser for help on using the repository browser.