#!/usr/bin/env jython

import sys

from ipptopsps import IppToPsps
from plot import Plot


'''
Plotter class
'''
class Plotter(IppToPsps):

    '''
    Constructor
    '''
    def __init__(self, argv):
        super(Plotter, self).__init__(argv)

        self.plot = Plot(self.logger, self.skychunk, self.config, self.ippToPspsDb)
 
        if len(argv) < 3:
            self.printUsage()
            self.exitProgram("No plot type specified")

        if argv[2] == "density": 
            self.plot.createDensityPlot("P2")
            self.plot.createDensityPlot("ST")
            self.plot.createDensityPlot("OB")
            self.plot.createDensityPlot("DF")
            self.plot.createDensityPlot("DO")
            self.plot.createDensityPlot("FW")
            self.plot.createDensityPlot("FO")

    '''
    Overrides base-class version
    '''
    def printUsage(self):
        super(Plotter, self).printUsage("[density]")


'''
Start of program
'''
try:
    plotter = Plotter(sys.argv)
    plotter.exitProgram("completed")
except: pass
