IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 5, 2010, 3:54:50 PM (16 years ago)
Author:
rhenders
Message:

major changes to support generaionof IPP metrics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czartool/Gpc1Db.pm

    r28924 r29686  
    5656
    5757    return "ERROR";
     58}
     59
     60###########################################################################
     61#
     62# Returns the number of science exposures taken 'last night' for a given day
     63#
     64# Notes:
     65#
     66# - 03:00 HST = 17:00 last night UTC
     67# - 17:00 HST = 07:00 this morning UTC
     68# - 'OBJECT' = science exposures
     69#
     70###########################################################################
     71sub countScienceExposuresFromLastNight {
     72    my ($self, $day) = @_;
     73
     74    my $begin = "$day 03";
     75    my $end = "$day 17";
     76
     77    my $query = $self->{_db}->prepare(<<SQL);
     78    SELECT COUNT(*)
     79        FROM summitExp
     80        WHERE dateobs > '$begin'
     81        AND dateobs < '$end' AND
     82        exp_type = 'OBJECT';
     83SQL
     84
     85    $query->execute;
     86return scalar $query->fetchrow_array();
    5887}
    5988
     
    158187    }
    159188
    160 
    161189    $query->execute;
    162190    return scalar $query->fetchrow_array();
Note: See TracChangeset for help on using the changeset viewer.