diff --git a/tupak/core/utils.py b/tupak/core/utils.py index 6dc9a0c98f652ed422a10a5658517d5f750bace8..74704d931327e7fc5a95b14cd20e5d8376d46168 100644 --- a/tupak/core/utils.py +++ b/tupak/core/utils.py @@ -222,7 +222,7 @@ def create_white_noise(sampling_frequency, duration): def nfft(time_domain_strain, sampling_frequency): """ Perform an FFT while keeping track of the frequency bins. Assumes input - time series is real (positive frequencies only) + time series is real (positive frequencies only). Parameters ---------- @@ -235,7 +235,7 @@ def nfft(time_domain_strain, sampling_frequency): ------- frequency_domain_strain, frequency_array: (array, array) Single-sided FFT of time domain strain normalised to units of - strain / sqrt(Hz), and the associated frequency_array. + strain / Hz, and the associated frequency_array. """ @@ -253,20 +253,20 @@ def nfft(time_domain_strain, sampling_frequency): # rfft computes the fft for real inputs frequency_domain_strain = np.fft.rfft(time_domain_strain) - # normalise to units of strain / sqrt(Hz) + # normalise to units of strain / Hz norm_frequency_domain_strain = frequency_domain_strain / sampling_frequency return norm_frequency_domain_strain, frequency_array def infft(frequency_domain_strain, sampling_frequency): - """ Inverse FFT for use in conjunction with nfft + """ Inverse FFT for use in conjunction with nfft. Parameters ---------- frequency_domain_strain: array_like Single-sided, normalised FFT of the time-domain strain data (in units - of strain / sqrt(Hz). + of strain / Hz). sampling_frequency: float Sampling frequency of the data. @@ -277,7 +277,7 @@ def infft(frequency_domain_strain, sampling_frequency): """ if np.ndim(sampling_frequency) != 0: - raise ValueError("Sampling frequency must be interger or float") + raise ValueError("Sampling frequency must be integer or float") time_domain_strain_norm = np.fft.irfft(frequency_domain_strain) time_domain_strain = time_domain_strain_norm * sampling_frequency diff --git a/tupak/gw/detector.py b/tupak/gw/detector.py index ba3a639cd8548b6e11300f5e7494a4ed3aee5136..2e52a42dd724a0c84a5063d9652fe547e54edb6e 100644 --- a/tupak/gw/detector.py +++ b/tupak/gw/detector.py @@ -218,7 +218,7 @@ class InterferometerStrainData(object): """ Returns the frequency domain strain This is the frequency domain strain normalised to units of - strain / sqrt(Hz), obtained by a one-sided Fourier transform of the + strain / Hz, obtained by a one-sided Fourier transform of the time domain data, divided by the sampling frequency. """ if self._frequency_domain_strain is not None: @@ -1009,6 +1009,7 @@ class Interferometer(object): @property def frequency_domain_strain(self): + """ The frequency domain strain in units of strain / Hz """ return self.strain_data.frequency_domain_strain def time_delay_from_geocenter(self, ra, dec, time):