Index: branches/eam_branches/ipp-20120905/ippMonitor/Makefile.in
===================================================================
--- branches/eam_branches/ipp-20120905/ippMonitor/Makefile.in	(revision 34428)
+++ branches/eam_branches/ipp-20120905/ippMonitor/Makefile.in	(revision 34466)
@@ -14,4 +14,5 @@
 PROGRAMS = \
 $(DESTBIN)/skyplot.dvo \
+$(DESTBIN)/skycellplot.dvo \
 $(DESTBIN)/czartool_getServerStatus.pl \
 $(DESTBIN)/czartool_revert.pl \
@@ -57,4 +58,5 @@
 $(DESTWWW)/simplePlotraw.php \
 $(DESTWWW)/skyplot.php \
+$(DESTWWW)/skycellplot.php \
 $(DESTWWW)/getimage.php \
 $(DESTWWW)/ipp.czartool.dat \
@@ -211,4 +213,7 @@
 $(DESTWWW)/simplePlotChipImage.php \
 $(DESTWWW)/simplePlotCamImage.php \
+$(DESTWWW)/simplePlotStackImage.php \
+$(DESTWWW)/simplePlotStaticskyImage.php \
+$(DESTWWW)/simplePlotSkycalImage.php \
 $(DESTWWW)/histogramBackgroundImage.php \
 $(DESTWWW)/histogramCamProcessedExpImage.php \
Index: branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotCamImage.d
===================================================================
--- branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotCamImage.d	(revision 34428)
+++ branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotCamImage.d	(revision 34466)
@@ -1,3 +1,3 @@
-TABLE camRun, chipRun, rawExp
+TABLE camProcessedExp, camRun, chipRun, rawExp
 TITLE New sky plot - cam
 FILE  simplePlotCamImage.php
@@ -7,4 +7,5 @@
 WHERE chipRun.exp_id = rawExp.exp_id
 WHERE camRun.chip_id = chipRun.chip_id
+WHERE camProcessedExp.cam_id = camRun.cam_id
 
 #    field                size  format  name           show     link to         extras
@@ -24,4 +25,5 @@
 FIELD rawExp.bg,                  5, %.2f,   backgnd, 	      restrict
 FIELD rawExp.bg_stdev,            5, %.2f,   stdev, 	      restrict
+FIELD camProcessedExp.fwhm_major, 5, %.2f,   FWHM_major,      restrict      
 
 # What to plot
