[Commits] [svn:einsteintoolkit] pyGWAnalysis/trunk/ (Rev. 14)

reisswig at tapir.caltech.edu reisswig at tapir.caltech.edu
Thu May 10 19:23:43 CDT 2012


User: reisswig
Date: 2012/05/10 07:23 PM

Modified:
 /trunk/DataAnalysis/
  DataAnalysis.py
 /trunk/DiscreteFunction/
  DiscreteFunction.py, WaveFunction.py

Log:
 1) Make sure monotonic phase-alignment loop is executed at least once.
 2) Better handling of loading data. It is now possible to have non-float columns.

File Changes:

Directory: /trunk/DataAnalysis/
===============================

File [modified]: DataAnalysis.py
Delta lines: +3 -1
===================================================================
--- trunk/DataAnalysis/DataAnalysis.py	2012-03-28 01:05:46 UTC (rev 13)
+++ trunk/DataAnalysis/DataAnalysis.py	2012-05-11 00:23:43 UTC (rev 14)
@@ -723,12 +723,13 @@
     minX = x_off
     trueMinX = x_off
     trueDeltaPhi = 0
+    firstTime = True
 
     # If function is monotonic, we can use a faster algorithm
     if (monotonic==True):
         factor = 2.0*delta/accuracy*0.1
         maxX = start_xoff+delta
-        while (factor >= 1.0):
+        while (factor >= 1.0 or firstTime == True):
             x_off = minX
             minErr = 10e10
             while (x_off < maxX):
@@ -757,6 +758,7 @@
                     break
                 x_off += accuracy*factor
             factor *= 0.1
+            FirstTime = False
         return trueMinX, trueDeltaPhi
         
         print "ERROR! ...using brute force method!"

Directory: /trunk/DiscreteFunction/
===================================

File [modified]: DiscreteFunction.py
Delta lines: +8 -5
===================================================================
--- trunk/DiscreteFunction/DiscreteFunction.py	2012-03-28 01:05:46 UTC (rev 13)
+++ trunk/DiscreteFunction/DiscreteFunction.py	2012-05-11 00:23:43 UTC (rev 14)
@@ -55,12 +55,13 @@
 	    if line[0]=='#' or line[0]=='"' or len(line.strip())==0:
     		continue
 	    data = []
-	    data = map(float, line.split())
-	    x_.append(data[col1-1])
+	    #data = map(float, line.split())
+	    data = line.split()
+	    x_.append(float(data[col1-1]))
 	    if (len(data) == 2 or col3<=0):
-		f_.append(data[col2-1])
+		f_.append(float(data[col2-1]))
 	    else:
-		f_.append(complex(data[col2-1], data[col3-1]))
+		f_.append(complex(float(data[col2-1]), float(data[col3-1])))
 	fp.close()
 	
 	self.x = array(x_)
@@ -712,12 +713,13 @@
     minErr = 10e10
     minX = x_off
     trueMinX = x_off
+    firstTime = True
 
     # If function is monotonic, we can use a faster algorithm
     if (monotonic==True):
 	factor = 2.0*delta/accuracy*0.1
 	maxX = start_xoff+delta
-	while (factor >= 1.0):
+	while (factor >= 1.0 or firstTime == True):
 	    x_off = minX
 	    minErr = 10e10
 	    while (x_off < maxX):
@@ -737,6 +739,7 @@
 		    break
 		x_off += accuracy*factor
 	    factor *= 0.1
+	    firstTime = False
 	return trueMinX
 	
 	print "ERROR! ...using brute force method!"

File [modified]: WaveFunction.py
Delta lines: +5 -0
===================================================================
--- trunk/DiscreteFunction/WaveFunction.py	2012-03-28 01:05:46 UTC (rev 13)
+++ trunk/DiscreteFunction/WaveFunction.py	2012-05-11 00:23:43 UTC (rev 14)
@@ -112,3 +112,8 @@
 	
 	return res
     
+
+
+
+
+



More information about the Commits mailing list