Skip to content

Feature extractors

light_curve provides 40+ hand-crafted feature extractors for astrophysical light curves. All share a common interface: callable objects with .names and .descriptions attributes.

import light_curve as lc
import numpy as np

t = np.array([0.0, 1.2, 3.5, 7.1, 9.0])
m = np.array([15.1, 15.3, 14.9, 15.0, 15.2])
err = np.array([0.05, 0.05, 0.05, 0.05, 0.05])

ext = lc.Extractor(lc.Amplitude(), lc.BeyondNStd(nstd=1), lc.LinearFit())
result = ext(t, m, err)
print(dict(zip(ext.names, result)))

Use Extractor to combine multiple features into a single callable, or call each class directly for a single feature. The .many() method processes a list of light curves in batch with reduced Python–Rust overhead.

See the API reference for full signatures, parameters, and equations.


Feature table

Statistical

Feature Description Outputs
Amplitude Half peak-to-peak amplitude 1
AndersonDarlingNormal Unbiased Anderson–Darling normality test statistic 1
BeyondNStd Fraction of observations beyond \(n\,\sigma_m\) from \(\langle m \rangle\) 1
Cusum Range of cumulative sums 1
ExcessVariance Measure of intrinsic variability amplitude 1
InterPercentileRange \(Q(1-p) - Q(p)\) inter-percentile range 1
Kurtosis Excess kurtosis of magnitude 1
Mean Mean magnitude 1
MeanVariance Standard deviation to mean ratio 1
Median Median magnitude 1
MedianAbsoluteDeviation Median of \(\lvert m_i - \mathrm{median}(m) \rvert\) 1
MedianBufferRangePercentage Fraction of points within \(q \times \mathrm{amplitude}\) of median 1
OtsuSplit Otsu thresholding: bimodality measure (subset means, std devs, fraction) 4
PercentAmplitude Maximum deviation of magnitude from its median 1
PercentDifferenceMagnitudePercentile Ratio of inter-percentile range to median 1
ReducedChi2 Reduced \(\chi^2\) of magnitude measurements 1
Roms Robust median statistic (experimental) 1
Skew Skewness \(G_1\) of magnitude 1
StandardDeviation Standard deviation \(\sigma_m\) of magnitude 1
StetsonK Stetson \(K\) light-curve shape coefficient 1
WeightedMean Inverse-variance weighted mean magnitude 1

Variability & trend

Feature Description Outputs
Eta Von Neumann \(\eta\) 1
EtaE \(\eta^e\), adapted for unevenly sampled time series 1
LinearFit Slope, its error, and reduced \(\chi^2\) of the weighted linear fit 3
LinearTrend Slope, its error, and noise level of the unweighted linear fit 3
MaximumSlope Maximum slope between consecutive observations 1

Time sampling

Feature Description Outputs
Duration Total time span of the light curve 1
MaximumTimeInterval Maximum gap between consecutive observations 1
MinimumTimeInterval Minimum gap between consecutive observations 1
ObservationCount Number of observations 1
TimeMean Mean observation time 1
TimeStandardDeviation Standard deviation of observation times 1

Periodogram

Feature Description Outputs
Periodogram Lomb–Scargle periodogram: period and power of the strongest peaks ≥2

Parametric fits (transients, flux only)

Feature Description Outputs
BazinFit Bazin function — 5-parameter rising/falling exponential fit for core-collapse SNe 6
LinexpFit Linexp function — linear-times-exponential fit for core-collapse SNe 5
VillarFit Villar function — 7-parameter Gaussian+plateau fit for SN classification 8

Detection-based (experimental)

Feature Description Outputs
FluxNNotDetBeforeFd Number of non-detections (flux) before the first detection 1
MagnitudeNNotDetBeforeFd Number of non-detections (magnitude) before the first detection 1

Multiband (experimental)

Feature Description Outputs
ColorOfMedian Difference between median magnitudes of two bands 1
RainbowFit Multiband blackbody fit (Russeil+23) — bolometric flux + temperature evolution 8

Meta

Feature Description
Extractor Combine multiple feature extractors into a single callable
Bins Bin a time series, then apply any set of features to each bin