Meta — Extractor and Bins¶
light_curve.Extractor
¶
Combine multiple feature extractors into a single callable.
Pass any number of feature objects; the result behaves like a single
feature whose output is the concatenation of all individual outputs.
Use :meth:__call__ for a single light curve or :meth:many for batch
processing. Especially efficient for cheap features because it avoids
repeated passes over the data and reduces Python–Rust call overhead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*features
|
feature objects
|
Any mix of Rust-backed or pure-Python feature instances. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Concatenated feature names from all sub-features. |
descriptions |
list of str
|
Concatenated descriptions from all sub-features. |
Examples:
>>> import numpy as np
>>> from light_curve import Extractor, Amplitude, StandardDeviation
>>> ext = Extractor(Amplitude(), StandardDeviation())
>>> t = np.array([0.0, 1.0, 2.0, 3.0, 4.0])
>>> m = np.array([15.1, 14.9, 15.2, 15.0, 14.8])
>>> ext(t, m)
array([...])
light_curve.Bins
¶
Bases: _FeatureEvaluator
Sampled time series meta-feature
Binning time series to bins with width \(\mathrm{window}\) with respect to some \(\mathrm{offset}\). \(j-th\) bin interval is \([j \cdot \mathrm{window} + \mathrm{offset}; (j + 1) \cdot \mathrm{window} + \mathrm{offset})\). Binned time series is defined by
where \(N_j\) is a number of sampling observations and all sums are over observations inside considering bin. Bins takes any other feature evaluators to extract features from sample time series
- Depends on: time, magnitude, magnitude error
- Minimum number of observations: as required by sub-features, but at least 1
- Number of features: as provided by sub-features
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
iterable
|
Features to extract from binned time-series |
required |
window
|
positive float
|
Width of binning interval in units of time |
required |
offset
|
float
|
Zero time moment |
required |
transform
|
None
|
Not supported, apply transformations to individual features |
None
|
bands
|
list of str or None
|
Passband names for multiband mode. If given, each single-band feature in
|
required |
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 |
Methods:
| Name | Description |
|---|---|
__call__ |
Extract features and return them as a numpy array |
many |
Extract features from multiple light curves in parallel |