Index: branches/czw_branch/20120906/ippMonitor/INSTALL
===================================================================
--- branches/czw_branch/20120906/ippMonitor/INSTALL	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/INSTALL	(revision 34772)
@@ -24,2 +24,5 @@
 # Note: we use a 'science databases (replication) slave' and the ippMonitor read-only account to connect to that database
 psconfigure --dbhost scidbs1 --dbuser ippMonitor --dbpass ippMonitor --htdocs /var/www/localhost/htdocs --site ~/ippconfig/ippmonitor.config
+
+psconfigure --dbhost scidbm --dbuser ipp --dbpass ipp --htdocs /var/www/localhost/htdocs --site ~/ippconfig/ippmonitor.config
+
Index: branches/czw_branch/20120906/ippMonitor/Makefile.in
===================================================================
--- branches/czw_branch/20120906/ippMonitor/Makefile.in	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/Makefile.in	(revision 34772)
@@ -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 \
@@ -235,5 +240,7 @@
 $(DESTWWW)/lapRuns.php \
 $(DESTWWW)/lapExposures.php \
-$(DESTWWW)/lapStacks.php
+$(DESTWWW)/lapStacks.php \
+$(DESTWWW)/failedStaticsky.php \
+$(DESTWWW)/staticsky_failure.php
 
 PICTURES = \
Index: branches/czw_branch/20120906/ippMonitor/czartool/czartool/czarconfig.xml
===================================================================
--- branches/czw_branch/20120906/ippMonitor/czartool/czartool/czarconfig.xml	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/czartool/czartool/czarconfig.xml	(revision 34772)
@@ -19,9 +19,15 @@
 
   <!-- gpc1 Db section -->
+<!--   <gpc1database> -->
+<!--     <name>gpc1</name> -->
+<!--     <host>scidbs1</host> -->
+<!--     <user>ippMonitor</user> -->
+<!--     <password>ippMonitor</password> -->
+<!--   </gpc1database> -->
   <gpc1database>
     <name>gpc1</name>
-    <host>scidbs1</host>
-    <user>ippMonitor</user>
-    <password>ippMonitor</password>
+    <host>scidbm</host>
+    <user>ippuser</user>
+    <password>ippuser</password>
   </gpc1database>
 
