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)
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 )
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
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()
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()
def path_default_worldfile(): return os.path.join(pw_env('home'), 'current.wf')
def path_schema(): return os.path.join(pw_env('home'), 'etc', 'worldfile.wfs')
def path_schema(): return os.path.join(pw_env('home'), 'default.wfs')
def check_environment(): global CALC_COMPLEXITY CALC_COMPLEXITY = common_functions.pw_env('complexity')
def make_recent( run_dir ): script = common_functions.pw_env('makeRecent') os.system( script + " " + run_dir )
def path_schema(): return os.path.join( pw_env('home'), 'etc', 'worldfile.wfs' )
def path_schema(): return os.path.join( pw_env('home'), 'default.wfs' )
def make_recent(run_dir): script = common_functions.pw_env('makeRecent') os.system(script + " " + run_dir)