# [Commits] [svn:einsteintoolkit] pyGWAnalysis/trunk/DataAnalysis/ (Rev. 6)

reisswig at tapir.caltech.edu reisswig at tapir.caltech.edu
Wed Feb 1 19:00:04 CST 2012

```User: reisswig
Date: 2012/02/01 07:00 PM

Modified:
/trunk/DataAnalysis/
DataAnalysis.py

Log:
Fixed a bug in mapping array elements.

File Changes:

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

File [modified]: DataAnalysis.py
Delta lines: +6 -6
===================================================================
--- trunk/DataAnalysis/DataAnalysis.py	2011-06-28 14:44:54 UTC (rev 5)
+++ trunk/DataAnalysis/DataAnalysis.py	2012-02-02 01:00:03 UTC (rev 6)
@@ -68,12 +68,12 @@

def TimesToSI(t, M):
"""Converts a list of time values to SI units"""
-    res = map(lambda x: x * M * Msec, t)
+    res = array(map(lambda x: x * M * Msec, t))
return res

def FrequenciesToSI(f, M):
"""Converts a list of frequencies to SI units"""
-    res = map(lambda x: x * 1 / (M*Msec), f)
+    res = array(map(lambda x: x * 1 / (M*Msec), f))
return res

def SelecthPlus(h):
@@ -261,7 +261,7 @@
WF = WaveFunction(WF1.x, WF1.f.conjugate())
fr = WF.Extend(n*WF.Length(), WF.dx, lambda x: 0.0).FourierTransform()

-    #frange = [omega0-1e-4, omega0]
+    #frange = [f0, f0+5e-4]
frange = [f0, f0]

for ii in range(0, fr.Length()):
@@ -269,9 +269,9 @@
#if fr.x[ii] < 0: fr.f[ii] = 0
div = 4*pi**2*fr.x[ii]**2
if abs(fr.x[ii]) < abs(frange[0]): div = 4*pi**2*frange[0]**2
-    	    #if fr.x[ii] > frange[1]: div = 4*pi**2*frange[1]**2
-    	    #if DF1fr.x[ii] > frange[0] and DF1fr.x[ii] < frange[1]: #div = (1.0-GaussBlend(DF1fr.x[ii], frange[0], (frange[1]-frange[0])/100)) * div + GaussBlend(DF1fr.x[ii], frange[0], (frange[1]-frange[0])/100) * 4*pi**2*frange[0]**2
-    	    #    div = (1 - (DF1fr.x[ii]-frange[0])/(frange[1]-frange[0])) * 4*pi**2*frange[0]**2 + (DF1fr.x[ii]-frange[0])/(frange[1]-frange[0]) * div
+    	    #if abs(fr.x[ii]) < abs(frange[0]): div = 4*pi**2*frange[0]**2
+    	    #if abs(fr.x[ii]) > abs(frange[0]) and abs(fr.x[ii]) < abs(frange[1]): #div = (1.0-GaussBlend(DF1fr.x[ii], frange[0], (frange[1]-frange[0])/100)) * div + GaussBlend(DF1fr.x[ii], frange[0], (frange[1]-frange[0])/100) * 4*pi**2*frange[0]**2
+    	    #    div = (1 - (abs(fr.x[ii])-abs(frange[0]))/(abs(frange[1]-frange[0]))) * 4*pi**2*frange[0]**2 + (abs(fr.x[ii])-abs(frange[0]))/(abs(frange[1]-frange[0])) * div
fr.f[ii] = -fr.f[ii]/(div)

else:

```