From 4eb528163dd8d7c424a22342dac0c14dde1a1894 Mon Sep 17 00:00:00 2001 From: Yngve Inntjore Levinsen <Yngve.Levinsen@esss.se> Date: Wed, 4 Feb 2015 11:46:52 +0100 Subject: [PATCH] fixed previous commit errors --- ess/TraceWin.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/ess/TraceWin.py b/ess/TraceWin.py index 73f9268..c997c6c 100644 --- a/ess/TraceWin.py +++ b/ess/TraceWin.py @@ -310,7 +310,7 @@ class remote_data_merger: return data -class partran: +class partran(dict): ''' Read partran1.out files.. ''' @@ -325,20 +325,11 @@ class partran: stream=file(self.filename,'r') for i in xrange(10): line=stream.readline() - self.columns=['NUM']+line.split() + self.columns=['NUM']+line.split()[1:] self.data=numpy.loadtxt(stream) - # seems we have some inconsistencies with columns... - #self._dict={} - #print self.data.shape,len(self.columns) - #for i in xrange(len(self.columns)): - # self._dict[self.columns[i]]=self.data[:,i] - - def get(self,column): - if column not in self.columns: - print "WARNING, could not find",column - return - i=self.columns.index(column) - return self.data[:,i] - + self._dict={} + print self.data.shape,len(self.columns) + for i in xrange(len(self.columns)): + self[self.columns[i]]=self.data[:,i] -- GitLab