Package pylal :: Module lalfft
[hide private]
[frames] | no frames]

Source Code for Module pylal.lalfft

 1  # Copyright (C) 2009  Kipp Cannon 
 2  # 
 3  # This program is free software; you can redistribute it and/or modify it 
 4  # under the terms of the GNU General Public License as published by the 
 5  # Free Software Foundation; either version 2 of the License, or (at your 
 6  # option) any later version. 
 7  # 
 8  # This program is distributed in the hope that it will be useful, but 
 9  # WITHOUT ANY WARRANTY; without even the implied warranty of 
10  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General 
11  # Public License for more details. 
12  # 
13  # You should have received a copy of the GNU General Public License along 
14  # with this program; if not, write to the Free Software Foundation, Inc., 
15  # 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. 
16   
17   
18  # 
19  # ============================================================================= 
20  # 
21  #                                   Preamble 
22  # 
23  # ============================================================================= 
24  # 
25   
26   
27  """ 
28  This module provides some utilities to assist with FFTs 
29  """ 
30   
31   
32  import lal 
33   
34   
35  import git_version 
36   
37   
38  __author__ = "Kipp Cannon <kipp.cannon@ligo.org>" 
39  __version__ = "git id %s" % git_version.id 
40  __date__ = git_version.date 
41   
42   
43  # 
44  # ============================================================================= 
45  # 
46  #                                  Utilities 
47  # 
48  # ============================================================================= 
49  # 
50   
51   
52 -def prepare_fseries_for_real8tseries(series):
53 """ 54 Construct a COMPLEX16FrequencySeries object suitable for storing 55 the Fourier transform of a REAL8TimeSeries object. 56 """ 57 n = len(series.data.data) 58 return lal.CreateCOMPLEX16FrequencySeries( 59 name = series.name, 60 epoch = series.epoch, 61 f0 = series.f0, # note: non-zero f0 not supported by LAL 62 deltaF = 1.0 / (n * series.deltaT), 63 sampleUnits = series.sampleUnits * lal.SecondUnit, 64 length = n // 2 + 1 65 )
66 67
68 -def prepare_fseries_for_complex16tseries(series):
69 """ 70 Construct a COMPLEX16FrequencySeries object suitable for storing 71 the Fourier transform of a COMPLEX16TimeSeries object. 72 """ 73 n = len(series.data.data) 74 return lal.CreateCOMPLEX16FrequencySeries( 75 name = series.name, 76 epoch = series.epoch, 77 f0 = series.f0, # note: non-zero f0 not supported by LAL 78 deltaF = 1.0 / (n * series.deltaT), 79 sampleUnits = series.sampleUnits * lal.SecondUnit, 80 length = n 81 )
82