IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33497


Ignore:
Timestamp:
Mar 13, 2012, 10:45:40 AM (14 years ago)
Author:
rhenders
Message:

now a program that uses the new Plot class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/plotter.py

    r33348 r33497  
    11#!/usr/bin/env jython
    22
    3 import tempfile
    4 import os
    53import sys
    64
    75from ipptopsps import IppToPsps
     6from plot import Plot
    87
    98
     
    1918        super(Plotter, self).__init__(argv)
    2019
    21     '''
    22     Runs...
    23     '''
    24     def run(self):
     20        self.plot = Plot(self.logger, self.config, self.ippToPspsDb)
     21 
     22        if len(argv) < 3:
     23            self.printUsage()
     24            self.exitProgram("No plot type specified")
    2525
    26         tempFilename = "./plotData.dat"
    27         DATFILE = open(tempFilename,'w')
    28         self.ippToPspsDb.createPendingDensityPlotData(self.config.name, DATFILE)
    29         DATFILE.close()
    30 
    31         OUTPUTFILE = self.config.name + ".png"
    32         f = os.popen('gnuplot', 'w')
    33            
    34         max = self.ippToPspsDb.getMaxPendingInBox(self.config.name)
    35 
    36         if 0:
    37             TERM = "X11"
    38         else:
    39             TERM = "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8"
    40                      
    41         print >> f, "set term " + TERM + "; \
    42             set output \"" + OUTPUTFILE + "\"; \
    43             set title \"Density plot of unprocessed stuff\"; \
    44             set grid; \
    45             set xrange [" + str(self.config.minRa) + ":" + str(self.config.maxRa) + "] reverse; \
    46             set yrange [" + str(self.config.minDec) + ":" + str(self.config.maxDec) + "]; \
    47             unset key; \
    48             set palette rgb 22,13,10; \
    49             set ylabel \"Dec\"; \
    50             set ylabel \"RA\"; \
    51             set cbrange [0:" + str(max) + "]; \
    52             set datafile missing \"NaN\"; \
    53             plot '" + tempFilename + "' using 1:2:3 with image"
    54 
    55         f.flush()
     26        if argv[2] == "density":
     27            self.plot.createDensityPlot("P2")
     28            self.plot.createDensityPlot("ST")
    5629
    5730    '''
     
    5932    '''
    6033    def printUsage(self):
    61         super(Plotter, self).printUsage()
    62         print " [<density>]"
     34        super(Plotter, self).printUsage("[density]")
    6335
    6436
     
    6739'''
    6840plotter = Plotter(sys.argv)
    69 plotter.run()
    7041plotter.exitProgram("finished")
Note: See TracChangeset for help on using the changeset viewer.