Index: /trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- /trunk/ippMonitor/raw/czartool_labels.php	(revision 41201)
+++ /trunk/ippMonitor/raw/czartool_labels.php	(revision 41202)
@@ -464,9 +464,11 @@
     #do a query of raw/chip/cam/warp counts for this night, split by chunk. 
     #we need to do a subquery to find the total number of skycells in warpSkyfile, as well as the number of those with a bad quality
-    $query = "SELECT suba.chunk,suba.Nvis1,suba.Nvis2,suba.Nvis3,suba.Nvis4,suba.Ncamgood,suba.Ncambad,subb.Nwarpgood,subb.Nwarpbad FROM ";
+    $query = "SELECT suba.chunk,suba.Nvis1,suba.Nvis2,suba.Nvis3,suba.Nvis4,suba.Ncamgood,suba.Ncambad,subb.Nwarpgood,subb.Nwarpbad,suba.uniNvis1,suba.uniNvis2,suba.uniNvis3,suba.uniNvis4 FROM ";
     $query .= "    (SELECT substr(comment, 1, position(' ' in comment)) AS chunk,count(if(rawExp.comment LIKE '%visit 1%',1,NULL)) AS Nvis1,";
     $query .= "    count(if(rawExp.comment LIKE '%visit 2%',1,NULL)) AS Nvis2,count(if(rawExp.comment LIKE '%visit 3%',1,NULL)) AS Nvis3,";
     $query .= "    count(if(rawExp.comment LIKE '%visit 4%',1,NULL)) AS Nvis4, count(if(camProcessedExp.sigma_ra <= 5 AND camProcessedExp.sigma_dec <= 5 AND camProcessedExp.quality = 0,1,NULL)) AS Ncamgood,";
-    $query .= "    count(if(camProcessedExp.sigma_ra > 5 OR camProcessedExp.sigma_dec > 5 OR camProcessedExp.quality > 0,1,NULL)) AS Ncambad";
+    $query .= "    count(if(camProcessedExp.sigma_ra > 5 OR camProcessedExp.sigma_dec > 5 OR camProcessedExp.quality > 0,1,NULL)) AS Ncambad, COUNT(DISTINCT CASE WHEN rawExp.comment LIKE '%visit 1%' THEN rawExp.comment END) AS uniNvis1,";
+    $query .= "    COUNT(DISTINCT CASE WHEN rawExp.comment LIKE '%visit 2%' THEN rawExp.comment END) AS uniNvis2,COUNT(DISTINCT CASE WHEN rawExp.comment LIKE '%visit 3%' THEN rawExp.comment END) AS uniNvis3,";
+    $query .= "    COUNT(DISTINCT CASE WHEN rawExp.comment LIKE '%visit 4%' THEN rawExp.comment END) AS uniNvis4";
     $query .= "    FROM rawExp LEFT JOIN chipRun USING (exp_id) LEFT JOIN camRun USING (chip_id) JOIN camProcessedExp USING (cam_id) LEFT JOIN fakeRun USING (cam_id) LEFT JOIN warpRun USING (fake_id)";
     $query .= "    WHERE dateobs like '$date%' AND exp_id > $refExpID[0] AND exp_type = 'OBJECT' AND rawExp.comment like '%visit%'";
@@ -522,4 +524,8 @@
         $NexpWWdiff = 0;
         $Npubwarps = 0;
+        $uniNvis1 = 0;
+        $uniNvis2 = 0;
+        $uniNvis3 = 0;
+        $uniNvis4 = 0;
 
         $chunkname = $row[0];
@@ -532,4 +538,8 @@
         if($row[7] > 0) $Nwarpgood = $row[7];
         if($row[8] > 0) $Nwarpbad = $row[8];
+        if($row[9] > 0) $uniNvis1 = $row[9];
+        if($row[10] > 0) $uniNvis2 = $row[10];
+        if($row[11] > 0) $uniNvis3 = $row[11];
+        if($row[12] > 0) $uniNvis4 = $row[12];
 
         #set flags if present
@@ -603,12 +613,11 @@
         if(($NWWdiffbad >= 1) or ($NWSdiffbad >= 1)) $baddiffflag = 1;
 
-        if ($Nvis1 != $Nvis4) {
+        if (($uniNvis1 != $uniNvis2) or ($uniNvis1 != $uniNvis3) or ($uniNvis1 != $uniNvis4)) {
           if ($NWWdiffpub != $NexpWWdiff) $complete = "chunk incomplete, not done";  
           if ($NWWdiffpub == $NexpWWdiff) $complete = "chunk incomplete, done";  
         }
-        if ($Nvis1 == $Nvis4) {
+        if (($uniNvis1 == $uniNvis2) and ($uniNvis1 == $uniNvis3) and ($uniNvis1 == $uniNvis4)) {
           if ($NWWdiffpub != $NexpWWdiff) $complete = "chunk complete, not done";  
           if ($NWWdiffpub == $NexpWWdiff) $complete = "chunk complete, done";  
-
         }
 
Index: /trunk/ippMonitor/raw/ipp.plots.dat
===================================================================
--- /trunk/ippMonitor/raw/ipp.plots.dat	(revision 41201)
+++ /trunk/ippMonitor/raw/ipp.plots.dat	(revision 41202)
@@ -9,5 +9,4 @@
 menulink  | menuselect      | link    | Simple plot - skycal                | simplePlotSkycalImage.php
 menulink  | menuselect      | link    | Simple plot - fforce                | simplePlotFullForceImage.php
-menulink  | menuselect      | link    | Simple plot - chip queue            | simplePlotChipQueue.php
 menulink  | menuselect      | link    | Simple plot - diff                  | simplePlotDiffImage.php
 menulink  | menuselect      | link    | Subset plot - diff                  | subsetPlotDiffImage.php
