Index: trunk/ippToPsps/jython/plotter.py
===================================================================
--- trunk/ippToPsps/jython/plotter.py	(revision 33348)
+++ trunk/ippToPsps/jython/plotter.py	(revision 33348)
@@ -0,0 +1,70 @@
+#!/usr/bin/env jython
+
+import tempfile
+import os
+import sys
+
+from ipptopsps import IppToPsps
+
+
+'''
+Plotter class
+'''
+class Plotter(IppToPsps):
+
+    '''
+    Constructor
+    '''
+    def __init__(self, argv):
+        super(Plotter, self).__init__(argv)
+
+    '''
+    Runs...
+    '''
+    def run(self):
+
+        tempFilename = "./plotData.dat"
+        DATFILE = open(tempFilename,'w')
+        self.ippToPspsDb.createPendingDensityPlotData(self.config.name, DATFILE)
+        DATFILE.close()
+
+        OUTPUTFILE = self.config.name + ".png"
+        f = os.popen('gnuplot', 'w')
+            
+        max = self.ippToPspsDb.getMaxPendingInBox(self.config.name)
+
+        if 0:
+            TERM = "X11"
+        else:
+            TERM = "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8"
+                     
+        print >> f, "set term " + TERM + "; \
+            set output \"" + OUTPUTFILE + "\"; \
+            set title \"Density plot of unprocessed stuff\"; \
+            set grid; \
+            set xrange [" + str(self.config.minRa) + ":" + str(self.config.maxRa) + "] reverse; \
+            set yrange [" + str(self.config.minDec) + ":" + str(self.config.maxDec) + "]; \
+            unset key; \
+            set palette rgb 22,13,10; \
+            set ylabel \"Dec\"; \
+            set ylabel \"RA\"; \
+            set cbrange [0:" + str(max) + "]; \
+            set datafile missing \"NaN\"; \
+            plot '" + tempFilename + "' using 1:2:3 with image"
+
+        f.flush()
+
+    '''
+    Overrides base-class version
+    '''
+    def printUsage(self):
+        super(Plotter, self).printUsage()
+        print " [<density>]"
+
+
+'''
+Start of program
+'''
+plotter = Plotter(sys.argv)
+plotter.run()
+plotter.exitProgram("finished")