Index: branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotSkycalImage.d
===================================================================
--- branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotSkycalImage.d	(revision 34466)
+++ branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotSkycalImage.d	(revision 34466)
@@ -0,0 +1,29 @@
+TABLE skycalRun, skycalResult, stackRun, skycell 
+TITLE New sky plot - skycal
+FILE  simplePlotSkycalImage.php
+MENU  ipp.plots.dat
+
+WHERE skycalRun.state != 'new' 
+WHERE skycalRun.skycal_id = skycalResult.skycal_id
+WHERE skycalRun.stack_id = stackRun.stack_id
+WHERE stackRun.skycell_id = skycell.skycell_id
+WHERE stackRun.tess_id = skycell.tess_id
+
+#    field                size  format  name           show     link to         extras
+FIELD skycalRun.skycal_id,	  5, %d,     Skycal ID,       restrict
+FIELD staticskyRun.sky_id,	  5, %d,     Staticsky ID,    restrict
+FIELD stackRun.stack_id,          5, %d,     Stack ID,        restrict
+FIELD skycalRun.label,           10, %s,     Label, 	      restrict
+FIELD skycell.radeg,             10, %.6f,   RA (deg), 	      restrict
+FIELD skycell.decdeg,            10, %.6f,   DEC (deg),       restrict
+FIELD stackRun.filter,           10, %s,     FILTER, 	      restrict
+FIELD skycalResult.sigma_ra,	  5, %.2f,   sigma_ra,        restrict
+FIELD skycalResult.sigma_dec,     5, %.2f,   sigma_dec,       restrict
+FIELD skycalResult.zpt_obs,       5, %.2f,   zpt_obs,         restrict
+FIELD skycalResult.zpt_stdev,     5, %.2f,   zpt_stdev,       restrict
+FIELD skycalResult.quality,       5, %d,     quality,         restrict
+
+# What to plot
+TOPLOT skycell.radeg,skycell.decdeg,stackRun.filter
+PLOTTER skycellplot.php
+PLOTTITLE Sky Plot Skycal
Index: branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotStackImage.d
===================================================================
--- branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotStackImage.d	(revision 34466)
+++ branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotStackImage.d	(revision 34466)
@@ -0,0 +1,26 @@
+TABLE stackRun, stackSumSkyfile, skycell 
+TITLE New sky plot - stack
+FILE  simplePlotStackImage.php
+MENU  ipp.plots.dat
+
+WHERE stackRun.state != 'new' 
+WHERE stackRun.stack_id = stackSumSkyfile.stack_id
+WHERE stackRun.skycell_id = skycell.skycell_id
+WHERE stackRun.tess_id = skycell.tess_id
+
+#    field                size  format  name           show     link to         extras
+FIELD stackRun.stack_id,          5, %d,     Stack ID,        restrict
+FIELD stackRun.label,            10, %s,     Label, 	      restrict
+FIELD skycell.radeg,             10, %.6f,   RA (deg), 	      restrict
+FIELD skycell.decdeg,            10, %.6f,   DEC (deg),       restrict
+FIELD stackRun.filter,           10, %s,     FILTER, 	      restrict
+FIELD stackSumSkyfile.bg,	  5, %.2f,   BG,	      restrict
+FIELD stackSumSkyfile.bg_stdev,   5, %.2f,   BG STDEV,        restrict
+FIELD stackSumSkyfile.good_frac,  5, %.2f,   good_frac,       restrict
+FIELD stackSumSkyfile.quality,    5, %d,     quality,         restrict
+
+
+# What to plot
+TOPLOT skycell.radeg,skycell.decdeg,stackRun.filter
+PLOTTER skycellplot.php
+PLOTTITLE Sky Plot Stack
Index: branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotStaticskyImage.d
===================================================================
--- branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotStaticskyImage.d	(revision 34466)
+++ branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotStaticskyImage.d	(revision 34466)
@@ -0,0 +1,26 @@
+TABLE staticskyRun, staticskyResult, staticskyInput, stackRun, skycell 
+TITLE New sky plot - staticsky
+FILE  simplePlotStaticskyImage.php
+MENU  ipp.plots.dat
+
+WHERE staticskyRun.state != 'new' 
+WHERE staticskyRun.sky_id = staticskyResult.sky_id
+WHERE staticskyRun.sky_id = staticskyInput.sky_id
+WHERE staticskyInput.stack_id = stackRun.stack_id
+WHERE stackRun.skycell_id = skycell.skycell_id
+WHERE stackRun.tess_id = skycell.tess_id
+
+#    field                size  format  name           show     link to         extras
+FIELD staticskyRun.sky_id,	  5, %d,     Staticsky ID,    restrict
+FIELD stackRun.stack_id,          5, %d,     Stack ID,        restrict
+FIELD staticskyRun.label,        10, %s,     Label, 	      restrict
+FIELD skycell.radeg,             10, %.6f,   RA (deg), 	      restrict
+FIELD skycell.decdeg,            10, %.6f,   DEC (deg),       restrict
+FIELD stackRun.filter,           10, %s,     FILTER, 	      restrict
+FIELD staticskyResult.num_inputs, 5, %d,     num_inputs,      restrict 
+FIELD staticskyResult.quality,    5, %d,     quality,         restrict
+
+# What to plot
+TOPLOT skycell.radeg,skycell.decdeg,stackRun.filter
+PLOTTER skycellplot.php
+PLOTTITLE Sky Plot Staticsky
Index: branches/eam_branches/ipp-20120905/ippMonitor/raw/ipp.plots.dat
===================================================================
--- branches/eam_branches/ipp-20120905/ippMonitor/raw/ipp.plots.dat	(revision 34428)
+++ branches/eam_branches/ipp-20120905/ippMonitor/raw/ipp.plots.dat	(revision 34466)
@@ -5,4 +5,7 @@
 menulink  | menuselect      | link    | Simple plot - chip           	    | simplePlotChipImage.php
 menulink  | menuselect      | link    | Simple plot - cam            	    | simplePlotCamImage.php
+menulink  | menuselect      | link    | Simple plot - stack                 | simplePlotStackImage.php
+menulink  | menuselect      | link    | Simple plot - staticsky             | simplePlotStaticskyImage.php
+menulink  | menuselect      | link    | Simple plot - skycal             | simplePlotSkycalImage.php
 
 menutop   | menutop      | plain   | &nbsp;                                 | 
