From 471cfe755befb213dc9b5d7582d44e244517123d Mon Sep 17 00:00:00 2001 From: Sebastianw Wehling-Benatelli Date: Wed, 3 Aug 2016 13:28:54 +0200 Subject: [PATCH] [fix] be sure to start the external programs in the right directory --- pylot/core/active/fmtomoUtils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pylot/core/active/fmtomoUtils.py b/pylot/core/active/fmtomoUtils.py index ea69637a..19be28b0 100644 --- a/pylot/core/active/fmtomoUtils.py +++ b/pylot/core/active/fmtomoUtils.py @@ -49,7 +49,8 @@ class Tomo3d(object): os.system('ln -s %s %s'%(filename, linkname)) def buildObsdata(self): - os.system('obsdata') + p = subprocess.Popen(os.path.join(self.cwd, 'obsdata'), shell=True) + os.waitpid(p.pid) os.system('mv sources.in sourcesref.in') def defFMMParas(self): @@ -57,9 +58,9 @@ class Tomo3d(object): Initiates parameters for the forward calculation. ''' # Name of fast marching program - self.fmm = '{0}/fm3d'.format(self.cwd) + self.fmm = os.path.join(self.cwd, 'fm3d') # Name of program calculating Frechet derivatives - self.frechgen = '{0}/frechgen'.format(self.cwd) + self.frechgen = os.path.join(self.cwd, 'frechgen') # Name of current velocity/inversion grid self.cvg = 'vgrids.in' # Name of current interfaces grid @@ -116,7 +117,7 @@ class Tomo3d(object): Default: pwd ''' if directory == None: - directory = os.path.join(os.getcwd(), self.simuldir) + directory = self.simuldir os.chdir(directory) self.cwd = directory