Browse Source

Import fix from dmp

tags/1.6.1
Trevor Irons 5 years ago
parent
commit
b82b52beab
3 changed files with 6 additions and 7 deletions
  1. 1
    3
      akvo/gui/akvoGUI.py
  2. 2
    2
      akvo/tressel/harmonic.py
  3. 3
    2
      akvo/tressel/mrsurvey.py

+ 1
- 3
akvo/gui/akvoGUI.py View File

794
         self.RAWDataProc.nDAQVersion = self.RAWDataProc.DATADICT["INFO"]["nDAQVersion"]
794
         self.RAWDataProc.nDAQVersion = self.RAWDataProc.DATADICT["INFO"]["nDAQVersion"]
795
         self.RAWDataProc.dt = 1./self.RAWDataProc.samp 
795
         self.RAWDataProc.dt = 1./self.RAWDataProc.samp 
796
 
796
 
797
-
798
-
799
         self.dataChan = self.RAWDataProc.DATADICT[ self.RAWDataProc.DATADICT["PULSES"][0] ]["chan"]
797
         self.dataChan = self.RAWDataProc.DATADICT[ self.RAWDataProc.DATADICT["PULSES"][0] ]["chan"]
800
         # Keep backwards compatibility with prior saved pickles???
798
         # Keep backwards compatibility with prior saved pickles???
801
         #self.ui.logTextBrowser.clear() 
799
         #self.ui.logTextBrowser.clear() 
816
             self.RAWDataProc.interpulseDelay = self.RAWDataProc.DATADICT["INFO"]["interpulseDelay"]
814
             self.RAWDataProc.interpulseDelay = self.RAWDataProc.DATADICT["INFO"]["interpulseDelay"]
817
 
815
 
818
         self.YamlNode.Import = OrderedDict((yaml.load( self.logText, Loader=yaml.Loader )).Import)
816
         self.YamlNode.Import = OrderedDict((yaml.load( self.logText, Loader=yaml.Loader )).Import)
819
-        self.YamlNode.Processing = OrderedDict((yaml.load( self.logText, Loader=yaml.Loader )).Processing)
817
+        self.YamlNode.Processing = list((yaml.load( self.logText, Loader=yaml.Loader )).Processing)
820
         self.YamlNode.Stacking = OrderedDict((yaml.load( self.logText, Loader=yaml.Loader )).Stacking)
818
         self.YamlNode.Stacking = OrderedDict((yaml.load( self.logText, Loader=yaml.Loader )).Stacking)
821
         self.Log()
819
         self.Log()
822
  
820
  

+ 2
- 2
akvo/tressel/harmonic.py View File

112
 
112
 
113
         # CG, BFGS, Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and trust-constr
113
         # CG, BFGS, Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and trust-constr
114
         print("2 UNbounded ( +-", Bounds,") search length ", kNs0, kNs1 ,"for f0", f0, f1)
114
         print("2 UNbounded ( +-", Bounds,") search length ", kNs0, kNs1 ,"for f0", f0, f1)
115
-        res = minimize(harmonic2Norm, np.array((f0, f1)), args=(sN, fs, t, f0k1, f0k1+kNs0, f0ks, f1k1, f1k1+kNs1, f1ks), jac='2-point', method='BFGS') # hess=None, bounds=None )
115
+        res = minimize(harmonic2Norm, np.array((f0, f1)), args=(sN, fs, t, f0k1, kNs0, f0ks, f1k1, kNs1, f1ks), jac='2-point', method='BFGS') # hess=None, bounds=None )
116
     else:
116
     else:
117
         # Bounded
117
         # Bounded
118
         bnds = ( (f0-Bounds, f0+Bounds),(f1-Bounds, f1+Bounds) )
118
         bnds = ( (f0-Bounds, f0+Bounds),(f1-Bounds, f1+Bounds) )
119
         print("2 bounded ( +-", Bounds,") search length ", kNs0, kNs1 ,"for f0", f0, f1)
119
         print("2 bounded ( +-", Bounds,") search length ", kNs0, kNs1 ,"for f0", f0, f1)
120
         # L-BFGS-B hess=None, bounds=None )
120
         # L-BFGS-B hess=None, bounds=None )
121
-        res = minimize(harmonic2Norm, ((f0,f1)), args=(sN, fs, t, f0k1, f0k1+kNs0, f0ks, f1k1, f1k1+kNs1, f1ks), jac='2-point', method='L-BFGS-B', bounds=bnds ) 
121
+        res = minimize(harmonic2Norm, ((f0,f1)), args=(sN, fs, t, f0k1, kNs0, f0ks, f1k1, kNs1, f1ks), jac='2-point', method='L-BFGS-B', bounds=bnds ) 
122
 
122
 
123
     return harmonicEuler2(sN, fs, t, res.x[0], f0k1, f0kN, f0ks, res.x[1], f1k1, f1kN, f1ks), res.x[0], res.x[1]#[0]
123
     return harmonicEuler2(sN, fs, t, res.x[0], f0k1, f0kN, f0ks, res.x[1], f1k1, f1kN, f1ks), res.x[0], res.x[1]#[0]
124
 
124
 

+ 3
- 2
akvo/tressel/mrsurvey.py View File

2126
         self.windead = 0.    
2126
         self.windead = 0.    
2127
         for ift in np.arange(100,0,-1):
2127
         for ift in np.arange(100,0,-1):
2128
             #print( ift, fft1[ift] )
2128
             #print( ift, fft1[ift] )
2129
-            if fft1[ift] > .001:
2129
+            if (abs(fft1[ift])/abs(fft1[0])) > 1e-2:
2130
                 #print ("DEAD TIME", 1e3*self.DATADICT[pulse]["TIMES"][ift] - 1e3*self.DATADICT[pulse]["TIMES"][0] ) 
2130
                 #print ("DEAD TIME", 1e3*self.DATADICT[pulse]["TIMES"][ift] - 1e3*self.DATADICT[pulse]["TIMES"][0] ) 
2131
                 dead = 1e3*self.DATADICT[pulse]["TIMES"][ift] - 1e3*self.DATADICT[pulse]["TIMES"][0]
2131
                 dead = 1e3*self.DATADICT[pulse]["TIMES"][ift] - 1e3*self.DATADICT[pulse]["TIMES"][0]
2132
                 self.windead = self.DATADICT[pulse]["TIMES"][ift] - self.DATADICT[pulse]["TIMES"][0]
2132
                 self.windead = self.DATADICT[pulse]["TIMES"][ift] - self.DATADICT[pulse]["TIMES"][0]
2167
                 iFID += 1
2167
                 iFID += 1
2168
             if trunc:
2168
             if trunc:
2169
                 self.DATADICT[pulse]["TIMES"] = self.DATADICT[pulse]["TIMES"][idead:-idead]
2169
                 self.DATADICT[pulse]["TIMES"] = self.DATADICT[pulse]["TIMES"][idead:-idead]
2170
+                [WINDOWxx, ndxx, istart, iend, deadxx, ideadxx] = self.computeWindow(pulse, band, centre, ftype)
2170
 
2171
 
2171
-        self.plotFT(canvas, istart, iend)
2172
+            self.plotFT(canvas, istart, iend)
2172
         self.doneTrigger.emit() 
2173
         self.doneTrigger.emit() 
2173
 
2174
 
2174
     def bandpassFilter(self, canvas, blank, plot=True):
2175
     def bandpassFilter(self, canvas, blank, plot=True):

Loading…
Cancel
Save