IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29320


Ignore:
Timestamp:
Oct 5, 2010, 9:42:28 AM (16 years ago)
Author:
rhenders
Message:

Added option to plot a single day's worth of data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czarplot.pl

    r29119 r29320  
    1717my $begin = undef;
    1818my $end = undef;
     19my $day = undef;
    1920my $path = undef;
    2021my $verbose = undef;
     
    3233        "begin|b=s" => \$begin,
    3334        "end|e=s" => \$end,
     35        "day|d=s" => \$day,
    3436        "output|o=s" => \$path,
    3537        "histogram|h" => \$histogram,
     
    6466    print "* OPTIONAL: choose time interval in past    -i <'1 hour'|'1 day'|etc>   (default=none\n";}
    6567if (!$begin) {
    66     print "* OPTIONAL: choose a begin time             -b <datetime>               (default=7am this morning)\n";}
     68    print "* OPTIONAL: choose a begin time             -b <datetime>               (default=6:35am this morning)\n";}
    6769if (!$end) {
    6870    print "* OPTIONAL: choose an end time              -e <datetime>               (default=now)\n";}
     71if (!$day) {
     72    print "* OPTIONAL: choose a single day to plot     -d <date>                   (default=today)\n";}
    6973if (!$path) {
    7074    print "* OPTIONAL: choose an output location       -o <path>                   (default=none)\n";
     
    8488$czarDb->setDateFormat("%Y%m%d-%H%i%s");
    8589
    86 
    87 # GENE PLOTS my $plotter = new czartool::Plotter($czarDb, "%Y%m%d-%H%M%S", $savingToFile ? "png size 1280,960 font \"/usr/share/fonts/corefonts/arial.ttf\" 12" : "X11", $path, $save_temps);
    88 my $plotter = new czartool::Plotter($czarDb, "%Y%m%d-%H%M%S", $savingToFile ? "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8" : "X11", $path, $save_temps);
     90my $plotter = new czartool::Plotter(
     91        $czarDb,
     92        "%Y%m%d-%H%M%S",
     93        $savingToFile ? "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8" : "X11",
     94        $path,
     95        $save_temps);
    8996
    9097# sort out times
    91 if (!$end) {$end = $czarDb->getNowTimestamp();}
    92 if (!$begin) {
    93     if ($interval) {$begin = $czarDb->subtractInterval($end, $interval);}
    94     else {$begin =  strftime('%Y-%m-%d 06:35',localtime);}
     98if($day) {
     99    $end = "$day 23:59";
     100    $begin =  "$day 06:35";
    95101}
     102else {
    96103
     104    if (!$end) {$end = $czarDb->getNowTimestamp();}
     105    if (!$begin) {
     106
     107        if ($interval) {$begin = $czarDb->subtractInterval($end, $interval);}
     108        else {$begin =  strftime('%Y-%m-%d 06:35',localtime);}
     109    }
     110}
    97111my $diskUsage = 1; # TODO
    98112
Note: See TracChangeset for help on using the changeset viewer.