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

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