Periodogram¶
light_curve.Periodogram
¶
Bases: _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.
Additionally, [Periodogram] supports phase features: features extracted from the light curve
phase-folded at the best period. The phase runs from 0 to 1, with phase 0 at the magnitude minimum.
Phase feature names are prefixed with period_folded_.
- 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 spectrum sub-features plus phase sub-features
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
peaks
|
int or None
|
Number of peaks to find |
1
|
resolution
|
float or None
|
Resolution of frequency grid |
10
|
max_freq_factor
|
float or None
|
Mulitplier for Nyquist frequency |
1
|
nyquist
|
str or float or None
|
Type of Nyquist frequency. Could be one of:
|
'average'
|
freqs
|
array - like or None
|
Explicit and fixed frequency grid (angular frequency, radians/time unit).
If given, |
None
|
fast
|
bool or None
|
Use "Fast" (approximate and FFT-based) or direct periodogram algorithm |
True
|
features
|
iterable or None
|
Features extracted from the periodogram power spectrum, treating it as a
time-series (frequency as time, power as magnitude).
|
None
|
phase_features
|
iterable or None
|
Features to extract from the light curve phase-folded at the best period.
Phase runs from 0 to 1 with phase 0 at the magnitude minimum.
Feature names are prefixed with |
None
|
normalization
|
str
|
Normalization of the periodogram power. Affects
|
'psd'
|
transform
|
None
|
Not supported for Periodogram. Peaks are not transformed, but you may apply transformation for the underlying features via their constructors |
None
|
bands
|
list of str or None
|
Passband names for multiband mode. If provided, a multiband periodogram is evaluated across all passbands simultaneously using a joint frequency grid. |
required |
multiband_normalization
|
str
|
How per-band power spectra are combined into the joint spectrum. Only used
when
|
'chi2'
|
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
bands |
numpy.ndarray of str or None
|
Passband names for multiband mode, or None for single-band mode |
freq_power(t, m, sigma=None, band=None, *, cast=False) |
Get periodogram as a pair of frequencies and power values. In single-band mode ( In multiband mode ( Parameters¶t : np.ndarray of np.float32 or np.float64 Time array m : np.ndarray of np.float32 or np.float64 Magnitude (flux) array sigma : np.ndarray of np.float32 or np.float64, optional
Photometric uncertainties. Used only for chi2-based band combination:
each band is weighted by band : array-like of str, required in multiband mode Passband label for each observation. Must be one of the bands given at construction. cast : bool, optional Cast inputs to np.ndarray objects of the same dtype Returns¶freq : np.ndarray of np.float32 or np.float64 Frequency grid power : np.ndarray of np.float32 or np.float64 Periodogram power (combined across bands in multiband mode) |
|
power(t, m, *, cast=False) |
Get periodogram power Parameters¶t : 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 Returns¶power : 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)