Index: trunk/ippMonitor/Makefile.in
===================================================================
--- trunk/ippMonitor/Makefile.in	(revision 34431)
+++ trunk/ippMonitor/Makefile.in	(revision 34432)
@@ -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,5 @@
 $(DESTWWW)/simplePlotChipImage.php \
 $(DESTWWW)/simplePlotCamImage.php \
+$(DESTWWW)/simplePlotStackImage.php \
 $(DESTWWW)/histogramBackgroundImage.php \
 $(DESTWWW)/histogramCamProcessedExpImage.php \
Index: trunk/ippMonitor/def/simplePlotStackImage.d
===================================================================
--- trunk/ippMonitor/def/simplePlotStackImage.d	(revision 34432)
+++ trunk/ippMonitor/def/simplePlotStackImage.d	(revision 34432)
@@ -0,0 +1,20 @@
+TABLE stackRun, skycell 
+TITLE New sky plot - stack
+FILE  simplePlotStackImage.php
+MENU  ipp.plots.dat
+
+WHERE stackRun.state != 'new' 
+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,              8, %C,     RA, 	      restrict
+FIELD skycell.decdeg,             8, %C,     DEC, 	      restrict
+FIELD stackRun.filter,           10, %s,     FILTER, 	      restrict
+
+# What to plot
+TOPLOT skycell.radeg,skycell.decdeg,stackRun.filter
+PLOTTER skycellplot.php
+PLOTTITLE Sky Plot Stack
Index: trunk/ippMonitor/raw/ipp.plots.dat
===================================================================
--- trunk/ippMonitor/raw/ipp.plots.dat	(revision 34431)
+++ trunk/ippMonitor/raw/ipp.plots.dat	(revision 34432)
@@ -5,4 +5,5 @@
 menulink  | menuselect      | link    | Simple plot - chip           	    | simplePlotChipImage.php
 menulink  | menuselect      | link    | Simple plot - cam            	    | simplePlotCamImage.php
+menulink  | menuselect      | link    | Simple plot - stack                 | simplePlotStackImage.php
 
 menutop   | menutop      | plain   | &nbsp;                                 | 
Index: trunk/ippMonitor/raw/skycellplot.php
===================================================================
--- trunk/ippMonitor/raw/skycellplot.php	(revision 34432)
+++ trunk/ippMonitor/raw/skycellplot.php	(revision 34432)
@@ -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: trunk/ippMonitor/scripts/skycellplot.dvo
===================================================================
--- trunk/ippMonitor/scripts/skycellplot.dvo	(revision 34432)
+++ trunk/ippMonitor/scripts/skycellplot.dvo	(revision 34432)
@@ -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
