Periodogram
light_curve.Periodogram
Bases: light_curve.light_curve_ext._FeatureEvaluator
Peaks of Lomb–Scargle periodogram and periodogram as a meta-feature
Periodogram \(P(\omega)\) is an estimate of spectral density of unevenly time series. peaks argument
corresponds to a number of the most significant spectral density peaks to return. For each peak its
period and "signal to noise" ratio is returned:
[Periodogram] can accept other features for feature extraction from periodogram as it was time series without observation errors (unity weights are used if required). You can even pass one [Periodogram] to another one if you are crazy enough
- Depends on: time, magnitude
- Minimum number of observations: as required by sub-features, but at least two
- Number of features: \(2 \times \mathrm{peaks}\) plus sub-features
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
peaks
|
int or None
|
Number of peaks to find, default is 1 |
required |
resolution
|
float or None
|
Resolution of frequency grid, default is 10 |
required |
max_freq_factor
|
float or None
|
Mulitplier for Nyquist frequency, default is 1 |
required |
nyquist
|
str or float or None
|
Type of Nyquist frequency. Could be one of: - 'average': "Average" Nyquist frequency - 'median': Nyquist frequency is defined by median time interval between observations - float: Nyquist frequency is defined by given quantile of time intervals between observations Default is 'average' |
required |
freqs
|
array - like or None
|
Explicid and fixed frequency grid (angular frequency, radians/time unit).
If given, |
required |
fast
|
bool or None
|
Use "Fast" (approximate and FFT-based) or direct periodogram algorithm, default is True |
required |
features
|
iterable or None
|
Features to extract from periodogram considering it as a time-series, default is None which means no additional features Features to extract from periodogram considering it as a time-series |
required |
normalization
|
str
|
Normalization of the periodogram power. Affects |
required |
transform
|
None
|
Not supported for Periodogram, peaks are not transformed, but you still may apply transformation for the underlying features with thier constructors |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
freq_power(t, m, *, cast=False) |
Get periodogram as a pair of frequencies and power values Parameterst : np.ndarray of np.float32 or np.float64 Time array m : np.ndarray of np.float32 or np.float64 Magnitude (flux) array cast : bool, optional Cast inputs to np.ndarray objects of the same dtype Returnsfreq : np.ndarray of np.float32 or np.float64 Frequency grid power : np.ndarray of np.float32 or np.float64 Periodogram power |
|
power(t, m, *, cast=False) |
Get periodogram power Parameterst : np.ndarray of np.float32 or np.float64 Time array m : np.ndarray of np.float32 or np.float64 Magnitude (flux) array cast : bool, optional Cast inputs to np.ndarray objects of the same dtype Returnspower : np.ndarray of np.float32 or np.float64 Periodogram power |
Examples:
>>> import numpy as np
>>> from light_curve import Periodogram
>>> periodogram = Periodogram(peaks=2, resolution=20.0, max_freq_factor=2.0,
... nyquist='average', fast=True)
>>> t = np.linspace(0, 10, 101)
>>> m = np.sin(2*np.pi * t / 0.7) + 0.5 * np.cos(2*np.pi * t / 3.3)
>>> peaks = periodogram(t, m, sorted=True)[::2]
>>> frequency, power = periodogram.freq_power(t, m)
freq_power
method descriptor
Angular frequencies and periodogram values
power
method descriptor
Periodogram values