示例#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)
示例#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 )
示例#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
示例#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
示例#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()
示例#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()
示例#7
0
def path_default_worldfile():
    return os.path.join(pw_env('home'), 'current.wf')
示例#8
0
def path_schema():
    return os.path.join(pw_env('home'), 'etc', 'worldfile.wfs')
示例#9
0
def path_schema():
    return os.path.join(pw_env('home'), 'default.wfs')
示例#10
0
def check_environment():
	global CALC_COMPLEXITY

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

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