Index: branches/eam_branches/ipp-20120905/ippMonitor/raw/simplePlotcam.php
===================================================================
--- branches/eam_branches/ipp-20120905/ippMonitor/raw/simplePlotcam.php	(revision 34428)
+++ branches/eam_branches/ipp-20120905/ippMonitor/raw/simplePlotcam.php	(revision 34466)
@@ -28,5 +28,5 @@
 // define restrictiosn to the queries
 // ** TABLE RESTRICTIONS **
-$WHERE = "WHERE camRun.state != 'new' AND chipRun.exp_id = rawExp.exp_id AND camRun.chip_id = chipRun.chip_id";
+$WHERE = "WHERE camRun.state != 'new' AND chipRun.exp_id = rawExp.exp_id AND camRun.chip_id = chipRun.chip_id AND camProcessedExp.cam_id = camRun.cam_id";
 $WHERE = check_restrict ('rawExp.exp_name', $WHERE, 'string', 1.0);
 $WHERE = check_restrict ('rawExp.exp_id', $WHERE, 'string', 1.0);
@@ -62,4 +62,7 @@
 $WHERE = check_restrict ('rawExp.bg_stdev', $WHERE, 'max', 1.0);
 $WHERE = check_restrict ('rawExp.comment', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major', $WHERE, 'max', 1.0);
 $WHERE = check_ordering ('', $WHERE);
 
@@ -73,14 +76,14 @@
 
 // get the result table count
-$sql = "SELECT count(*) FROM camRun, chipRun, rawExp $WHERE";
+$sql = "SELECT count(*) FROM camProcessedExp, camRun, chipRun, rawExp $WHERE";
 
 $qry = $db->query($sql);
 if (dberror($qry)) {
-  echo "<b>error reading camRun, chipRun, rawExp table count</b><br>\n";
+  echo "<b>error reading camProcessedExp, camRun, chipRun, rawExp table count</b><br>\n";
   echo "<br><small><b> count query : $sql </b></small><br>\n";
   menu_end();
 }
 if (!$qry->fetchInto($row)) {
-  echo "<b>error reading camRun, chipRun, rawExp table count</b><br>\n";
+  echo "<b>error reading camProcessedExp, camRun, chipRun, rawExp table count</b><br>\n";
   echo "<br><small><b> count query : $sql </b></small><br>\n";
   menu_end();
@@ -128,5 +131,7 @@
 $buttonLink = button_restrict_max ('rawExp.bg_stdev', $buttonLink);
 $buttonLink = button_restrict_string ('rawExp.comment', $buttonLink);
-
+$buttonLink = button_restrict_string ('camProcessedExp.fwhm_major', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.fwhm_major', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.fwhm_major', $buttonLink);
 // set up the table
 echo "<table class=list>\n";
@@ -181,4 +186,5 @@
 write_header_cell ("list", "stdev    ");
 write_header_cell ("list", "Date/Time");
+write_header_cell ("list", "Cam FWHM_major");
 echo "</tr>\n";
 
@@ -193,4 +199,5 @@
 write_query_row ('rawExp.bg_stdev', 5, 'min');
 write_query_row ('rawExp.dateobs', 19, 'min');
+write_query_row ('camProcessedExp.fwhm_major', 5, 'min');
 echo "</tr><tr><td>&le;</td>\n";
 echo "<td> &nbsp; </td>\n";
@@ -201,4 +208,5 @@
 write_query_row ('rawExp.bg_stdev', 5, 'max');
 write_query_row ('rawExp.dateobs', 19, 'max');
+write_query_row ('camProcessedExp.fwhm_major', 5, 'max');
 echo "</tr>\n";
 
@@ -228,5 +236,5 @@
 
 // query the database
-$sql = "SELECT rawExp.ra,rawExp.decl,rawExp.filter FROM camRun, chipRun, rawExp $WHERE";
+$sql = "SELECT rawExp.ra,rawExp.decl,rawExp.filter FROM camProcessedExp, camRun, chipRun, rawExp $WHERE";
 
 $qry = $db->query($sql);
Index: branches/eam_branches/ipp-20120905/ippMonitor/raw/skycellplot.php
===================================================================
--- branches/eam_branches/ipp-20120905/ippMonitor/raw/skycellplot.php	(revision 34466)
+++ branches/eam_branches/ipp-20120905/ippMonitor/raw/skycellplot.php	(revision 34466)
@@ -0,0 +1,70 @@
+<?php
+
+# this program takes two arguments: 
+# an input list of RA, DEC, n(FILTER)
+# an output png filename
+# it generates a sky plot showing the locations of the given list of points
+
+$debug = 0;
+include 'site.php';
+
+### these need to be set to the correct locations!!
+$MISSING = "missing.png";
+
+### we must have been past arguments with GET:
+if ($_SERVER[REQUEST_METHOD] != 'GET') { 
+  exit ();
+}
+
+$PATH = getenv("PATH");
+putenv("PATH=$BINDIR:$PATH");
+
+$LD_LIBRARY_PATH = getenv("LD_LIBRARY_PATH");
+putenv("LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH");
+
+if ($debug) {
+  echo "path: $PATH<br>";
+
+  $newpath = getenv("PATH");
+  echo "new path: $newpath<br>";
+
+  $newpath = getenv("LD_LIBRARY_PATH");
+  echo "new path: $newpath<br>";
+
+  echo "bindir: $BINDIR<br>";
+}
+
+if ($debug) {
+  exec ("which skycellplot.dvo", $output, $status);
+  echo "which output:<br>";
+  for ($i = 0; $i < count($output); $i++) {
+    echo "output $i: $output[$i]<br>";
+  }
+  echo "status:   $status<br>";
+}
+
+$infile  = $_GET[input];
+$outfile = $_GET[output];
+
+$output = shell_exec("skycellplot.dvo $infile $outfile");//, $output, $status);
+
+if ($debug) {
+  for ($i = 0; $i < count($output); $i++) {
+    echo "output $i: $output[$i]<br>";
+  }
+  echo "status:   $status<br>";
+  exit ();
+}
+
+# use these to check the environment
+# passthru ("env");
+
+$file = fopen ($outfile, "r");
+if ($file && !$debug) {
+  header ('Content-Type: image/png');
+  fpassthru ($file);
+}
+
+exit();
+
+?>
Index: branches/eam_branches/ipp-20120905/ippMonitor/scripts/skycellplot.dvo
===================================================================
--- branches/eam_branches/ipp-20120905/ippMonitor/scripts/skycellplot.dvo	(revision 34466)
+++ branches/eam_branches/ipp-20120905/ippMonitor/scripts/skycellplot.dvo	(revision 34466)
@@ -0,0 +1,87 @@
+#!/usr/bin/env dvo
+
+# this should prbably be just skyplot.dvo with added switch for deg or rad coords
+#
+
+list filters
+ green
+ blue
+ red
+ indigo
+ black
+ gold
+ orange
+end
+
+list pttype
+ 7
+ 0
+ 1
+ 2
+ 7
+ 3
+ 0
+end
+
+list ptsize
+ 1.1
+ 0.3
+ 0.3
+ 0.3
+ 0.3
+ 0.3
+ 0.3
+end
+
+macro skycellplot
+  if ($0 != 3)
+    echo "skycellplot (input) (output)"
+    break
+  end
+
+  data $1
+  read r 1 d 2 f 3
+
+  resize 1000 500
+  region +ns -ew 180 0 85 ait; cgrid -ra-by-hour -c grey80
+
+  set R = r 
+  set D = d
+
+  for i 0 $filters:n
+    subset R1 = R if (f == $i)
+    subset D1 = D if (f == $i)
+    if (R1[]) 
+      cplot R1 D1 -pt $pttype:$i -sz $ptsize:$i -c $filters:$i
+    end
+  end
+
+  style -c red -pt 0 -sz 0.5; ecliptic
+  style -c blue -pt 0 -sz 0.5; galactic
+
+  png -name $2
+end
+
+macro galactic
+ create l 720 -360 0.1
+ set b = l * 0
+ csystem G C l b
+ cplot l b
+end
+
+macro ecliptic
+ create l 720 -360 0.1
+ set b = l * 0
+ csystem E C l b
+ cplot l b
+end
+
+if ($SCRIPT)
+  $KAPA = kapa -noX
+  if ($argv:n != 2)
+    echo "USAGE: skycellplot (input) (output)"
+    exit 1
+  end
+  skycellplot $argv:0 $argv:1
+  exit 0
+end
