Example #1
0
    def save(self, path_doc):
        path_script = '/tmp/plot_%d.gnuplot' % (os.getpid())
        path_err = path_script + '.err'

        f = open(path_script, 'w')

        f.write('set term postscript eps enhanced color\n')
        f.write('set output "%s"\n' % path_doc)

        multiplot = len(self.plotlist) > 1

        if multiplot:
            layout = self.layout
            if not layout:
                layout = (len(self.plotlist), 1)
            f.write('set multiplot layout %d,%d\n' % (layout[0], layout[1]))

        for plot in self.plotlist:
            f.write('%s\n' % plot.getSpec())

        if multiplot:
            f.write('unset multiplot\n')

        f.close()

        gnuplot = common_functions.pw_env('gnuplot')

        # redirect stderr because it's verbose even on no errors
        rc = os.system(gnuplot + " '" + path_script + "' 2>'" + path_err + "'")
        if rc != 0:
            os.system('cat ' + path_err)
            sys.exit(1)

        os.remove(path_script)
        os.remove(path_err)
Example #2
0
    def save(self, path_doc):
        path_script = '/tmp/plot_%d.gnuplot' % (os.getpid())
        path_err = path_script + '.err'
        
        f = open(path_script, 'w')

        f.write('set term postscript eps enhanced color\n')
        f.write('set output "%s"\n' % path_doc)
        
        multiplot = len(self.plotlist) > 1

        if multiplot:
            layout = self.layout
            if not layout:
                layout = (len(self.plotlist), 1)
            f.write('set multiplot layout %d,%d\n' % (layout[0], layout[1]))
        
        for plot in self.plotlist:
            f.write('%s\n' % plot.getSpec())

        if multiplot:
            f.write('unset multiplot\n')

        f.close()

        gnuplot = common_functions.pw_env('gnuplot')
            
        # redirect stderr because it's verbose even on no errors
        rc = os.system(gnuplot + " '" +  path_script + "' 2>'" + path_err + "'" )
        if rc != 0:
            os.system( 'cat ' + path_err )
            sys.exit(1)

        os.remove( path_script )
        os.remove( path_err )
Example #3
0
    def save(self, path_doc):
        path_script = '/tmp/plot_%d.gnuplot' % (os.getpid())
        
        f = open(path_script, 'w')

        f.write('set term postscript eps enhanced color\n')
        f.write('set output "%s"\n' % path_doc)
        
        multiplot = len(self.plotlist) > 1

        if multiplot:
            layout = self.layout
            if not layout:
                layout = (len(self.plotlist), 1)
            f.write('set multiplot layout %d,%d\n' % (layout[0], layout[1]))
        
        for plot in self.plotlist:
            f.write('%s\n' % plot.getSpec())

        if multiplot:
            f.write('unset multiplot\n')

        f.close()

        gnuplot = common_functions.pw_env('gnuplot')
            
        # redirect stderr because it's verbose even on no errors (why?!)
        os.system('%s %s 2>%s.out' % (gnuplot, path_script, path_script))

        return path_doc, path_script
Example #4
0
    def save(self, path_doc):
        path_script = '/tmp/plot_%d.gnuplot' % (os.getpid())

        f = open(path_script, 'w')

        f.write('set term postscript eps enhanced color\n')
        f.write('set output "%s"\n' % path_doc)

        multiplot = len(self.plotlist) > 1

        if multiplot:
            layout = self.layout
            if not layout:
                layout = (len(self.plotlist), 1)
            f.write('set multiplot layout %d,%d\n' % (layout[0], layout[1]))

        for plot in self.plotlist:
            f.write('%s\n' % plot.getSpec())

        if multiplot:
            f.write('unset multiplot\n')

        f.close()

        gnuplot = common_functions.pw_env('gnuplot')

        # redirect stderr because it's verbose even on no errors (why?!)
        os.system('%s %s 2>%s.out' % (gnuplot, path_script, path_script))

        return path_doc, path_script
Example #5
0
def proputil(*args):
    proputil = pw_env('proputil')

    cmd = [proputil] + list(args)

    exitval, stdout = get_cmd_stdout(cmd)

    if exitval != 0:
        err("Failed executing '%s'. exit=%s" % (cmd, exitval))

    return stdout.strip()
Example #6
0
def proputil( *args ):
    proputil = pw_env( 'proputil' )

    cmd = [proputil] + list(args)

    exitval, stdout = get_cmd_stdout( cmd )
    
    if exitval != 0:
        err( "Failed executing '%s'. exit=%s" % (cmd,exitval) )

    return stdout.strip()
Example #7
0
def path_default_worldfile():
    return os.path.join(pw_env('home'), 'current.wf')
Example #8
0
def path_schema():
    return os.path.join(pw_env('home'), 'etc', 'worldfile.wfs')
Example #9
0
def path_schema():
    return os.path.join(pw_env('home'), 'default.wfs')
Example #10
0
def check_environment():
	global CALC_COMPLEXITY

	CALC_COMPLEXITY = common_functions.pw_env('complexity')
Example #11
0
def make_recent( run_dir ):
	script = common_functions.pw_env('makeRecent')
	os.system( script + " " + run_dir )
Example #12
0
def path_default_worldfile():
    return os.path.join(pw_env('home'), 'current.wf')
Example #13
0
def path_schema():
    return os.path.join( pw_env('home'), 'etc', 'worldfile.wfs' )
Example #14
0
def path_schema():
    return os.path.join( pw_env('home'), 'default.wfs' )
Example #15
0
def check_environment():
    global CALC_COMPLEXITY

    CALC_COMPLEXITY = common_functions.pw_env('complexity')
Example #16
0
def make_recent(run_dir):
    script = common_functions.pw_env('makeRecent')
    os.system(script + " " + run_dir)