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

Last change on this file since 16036 was 15475, checked in by Daniela Dorner, 12 years ago
fixed bug in timebin list
File size: 3.9 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 "90min" => "90 min",
36 "120min" => "120 min",
37 "180min" => "180 min",
38 "240min" => "240 min",
39 "300min" => "300 min",
40 "360min" => "360 min",
41// "0001nights" => "1 night",
42// "0002nights" => "2 nights",
43// "0004nights" => "4 nights",
44// "0008nights" => "8 nights",
45// "0016nights" => "16 nights",
46 );
47
48echo "<body>\n";
49echo "<form name='formular' action='lightcurves.php' METHOD='GET'>\n";
50echo "<input type='submit' value='Show'> result of Quick-Look-Analysis for ";
51
52echo "source <select name='source' size='1'>\n";
53foreach ($sources as $key => $name)
54{
55 if ($_GET["source"] == $key)
56 printf("<option value='%s' selected>%s</option>\n", $key, $name);
57 else
58 printf("<option value='%s'>%s</option>\n", $key, $name);
59}
60echo "</select>\n";
61echo " for <select name='bin' size='1'>\n";
62foreach ($ranges as $range => $name)
63{
64 if ($_GET["bin"] == $range)
65 printf("<option value='%s' selected>%s</option>\n", $range, $name);
66 else
67 printf("<option value='%s'>%s</option>\n", $range, $name);
68}
69echo "</select>\n<br>\n";
70
71$date=GetDates($_GET["date"], "lightcurves");
72$date2=date("Ymd", strtotime($date));
73$path="../lightcurves/".date("Y/m/d", strtotime($date));
74
75echo "</form>\n";
76
77$numplots=8;
78
79$filename="lightcurve".$_GET["source"]."_".$_GET["bin"]."_all.root";
80$filename2="lightcurve".$_GET["source"]."_".$_GET["bin"]."_week.root";
81$filename3="lightcurve".$_GET["source"]."_".$_GET["bin"]."_".$date2.".root";
82$rootfile=$path."/".$filename2;
83//echo $filename;
84if (file_exists($rootfile))
85{
86 printf("<a href='%s'>more files</a>", $path);
87 echo "<table>";
88 printf("<tr><th>Night %s</th><th>Last Week</th><th>All Nights</th></tr>\n", $date);
89 for ($i=1; $i<$numplots+1; $i++)
90 {
91 if (strpos($_GET["bin"], "night"))
92 printf("<tr><td><img src='%s/%s-%d.png' alt='%d'></td></tr>", $path, $filename, $i, $i);
93 else
94 {
95 printf("<tr>\n");
96 $file3=$path."/".$filename3."-".$i.".png";
97 //echo $file3;
98 if (file_exists($file3))
99 printf("<td><img src='%s/%s-%d.png' alt='%d'></td>\n", $path, $filename3, $i, $i);
100 else
101 printf("<td>n/a</td>");
102 $file2=$path."/".$filename2."-".$i.".png";
103 if (file_exists($file2))
104 printf("<td><img src='%s/%s-%d.png' alt='%d'></td>\n", $path, $filename2, $i, $i);
105 else
106 printf("<td>n/a</td>");
107 $file1=$path."/".$filename."-".$i.".png";
108 if (file_exists($file1))
109 printf("<td><img src='%s/%s-%d.png' alt='%d'></td>\n", $path, $filename, $i, $i);
110 else
111 printf("<td>n/a</td>");
112 printf("</tr>\n");
113 }
114 }
115 echo "</table>";
116}
117else
118 echo "<br> No files available for " . $sources[$_GET["source"]] . " with " . $ranges[$_GET["bin"]]. " for night ".$date.". <br>";
119
120echo "</body>";
121echo "</html>";
122?>
Note: See TracBrowser for help on using the repository browser.