IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2019, 9:47:12 PM (7 years ago)
Author:
cclin33
Message:

sync from trunk with r40973

Location:
branches/ccl_branches/ipp-20190806/ippMonitor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ccl_branches/ipp-20190806/ippMonitor

  • branches/ccl_branches/ipp-20190806/ippMonitor/raw/czartool_labels.php

    r40853 r40974  
    399399        $qry2->fetchInto($summit);
    400400
     401
    401402        $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name WHERE summitExp.dateobs > '$date' AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'";
    402403        $qry2 = $projectdb->query($sql);
     
    407408        $qry2->fetchInto($dropped);
    408409
     410
     411        #Query with 30 minutes delay to check during the night if any exposures are missing.
     412        $datehour = gmdate("Y-m-d H:i:s");
     413        $sql = "SELECT COUNT(*) FROM summitExp left join pzDownloadExp using (summit_id) WHERE dateobs > '$date' AND dateobs <= date_sub('$datehour', interval 30 minute) AND exp_type = '$expType[0]' and (state != 'drop' or state is null) and fault != 1042";
     414        $qry2 = $projectdb->query($sql);
     415        $qry2->fetchInto($summitdelay);
     416
     417        $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name WHERE summitExp.dateobs > '$date' AND summitExp.dateobs <= date_sub('$datehour', interval 30 minute) AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'";
     418        $qry2 = $projectdb->query($sql);
     419        $qry2->fetchInto($mhpccdelay);
     420
    409421        echo "<tr>";
    410422
    411         if ($summit[0] == $mhpcc[0]) $error = 0;
     423        $DLdiff = $summit[0] - $mhpcc[0];
     424        if ($DLdiff == 0) $error = 0;
    412425        else $error = 1;
     426
     427        $delayDLdiff = $summitdelay[0] - $mhpccdelay[0];
     428        if ($delayDLdiff == 0) $errordelay = 0;
     429        else $errordelay = 1;
    413430
    414431        echo "<td>$expType[0]</td>";
    415432        echo "<td>$summit[0]</td>";
    416         createFormattedTableCell("", "", $mhpcc[0], $error, 0);
     433        #createFormattedTableCell("", "", $mhpcc[0], $error, 0);
     434        if ($delayDLdiff==0) {
     435           createFormattedTableCell("", "", $mhpcc[0], $error, 0);
     436        } else {
     437           $DLStatus = "<font style=\"BACKGROUND-COLOR: yellow\"  color=\"red\">$mhpcc[0] ($delayDLdiff)</font>";
     438           echo "<td>$DLStatus</td>";
     439        }
     440
    417441        echo "<td>$dropped[0]</td>";
    418442
     
    440464    }
    441465    $qry->fetchInto($refExpID);
     466    if ($refExpID[0] = 'NULL') {
     467        $refExpID[0] = 0;
     468    }
    442469
    443470    #Find the number of chunks
     
    482509    createTableColumnHeader("Chunk");
    483510    createTableColumnHeader("Nobs_1stvisit");
    484     createTableColumnHeader("Nobs_4visits");
     511    createTableColumnHeader("Nobs_4visits(bad cam)");
    485512    createTableColumnHeader("Ndiffs_published");
    486513    createTableColumnHeader("Completion");
     
    492519        $Nfirstvisits = 0;
    493520        $Nfourvisits = 0;
     521        $badcam = 0;
    494522
    495523        $chunkname = $row[0];
     
    533561        }
    534562
     563        #also query for bad quality camRun exposures
     564        $query4 = "SELECT count(*) ";
     565        $query4 .= " FROM rawExp";
     566        $query4 .= " JOIN chipRun USING (exp_id)";
     567        $query4 .= " JOIN camRun USING (chip_id)";
     568        $query4 .= " JOIN camProcessedExp USING (cam_id)";
     569        $query4 .= " WHERE dateobs LIKE '$date%'";
     570        $query4 .= " AND exp_id > $refExpID[0]";
     571        $query4 .= " AND exp_type = 'OBJECT'";
     572        $query4 .= " AND substr(comment, 1, position(' ' in comment)) LIKE '$chunkname%'";
     573        $query4 .= " AND (camProcessedExp.quality > 0)";
     574        $qry4 = $projectdb->query($query4);
     575        $qry4->fetchInto($badcam);
     576
     577
     578
    535579        echo "<tr>";
    536580
    537581        echo "<td>$chunkname</td>";
    538582        echo "<td>$Nfirstvisits</td>";
    539         echo "<td>$Nfourvisits</td>";
     583        if ($badcam[0]==0) {
     584           echo "<td>$Nfourvisits</td>";
     585        } else {
     586           $DLStatus = "<font style=\"BACKGROUND-COLOR: yellow\"  color=\"red\">$Nfourvisits ($badcam[0])</font>";
     587           echo "<td>$DLStatus</td>";
     588        }
    540589        echo "<td>$Ndiffs</td>";
    541590        echo "<td>$complete</td>";
     
    944993    foreach ($servers as &$server) {
    945994
    946         getServerStatus($db, $server, $alive, $running);
     995        getServerStatus($db,$proj, $server, $alive, $running);
    947996
    948997        echo "<tr>\n";
     
    10361085#
    10371086###########################################################################
    1038 function getServerStatus($db, $server, &$alive, &$running) {
    1039 
    1040     $sql = "SELECT alive, running FROM servers WHERE server LIKE '$server' ORDER BY timestamp DESC LIMIT 1";
     1087function getServerStatus($db,$proj, $server, &$alive, &$running) {
     1088
     1089    $sql = "SELECT alive, running FROM science_servers WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY timestamp DESC LIMIT 1";
    10411090    if($debug){echo "$sql<br>";}
    10421091
Note: See TracChangeset for help on using the changeset viewer.