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
         <rect>
73
         <rect>
74
          <x>0</x>
74
          <x>0</x>
75
          <y>0</y>
75
          <y>0</y>
76
-         <width>967</width>
77
-         <height>922</height>
76
+         <width>966</width>
77
+         <height>919</height>
78
         </rect>
78
         </rect>
79
        </property>
79
        </property>
80
        <layout class="QHBoxLayout" name="horizontalLayout_2">
80
        <layout class="QHBoxLayout" name="horizontalLayout_2">
96
            <enum>Qt::LeftToRight</enum>
96
            <enum>Qt::LeftToRight</enum>
97
           </property>
97
           </property>
98
           <property name="currentIndex">
98
           <property name="currentIndex">
99
-           <number>2</number>
99
+           <number>0</number>
100
           </property>
100
           </property>
101
           <widget class="QWidget" name="tab">
101
           <widget class="QWidget" name="tab">
102
            <property name="minimumSize">
102
            <property name="minimumSize">
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;
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
 &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;
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
 p, li { white-space: pre-wrap; }
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
 &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>
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
              </property>
806
              </property>
807
             </widget>
807
             </widget>
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;
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
 &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;
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
 p, li { white-space: pre-wrap; }
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
 &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>
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
              </property>
859
              </property>
860
             </widget>
860
             </widget>
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;
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
 &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;
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
 p, li { white-space: pre-wrap; }
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
             </property>
3151
             </property>
3152
            </widget>
3152
            </widget>
3153
            <widget class="QLabel" name="label_53">
3153
            <widget class="QLabel" name="label_53">
3178
      <x>0</x>
3178
      <x>0</x>
3179
      <y>0</y>
3179
      <y>0</y>
3180
      <width>1000</width>
3180
      <width>1000</width>
3181
-     <height>25</height>
3181
+     <height>20</height>
3182
     </rect>
3182
     </rect>
3183
    </property>
3183
    </property>
3184
    <widget class="QMenu" name="menuFile">
3184
    <widget class="QMenu" name="menuFile">

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

610
                     #############################################################
610
                     #############################################################
611
                     # Rotated amplitude
611
                     # Rotated amplitude
612
                     #if ipm != 0:
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
                     #else:
615
                     #else:
616
                     #    [success, E0, df, phi, T2] = decay.quadratureDetect2( ht.real, ht.imag, self.DATADICT[pulse]["TIMES"])
616
                     #    [success, E0, df, phi, T2] = decay.quadratureDetect2( ht.real, ht.imag, self.DATADICT[pulse]["TIMES"])
617
                     #[success, E0, df, phi, T2] = decay.quadratureDetect( ht.real, ht.imag, self.DATADICT[pulse]["TIMES"] )
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
                     D = self.RotateAmplitude( ht.real, ht.imag, phi, df, self.DATADICT[pulse]["TIMES"] )
620
                     D = self.RotateAmplitude( ht.real, ht.imag, phi, df, self.DATADICT[pulse]["TIMES"] )
620
                     CA[pulse][chan][ipm,:] = D.imag[clip::]  # amplitude data 
621
                     CA[pulse][chan][ipm,:] = D.imag[clip::]  # amplitude data 
621
                     NR[pulse][chan][ipm,:] = D.real[clip::]  # noise data
622
                     NR[pulse][chan][ipm,:] = D.real[clip::]  # noise data

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

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

Loading…
Cancel
Save