SpectralVariance#
- class gwpy.frequencyseries.SpectralVariance(
- data: ArrayLike,
- bins: ArrayLike1D,
- unit: UnitLike = None,
- f0: Quantity | float | None = None,
- df: Quantity | float | None = None,
- frequencies: ArrayLike1D | None = None,
- name: str | None = None,
- channel: Channel | str | None = None,
- epoch: SupportsToGps | None = None,
- **kwargs,
Bases:
Array2DA variance histogram of a
FrequencySeries.Attributes Summary
Transpose is not supported.
Array of bin edges, including the rightmost edge.
Frequency spacing of this
SpectralVariance.Size of the first (lowest value) amplitude bin.
Starting frequency for this
SpectralVariance.Array of frequencies for each sample
Read data into a
SpectralVariance.Write this
SpectralVarianceto a file.Starting value of the first (lowest value) amplitude bin.
List of left-hand amplitude bin edges.
Amplitude range (low, high) spanned by this array.
Methods Summary
from_spectrogram(*spectrograms[, bins, low, ...])Calculate a new
SpectralVariancefrom a Spectrogram.percentile(percentile)Calculate a given spectral percentile for this
SpectralVariance.plot([xscale, method])Plot the data for this SpectralVariance.
Attributes Documentation
- df[source]#
Frequency spacing of this
SpectralVariance.
- f0[source]#
Starting frequency for this
SpectralVariance.
- read#
Read data into a
SpectralVariance.Arguments and keywords depend on the output format, see the online documentation for full details for each format, the parameters below are common to most formats.
- Parameters:
- source
str,os.PathLike,file, orlistofthese Source of data, any of the following:
Path of a single data file
List of data file paths
Path of LAL-format cache file
- args
Other positional arguments are (in general) specific to the given
format. See below for list of acceptable formats.- format
str, optional Source format identifier. If not given, the format will be detected if possible. See below for list of acceptable formats.
- kwargs
Other keywords are (in general) specific to the given
format. See below for list of acceptable formats.
- source
- Raises:
IndexErrorIf
sourceis an empty list.
- write#
Write this
SpectralVarianceto a file.Arguments and keywords depend on the output format, see the online documentation for full details for each format, the parameters below are common to most formats.
Methods Documentation
- classmethod from_spectrogram(
- *spectrograms: Spectrogram,
- bins: ArrayLike1D | None = None,
- low: float | None = None,
- high: float | None = None,
- nbins: int = 500,
- log: bool = False,
- norm: bool = False,
- density: bool = False,
Calculate a new
SpectralVariancefrom a Spectrogram.- Parameters:
- *spectrograms
Spectrogram Input
Spectrogramdata.- bins
ndarray, optional Array of histogram bin edges, including the rightmost edge.
- low
float, optional Left edge of lowest amplitude bin, only read if
binsis not given.- high
float, optional Right edge of highest amplitude bin, only read if
binsis not given.- nbins
int, optional Number of bins to generate, only read if
binsis not given, default:500.- log
bool, optional Calculate amplitude bins over a logarithmic scale, only read if
binsis not given, default:False.- norm
bool, optional Normalise bin counts to a unit sum, default:
False.- density
bool, optional Normalise bin counts to a unit integral, default:
False.
- *spectrograms
- Returns:
- specvar
SpectralVariance 2D-array of spectral frequency-amplitude counts.
- specvar
See also
numpy.histogramThe histogram function.
- percentile(
- percentile: float,
Calculate a given spectral percentile for this
SpectralVariance.- Parameters:
- percentile
float Percentile (0 - 100) of the bins to compute.
- percentile
- Returns:
- spectrum
FrequencySeries The given percentile
FrequencySeriescalculated from thisSpectralVariance.
- spectrum