IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40883


Ignore:
Timestamp:
Sep 12, 2019, 11:30:59 AM (7 years ago)
Author:
tdeboer
Message:

change to the display of chunks, that now includes flagging bad quality camera images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/czartool_labels.php

    r40862 r40883  
    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
     
    482506    createTableColumnHeader("Chunk");
    483507    createTableColumnHeader("Nobs_1stvisit");
    484     createTableColumnHeader("Nobs_4visits");
     508    createTableColumnHeader("Nobs_4visits(bad cam)");
    485509    createTableColumnHeader("Ndiffs_published");
    486510    createTableColumnHeader("Completion");
     
    492516        $Nfirstvisits = 0;
    493517        $Nfourvisits = 0;
     518        $badcam = 0;
    494519
    495520        $chunkname = $row[0];
     
    533558        }
    534559
     560        #also query for bad quality camRun exposures
     561        $query4 = "SELECT count(*) ";
     562        $query4 .= " FROM rawExp";
     563        $query4 .= " JOIN chipRun USING (exp_id)";
     564        $query4 .= " JOIN camRun USING (chip_id)";
     565        $query4 .= " JOIN camProcessedExp USING (cam_id)";
     566        $query4 .= " WHERE dateobs LIKE '$date%'";
     567        $query4 .= " AND exp_id > $refExpID[0]";
     568        $query4 .= " AND exp_type = 'OBJECT'";
     569        $query4 .= " AND substr(comment, 1, position(' ' in comment)) LIKE '$chunkname%'";
     570        $query4 .= " AND (camProcessedExp.quality > 0)";
     571        $qry4 = $projectdb->query($query4);
     572        $qry4->fetchInto($badcam);
     573
     574
     575
    535576        echo "<tr>";
    536577
    537578        echo "<td>$chunkname</td>";
    538579        echo "<td>$Nfirstvisits</td>";
    539         echo "<td>$Nfourvisits</td>";
     580        if ($badcam[0]==0) {
     581           echo "<td>$Nfourvisits</td>";
     582        } else {
     583           $DLStatus = "<font style=\"BACKGROUND-COLOR: yellow\"  color=\"red\">$Nfourvisits ($badcam[0])</font>";
     584           echo "<td>$DLStatus</td>";
     585        }
    540586        echo "<td>$Ndiffs</td>";
    541587        echo "<td>$complete</td>";
Note: See TracChangeset for help on using the changeset viewer.