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 licu
import numpy as np
t = np . array ([ 0.0 , 1.2 , 3.5 , 7.1 , 9.0 , 11.0 , 13.0 , 15.0 , 17.0 , 19.0 ])
m = np . array ([ 15.1 , 15.3 , 14.9 , 15.0 , 15.2 , 15.1 , 14.8 , 15.3 , 15.0 , 15.1 ])
err = np . array ([ 0.05 ] * 10 )
band = np . tile ([ "g" , "r" ], 5 )
ext = licu . Extractor ( licu . Chi2Pvar (), licu . BeyondNStd ( nstd = 1 ), licu . LinearFit ( bands = [ "g" , "r" ]))
result = ext ( t , m , err , band )
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
Variability
Fast: all 26 features combined ~100 µs on 1,000 observations, single band.
Linear trend
Fast: both features combined ~10 µs on 1,000 observations, single band.
Feature
Description
Outputs
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
Time sampling
Fast: all 6 features combined ~5 µs on 1,000 observations, single band.
Periodogram
Feature
Description
Outputs
Periodogram
Lomb–Scargle periodogram: period and power of the strongest peaks; supports phase_features to extract features from the phase-folded light curve at the best period
≥2
Non-linear 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
Multiband parametric fit
Feature
Description
Outputs
RainbowFit
Multiband blackbody fit (Russeil+23) — bolometric flux + temperature evolution + SED spectral model
4 to 10+
Multiband
Fast: all 4 features combined ~20 µs on 1,000 observations.
Feature
Description
Outputs
ColorOfMaximum
Difference between maximum magnitudes of two bands
1
ColorOfMedian
Difference between median magnitudes of two bands
1
ColorOfMinimum
Difference between minimum magnitudes of two bands
1
ColorSpread
Population std dev of per-band weighted mean magnitudes
1
Detection-based (experimental)
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