The FrequencySeries
class¶
While gravitationalwave detectors are timedomain instruments, their sensitivity is frequency dependent and so is often measured as a powerspectraldensity over the range of interesting gravitationalwave frequencies (~1010,000 Hz). Additionally, the auxiliary channels used to sense and control instrumental operations each have their own frequencydomain characteristics, contributing to the overall sensitivity spectrum.
The FrequencySeries
object is used to represent any frequency series, including the powerspectral (and amplitudespectral) density series describing instrument performance.
Analogously to the TimeSeries
, a new FrequencySeries
can be generated from any data sequence along with the minimal f0
and df
metadata:
>>> from gwpy.frequencyseries import FrequencySeries
>>> spec = FrequencySeries([1,2,3,4,5,6,7,8,9,10], f0=0, df=1)
>>> print(spec)
FrequencySeries([ 1 2 3 4 5 6 7 8 9 10],
name: None,
unit: None,
epoch: None,
channel: None,
f0: 0 Hz,
df: 1 Hz,
logf: False)
The full set of metadata that can be provided is as follows:
Name for this data set 

The physical unit of these data 

GPS epoch associated with these data 

Starting frequency for this 

Frequency spacing of this 
Generating a FrequencySeries
from a TimeSeries
¶
The frequencyspectrum of a TimeSeries
can be calculated using either of the following methods:
Calculate the PSD 

Calculate the ASD 
In this example we expand upon plotting a TimeSeries
, by calculating the amplitudespectral density of the gravitationalwave strain data from LHO:
>>> from gwpy.timeseries import TimeSeries
>>> gwdata = TimeSeries.get('H1:LDASSTRAIN', 'September 16 2010 06:40',
... 'September 16 2010 06:50')
>>> spectrum = gwdata.asd(8, 4)
where the result is an average spectrum calculated using the Welch method.
Reading/writing frequencydomain data¶
Plotting a FrequencySeries
¶
Similary to the TimeSeries
, the FrequencySeries
object comes with its own plot()
method, which will quickly construct a Plot
:
>>> plot = spectrum.plot()
>>> ax = plot.gca()
>>> ax.set_xlim(40, 4000)
>>> ax.set_ylabel(r'GW strain ASD [strain$/\sqrt{\mathrm{Hz}}$]')
>>> ax.set_ylim(1e23, 3e20)
>>> plot.show()
(png
)
FrequencySeries
applications¶
FrequencySeries
reference¶

A data array holding some metadata to represent a frequency series 

A 2dimensional array containing the variance histogram of a frequencyseries 