Ignore:
Timestamp:
04/21/13 02:02:30 (12 years ago)
Author:
Daniela Dorner
Message:
implemented date-menu and weekly plots
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/dch/lightcurves.php

    r15313 r15404  
     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>
    18<?php
    29
    3 echo (file_get_contents("header.html"));
     10//echo (file_get_contents("header.html"));
     11
     12include ("dates.php");
    413
    514if (!empty($_GET["bin"]))
     
    716else
    817    $bin="1nights";
    9 $path="../lightcurves/".$_GET["source"]."/lightcurve".$bin;
     18//$path="../lightcurves/".$_GET["source"]."/lightcurve".$bin;
    1019
    1120$sources=array(
     
    1827
    1928$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",
     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",
    3245              );
    3346
    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'>";
     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";
    3852foreach ($sources as $key => $name)
    3953{
    4054    if ($_GET["source"] == $key)
    41         printf("<option value='%s' selected>%s</option>", $key, $name);
     55        printf("<option value='%s' selected>%s</option>\n", $key, $name);
    4256    else
    43         printf("<option value='%s'>%s</option>", $key, $name);
     57        printf("<option value='%s'>%s</option>\n", $key, $name);
    4458}
    45 echo "</select>";
    46 echo " for <select name='bin' size='1'>";
     59echo "</select>\n";
     60echo " for <select name='bin' size='1'>\n";
    4761foreach ($ranges as $range => $name)
    4862{
    4963    if ($_GET["bin"] == $range)
    50         printf("<option value='%s' selected>%s</option>", $range, $name);
     64        printf("<option value='%s' selected>%s</option>\n", $range, $name);
    5165    else
    52         printf("<option value='%s'>%s</option>", $range, $name);
     66        printf("<option value='%s'>%s</option>\n", $range, $name);
    5367}
    54 echo "</select>";
    55 echo "</form>";
     68echo "</select>\n<br>\n";
    5669
    57 $numplots=7;
     70$date=GetDates($_GET["date"], "lightcurves");
     71$date2=date("Ymd", strtotime($date));
     72$path="../lightcurves/".date("Y/m/d", strtotime($date));
    5873
    59 if (file_exists($path."/lc.root"))
     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))
    6084{
    6185    printf("<a href='%s'>more files</a>", $path);
    6286    echo "<table>";
     87    printf("<tr><th>Night %s</th><th>Last Week</th><th>All Nights</th></tr>\n", $date);
    6388    for ($i=1; $i<$numplots+1; $i++)
    6489    {
    6590        if (strpos($_GET["bin"], "night"))
    66             printf("<tr><td><img src='%s/lc.root-%d.png' alt='%d'></td></tr>", $path, $i, $i);
     91            printf("<tr><td><img src='%s/%s-%d.png' alt='%d'></td></tr>", $path, $filename, $i, $i);
    6792        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);
     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        }
    69100    }
    70101    echo "</table>";
    71102}
    72103else
    73     echo "<br> No files yet for " . $sources[$_GET["source"]] . " with " . $ranges[$_GET["bin"]]. ". <br>";
     104    echo "<br> No files available for " . $sources[$_GET["source"]] . " with " . $ranges[$_GET["bin"]]. " for night ".$date.". <br>";
    74105
    75106echo "</body>";
Note: See TracChangeset for help on using the changeset viewer.