pygwb.spectral.cross_spectral_density

pygwb.spectral.cross_spectral_density(time_series_data1: TimeSeries, time_series_data2: TimeSeries, segment_duration: int, frequency_resolution: float, coarse_grain: bool = True, overlap_factor: float = 0.5, overlap_factor_welch: float = 0.5, zeropad: bool = False, window_fftgram_dict: dict = {'window_fftgram': 'hann'}, is_psd: bool = False)[source]

Compute the cross spectral density from two time series inputs.

Parameters:
  • time_series_data1 (:code:gwpy.timeseries.TimeSeries) – Timeseries data of detector1.

  • time_series_data2 (gwpy.timeseries.TimeSeries) – Timeseries data of detector2.

  • segment_duration (int) – Data duration (in seconds) over which CSDs need to be calculated.

  • frequency_resolution (float) – Frequency resolution (in Hz) of the final CSDs. This is achieved by averaging in frequency domain.

  • coarse_grain (bool, optional) – Whether to coarsegrain the CSD or not. If True, it will be coarsegrained, otherwise the CSD will be Welch-averaged. Default is True.

  • overlap_factor (float, optional) – Amount of overlap between adjacent segments (range between 0 and 1) Users should provide proper combination of overlap_factor and window_fftgram_dict. For “hann” window use 0.5 overlap_factor and for “boxcar” window use 0 overlap_factor. Default is 0.5 (50% overlap).

  • overlap_factor_welch (float) – Overlap factor to use when using Welch’s method (NOT coarsegraining). Users should provide proper combination of overlap_factor and window_fftgram_dict. For “hann” window use 0.5 overlap_factor and for “boxcar” window use 0 overlap_factor. Default is 0.5 (50% overlap), which is optimal when using Welch’s method with a “hann” window.

  • zeropad (bool, optional) – Before doing FFT whether to zero pad the data equal to the length of FFT or not. Default is False.

  • window_fftgram_dict (dictionary, optional) – Dictionary containing name and parameters describing which window to use for producing FFTs. Default is “hann”.

  • is_psd (bool, optional) – Whether the provided data is a PSD or not. Default is False. The code will treat a PSD slightly different than a CSD.

Returns:
csd_spectrogram: gwpy.spectrogram.Spectrogram

Cross spectral density of the two timeseries.

See also

gwpy.timeseries.TimeSeries

More information here.

gwpy.spectrogram.Spectrogram

More information here.