pygwb.postprocessing.calc_Y_sigma_from_Yf_sigmaf
- pygwb.postprocessing.calc_Y_sigma_from_Yf_sigmaf(Y_f, sigma_f, frequency_mask=True, alpha=None, fref=None)[source]
Calculate the omega point estimate and sigma from their respective spectra, or spectrograms, taking into account the desired spectral weighting. To apply weighting, the frequency array associated to the spectra must be supplied.
If applied to a 1D array, you get single numbers out. If applied to a 2D array, it combines over the second dimension. That is, if dimension is Ntimes x Nfrequencies, then the resulting spectra are Ntimes long.
- Parameters:
Y_f (
pygwb.omega_spectrogram.OmegaSpectrogram
) – Point estimate spectrum.sigma_f (
pygwb.omega_spectrogram.OmegaSpectrogram
) – Sigma spectrum.frequency_mask (
array-like
, optional) – Boolean mask to apply to frequencies for the calculation. Default set to True including all frequencies.alpha (
float
, optional) – Spectral index to use in case re-weighting is requested. Default set to None.fref (
float
, optional) – Reference frequency to use in case re-weighting is requested. Default set to None.
- Returns:
- Y:
array-like
orfloat
Point estimate or Point estimate spectrum.
- sigma:
array-like
orfloat
Point estimate standard deviation (theoretical) or spectrum of point estimate standard deviations.
- Y:
Notes
If passing in spectrograms, the point estimate and sigma will be calculated per spectrum, without any time-averaging applied. Y_f and sigma_f can also be
gwpy.spectrogram.Spectrogram
objects, or numpy arrays. In these cases however the reweight functionality is not supported.