Index: branches/czw_branch/20120906/ippMonitor/def/failedStaticsky.d
===================================================================
--- branches/czw_branch/20120906/ippMonitor/def/failedStaticsky.d	(revision 34772)
+++ branches/czw_branch/20120906/ippMonitor/def/failedStaticsky.d	(revision 34772)
@@ -0,0 +1,27 @@
+TABLE staticskyRun JOIN staticskyResult USING(sky_id) JOIN staticskyInput USING(sky_id) JOIN stackRun USING(stack_id)
+TITLE Static Sky Failed
+FILE  failedStaticsky.php
+MENU  ipp.stack.dat
+
+WHERE staticskyResult.fault != 0
+
+ARGS  ARG1   staticskyRun.sky_id=$staticskyRun.sky_id
+ARGS  ARG1   basename=$staticskyResult.path_base
+
+#        field                          size  format  name           show     link to         extras
+FIELD staticskyRun.sky_id,          5, %d,     Sky ID
+FIELD staticskyRun.label,    	    7, %s,     Label
+FIELD staticskyRun.state,    	    7, %s,     State,		value,		staticsky_failure.php, ARG1
+FIELD stackRun.skycell_id,          5, %s,     Skycell ID
+FIELD stackRun.tess_id,             5, %s,     Tess ID
+FIELD count(stackRun.filter),       5, %d,     #Filters	
+FIELD stackRun.label AS stackRunLabel,   5, %s,     Stack Label
+FIELD staticskyRun.data_group, 	    7, %s,     data grp
+FIELD staticskyRun.dist_group, 	    7, %s,     dist grp
+FIELD staticskyResult.sources,      7, %d,     n(sources)
+FIELD staticskyResult.fault,        7, %d,     fault
+FIELD staticskyResult.quality,      7, %d,     quality
+FIELD staticskyResult.path_base,    5, %s,     path_base,     none
+
+MODE summary
+GROUP staticskyRun.sky_id
Index: branches/czw_branch/20120906/ippMonitor/def/simplePlotCamImage.d
===================================================================
--- branches/czw_branch/20120906/ippMonitor/def/simplePlotCamImage.d	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/def/simplePlotCamImage.d	(revision 34772)
@@ -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/czw_branch/20120906/ippMonitor/def/simplePlotSkycalImage.d
===================================================================
--- branches/czw_branch/20120906/ippMonitor/def/simplePlotSkycalImage.d	(revision 34772)
+++ branches/czw_branch/20120906/ippMonitor/def/simplePlotSkycalImage.d	(revision 34772)
@@ -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/czw_branch/20120906/ippMonitor/def/simplePlotStackImage.d
===================================================================
--- branches/czw_branch/20120906/ippMonitor/def/simplePlotStackImage.d	(revision 34772)
+++ branches/czw_branch/20120906/ippMonitor/def/simplePlotStackImage.d	(revision 34772)
@@ -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/czw_branch/20120906/ippMonitor/def/simplePlotStaticskyImage.d
===================================================================
--- branches/czw_branch/20120906/ippMonitor/def/simplePlotStaticskyImage.d	(revision 34772)
+++ branches/czw_branch/20120906/ippMonitor/def/simplePlotStaticskyImage.d	(revision 34772)
@@ -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/czw_branch/20120906/ippMonitor/def/staticsky_failure.d
===================================================================
--- branches/czw_branch/20120906/ippMonitor/def/staticsky_failure.d	(revision 34772)
+++ branches/czw_branch/20120906/ippMonitor/def/staticsky_failure.d	(revision 34772)
@@ -0,0 +1,27 @@
+TABLE staticskyRun JOIN staticskyResult USING(sky_id) JOIN staticskyInput USING(sky_id) JOIN stackRun USING(stack_id)
+TITLE Static Sky Failed (Log)
+FILE  failedStaticsky.php
+MENU  ipp.stack.dat
+
+WHERE staticskyResult.fault != 0
+
+ARGS  ARG1   staticskyResult.path_base=$staticskyResult.path_base
+
+#        field                          size  format  name           show     link to         extras
+FIELD staticskyRun.sky_id,          5, %d,     Sky ID
+FIELD staticskyRun.label,    	    7, %s,     Label
+FIELD staticskyRun.state,    	    7, %s,     State,		value,		staticsky_failure.php, ARG1
+FIELD stackRun.skycell_id,          5, %s,     Skycell ID
+FIELD stackRun.tess_id,             5, %s,     Tess ID
+FIELD count(stackRun.filter),       5, %d,     #Filters	
+FIELD stackRun.label,               5, %s,     Stack Label
+FIELD staticskyRun.data_group, 	    7, %s,     data grp
+FIELD staticskyRun.dist_group, 	    7, %s,     dist grp
+FIELD staticskyResult.sources,      7, %d,     n(sources)
+FIELD staticskyResult.fault,        7, %d,     fault
+FIELD staticskyResult.quality,      7, %d,     quality
+FIELD staticskyResult.path_base,    5, %s,     path_base,     none
+
+GROUP staticskyRun.sky_id
+
+TAIL PHP insert_log ('LOG.EXP');
Index: branches/czw_branch/20120906/ippMonitor/raw/czartool_labels.php
===================================================================
--- branches/czw_branch/20120906/ippMonitor/raw/czartool_labels.php	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/raw/czartool_labels.php	(revision 34772)
@@ -219,4 +219,5 @@
       showReplicationsStatus($REPL_HOST_IPPADMIN, $REPL_USER_IPPADMIN, $REPL_PASSWORD_IPPADMIN, $REPL_DBNAME_IPPADMIN);
       showReplicationsStatus($REPL_HOST_ISP, $REPL_USER_ISP, $REPL_PASSWORD_ISP, $REPL_DBNAME_ISP);
+      showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_DBNAME_NEBULOUS_SECONDARY);
       echo "</table>";
 
@@ -464,5 +465,5 @@
         createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
 
-        $link = $defaultlink;
+        $link = "failedStaticsky.php?pass=" . $pass . "&proj=" . $proj . "&staticskyRun.label=" . $thisLabel . "&staticskyRun.state=".$searchState;
         getStateAndFaults($db, $thisLabel, $selectedState, "staticsky", $str, $anyFaults);
         createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
