pygwb.omega_spectra

This module contains two classes that deal with the spectra and spectrograms in the pygwb analysis. These objects can be reweighted with different values of the Hubble parameter h0, power-law indices and reference frequencies. The classes inherit all features from the gwpy.spectrogram.Spectrogram parent class. More information can be found here.

The main addition compared to the parent class constitutes the ability to read and save to a pickle file, but also to reweight the data inside the spectrogram. In the analysis, it is often important to reweight quickly the output data to test new analysis models and/or run parameter estimation (PE).

Similarly to the spectrogram, we introduce the same features in an OmegaSpectrum class, based on the gwpy.frequencyseries.FrequencySeries class. More information about the parent class can be found here.

Examples

For the sake of the example, we elaborate on the OmegaSpectrogram class from this module. We import the module and make an OmegaSpectrogram object from a gwpy.spectrogram.Spectrogram object, which we call Y_spectrogram. Then, we save it into a pickle file and load it using that same pickle file.

>>> from pygwb.omega_spectra import OmegaSpectrogram
>>> omg_spectrogram = OmegaSpectrogram(Y_spectrogram, alpha=0, fref=25)
>>> omg_spectrogram.save_to_pickle_pickle("pickle_test.p")
>>> omg_load = OmegaSpectrogram.load_from_pickle("pickle_test.p")

The spectrogram was created with a spectral index equal to zero. One can use the reweight function to change the index. Additionally, one could change the reference frequency of the spectrum as well. Additionally, one can change the value of h0 for the spectrogram which can be useful to compare between different cosmologies.

>>> omg_load.reweight(new_alpha = 2/3.)
>>> omg_load.reset_h0(new_h0 = 1)

The OmegaSpectrum object has the same features as the OmegaSpectrogram described above. For additional information, we refer to the API documentation of the module.

Functions

reweight_spectral_object(spec, freqs, ...[, ...])

Reweight a spectrum or spectrogram object.

Classes

OmegaSpectrogram(data, **kwargs)

Subclass of gwpy's Spectrogram class.

OmegaSpectrum(data, **kwargs)

Subclass of gwpy's FrequencySeries class.