Browse Source

fixed bug in gate integration related to rounding errors

tags/1.6.1
T-bone 6 years ago
parent
commit
5d5a154170
3 changed files with 13 additions and 15 deletions
  1. 8
    8
      akvo/gui/main.ui
  2. 4
    3
      akvo/tressel/mrsurvey.py
  3. 1
    4
      akvo/tressel/rotate.py

+ 8
- 8
akvo/gui/main.ui View File

@@ -73,8 +73,8 @@
73 73
         <rect>
74 74
          <x>0</x>
75 75
          <y>0</y>
76
-         <width>967</width>
77
-         <height>922</height>
76
+         <width>966</width>
77
+         <height>919</height>
78 78
         </rect>
79 79
        </property>
80 80
        <layout class="QHBoxLayout" name="horizontalLayout_2">
@@ -96,7 +96,7 @@
96 96
            <enum>Qt::LeftToRight</enum>
97 97
           </property>
98 98
           <property name="currentIndex">
99
-           <number>2</number>
99
+           <number>0</number>
100 100
           </property>
101 101
           <widget class="QWidget" name="tab">
102 102
            <property name="minimumSize">
@@ -801,7 +801,7 @@ background: dark grey;
801 801
               <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
802 802
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
803 803
 p, li { white-space: pre-wrap; }
804
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:italic;&quot;&gt;
804
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:8pt; font-weight:400; font-style:italic;&quot;&gt;
805 805
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DejaVu Serif'; font-size:9pt;&quot;&gt;Load supported RAW Dataset header from file menu&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
806 806
              </property>
807 807
             </widget>
@@ -854,7 +854,7 @@ p, li { white-space: pre-wrap; }
854 854
               <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
855 855
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
856 856
 p, li { white-space: pre-wrap; }
857
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:italic;&quot;&gt;
857
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:italic;&quot;&gt;
858 858
 &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Serif'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
859 859
              </property>
860 860
             </widget>
@@ -3146,8 +3146,8 @@ background: red;
3146 3146
              <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
3147 3147
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
3148 3148
 p, li { white-space: pre-wrap; }
3149
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
3150
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:9pt;&quot;&gt;All processing steps are recorded here for your records&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
3149
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
3150
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;All processing steps are recorded here for your records&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
3151 3151
             </property>
3152 3152
            </widget>
3153 3153
            <widget class="QLabel" name="label_53">
@@ -3178,7 +3178,7 @@ p, li { white-space: pre-wrap; }
3178 3178
      <x>0</x>
3179 3179
      <y>0</y>
3180 3180
      <width>1000</width>
3181
-     <height>25</height>
3181
+     <height>20</height>
3182 3182
     </rect>
3183 3183
    </property>
3184 3184
    <widget class="QMenu" name="menuFile">

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

@@ -610,12 +610,13 @@ class GMRDataProcessor(SNMRDataProcessor):
610 610
                     #############################################################
611 611
                     # Rotated amplitude
612 612
                     #if ipm != 0:
613
-                    [success, E0, df, phi, T2] = decay.quadratureDetect2( ht.real, ht.imag, self.DATADICT[pulse]["TIMES"], (E0,phi,df,T2))
614
-                    #[ E0, df, phi, T2] = decay.quadratureDetect( ht.real, ht.imag, self.DATADICT[pulse]["TIMES"] )
613
+                    #[success, E0, df, phi, T2] = decay.quadratureDetect2( ht.real, ht.imag, self.DATADICT[pulse]["TIMES"], (E0,phi,df,T2))
614
+                    [success, E0, df, phi, T2] = decay.quadratureDetect( ht.real, ht.imag, self.DATADICT[pulse]["TIMES"] )
615 615
                     #else:
616 616
                     #    [success, E0, df, phi, T2] = decay.quadratureDetect2( ht.real, ht.imag, self.DATADICT[pulse]["TIMES"])
617 617
                     #[success, E0, df, phi, T2] = decay.quadratureDetect( ht.real, ht.imag, self.DATADICT[pulse]["TIMES"] )
618
-                    print("success", success, "E0", E0, "phi", phi, "df", df, "T2", T2)
618
+                    #print("success", success, "E0", E0, "phi", phi, "df", df, "T2", T2)
619
+                    
619 620
                     D = self.RotateAmplitude( ht.real, ht.imag, phi, df, self.DATADICT[pulse]["TIMES"] )
620 621
                     CA[pulse][chan][ipm,:] = D.imag[clip::]  # amplitude data 
621 622
                     NR[pulse][chan][ipm,:] = D.real[clip::]  # noise data

+ 1
- 4
akvo/tressel/rotate.py View File

@@ -128,9 +128,6 @@ def RotateAmplitude(X, Y, zeta, df, t):
128 128
     return np.abs(V) * np.exp( 1j * ( np.angle(V) - zeta - 2.*np.pi*df*t ) )
129 129
     #return np.abs(V) * np.exp( 1j * ( np.angle(V) - zeta - df*t ) )
130 130
 
131
-#def Gate(x, t):
132
-#    pass
133
-
134 131
 def gateIntegrate(T2D, T2T, gpd, sigma, stackEfficiency=2.):
135 132
     """ Gate integrate the signal to gpd, gates per decade
136 133
         T2D = the time series to gate integrate, complex 
@@ -162,7 +159,7 @@ def gateIntegrate(T2D, T2T, gpd, sigma, stackEfficiency=2.):
162 159
 
163 160
     ii = 0
164 161
     for itd in range(len(T2T)):
165
-        if ( T2T[itd] > tdr[ii] ):
162
+        if ( round(T2T[itd], 4) > round(tdr[ii], 4) ):
166 163
             ii += 1
167 164
             # correct window edges to centre about data 
168 165
             tdr[ii-1] = (T2T[itd-1]+T2T[itd])*.5 

Loading…
Cancel
Save