Index: branches/czw_branch/20120906/ippMonitor/raw/ipp.php
===================================================================
--- branches/czw_branch/20120906/ippMonitor/raw/ipp.php	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/raw/ipp.php	(revision 34772)
@@ -799,9 +799,15 @@
   // echo "<b>class_id: $class_id</b><br>\n";
   // echo "<b>camera:   $camera</b><br>\n";
+  // echo "<b>filerule:   $filerule</b><br>\n";
 
   if (! $class_id) { $class_id = "NONE"; }
 
+  //SCH: I set a default value for the 'camera' which is based on the
+  //'proj' parameter.
+  //It's necessary for staticsky logs and it would require to join tables
+  //back to the warpRun table
+  if (! $camera) { $camera = strtoupper($_GET['proj']); }
+
   if ($basename && $camera && $filerule) {
-
     // do I need to do this to the output result as well?
     $basename = escapeshellarg($basename);
@@ -841,4 +847,5 @@
       return;
     }
+    echo "<b>log filename: $filename</b><br>\n";
 
     echo "<pre>\n";
@@ -850,4 +857,5 @@
   }
 }
+
 
 // expect image supplied with key=name
Index: branches/czw_branch/20120906/ippMonitor/raw/ipp.plots.dat
===================================================================
--- branches/czw_branch/20120906/ippMonitor/raw/ipp.plots.dat	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/raw/ipp.plots.dat	(revision 34772)
@@ -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/czw_branch/20120906/ippMonitor/raw/ipp.stack.dat
===================================================================
--- branches/czw_branch/20120906/ippMonitor/raw/ipp.stack.dat	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/raw/ipp.stack.dat	(revision 34772)
@@ -36,2 +36,3 @@
 menulink  | menuselect   | link    | Static Sky Processed Skyfile | staticskyProcessedSkyfile.php
 menulink  | menuselect   | link    | Static Sky Failed Skyfile    | staticskyFailedSkyfile.php
+menulink  | menuselect   | link    | Static Sky Failed            | failedStaticsky.php
Index: branches/czw_branch/20120906/ippMonitor/raw/simplePlotcam.php
===================================================================
--- branches/czw_branch/20120906/ippMonitor/raw/simplePlotcam.php	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/raw/simplePlotcam.php	(revision 34772)
@@ -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/czw_branch/20120906/ippMonitor/raw/site.php.in
===================================================================
--- branches/czw_branch/20120906/ippMonitor/raw/site.php.in	(revision 34410)
+++ branches/czw_branch/20120906/ippMonitor/raw/site.php.in	(revision 34772)
@@ -47,4 +47,13 @@
 $REPL_DBNAME_ISP = "ippc17 (isp)";
 
+$REPL_HOST_NEBULOUS_SECONDARY = "ippdb04.IfA.Hawaii.Edu";
+$REPL_USER_NEBULOUS_SECONDARY = "ippMonitor";
+$REPL_PASSWORD_NEBULOUS_SECONDARY = "ippMonitor";
+$REPL_DBNAME_NEBULOUS_SECONDARY = "ippdb04 (secondary nebulous / 50,000 sec behind is acceptable / usually stopped on Mondays and Tuesdays)";
+
+$REPL_HOST_NEBULOUS_TERNARY = "ippc63.IfA.Hawaii.Edu";
+$REPL_USER_NEBULOUS_TERNARY = "ippMonitor";
+$REPL_PASSWORD_NEBULOUS_TERNARY = "ippMonitor";
+$REPL_DBNAME_NEBULOUS_TERNARY = "ippc63 (secondary nebulous / 50,000 sec behind is acceptable / usually stopped on Mondays and Tuesdays)";
 
 
Index: branches/czw_branch/20120906/ippMonitor/raw/skycellplot.php
===================================================================
--- branches/czw_branch/20120906/ippMonitor/raw/skycellplot.php	(revision 34772)
+++ branches/czw_branch/20120906/ippMonitor/raw/skycellplot.php	(revision 34772)
@@ -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/czw_branch/20120906/ippMonitor/scripts/skycellplot.dvo
===================================================================
--- branches/czw_branch/20120906/ippMonitor/scripts/skycellplot.dvo	(revision 34772)
+++ branches/czw_branch/20120906/ippMonitor/scripts/skycellplot.dvo	(revision 34772)
@@ -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.3001
+ 0.3002
+ 0.3003
+ 0.3004
+ 0.3005
+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
