Feature extractor from noisy time series
Project description
light-curve
processing toolbox for Python
This package provides a collection of light curve feature extractions classes.
Installation
python3 -mpip install light-curve-python
Note that in the future the package will be renamed to light-curve
Feature evaluators
Most of the classes implement various feature evaluators useful for astrophysical sources classification and characterisation using their light curves.
import light_curve as lc
import numpy as np
# Time values can be non-evenly separated but must be an ascending array
n = 101
t = np.linspace(0.0, 1.0, n)
perfect_m = 1e3 * t + 1e2
err = np.sqrt(perfect_m)
m = perfect_m + np.random.normal(0, err)
# Half-amplitude of magnitude
amplitude = lc.Amplitude()
# Fraction of points beyond standard deviations from mean
beyond_std = lc.BeyondNStd(nstd=1)
# Slope, its error and reduced chi^2 of linear fit
linear_fit = lc.LinearFit()
# Feature extractor, it will evaluate all features in more efficient way
extractor = lc.Extractor(amplitude, beyond_std, linear_fit)
# Array with all 5 extracted features
result = extractor(t, m, err)
print('\n'.join(f'{name} = {value:.2f}' for name, value in zip(extractor.names, result)))
# Run in parallel for multiple light curves:
results = amplitude.many([(t[:i], m[:i], err[:i]) for i in range(int(0.5 * n), n)], n_jobs=-1)
print(f'Amplitude of amplitude is {np.ptp(results):.2f}')
Print feature classes list
import light_curve as lc
print(lc._FeatureEvaluator.__subclasses__())
Read feature docs
import light_curve as lc
help(lc.BazinFit)
dm-dt map
Class DmDt
provides dm–dt mapper (based on Mahabal et al. 2011, Soraisam et al. 2020).
import numpy as np
from light_curve import DmDt
from numpy.testing import assert_array_equal
dmdt = DmDt.from_borders(min_lgdt=0, max_lgdt=np.log10(3), max_abs_dm=3, lgdt_size=2, dm_size=4, norm=[])
t = np.array([0, 1, 2], dtype=np.float32)
m = np.array([0, 1, 2], dtype=np.float32)
desired = np.array(
[
[0, 0, 2, 0],
[0, 0, 0, 1],
]
)
actual = dmdt.points(t, m)
assert_array_equal(actual, desired)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
light_curve_python-0.3.5.tar.gz
(122.9 kB
view hashes)
Built Distributions
Close
Hashes for light_curve_python-0.3.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dba5c90e11ca97add2e3bf15d5e902dfc92f8999737829e9f49fac152230619a |
|
MD5 | 5bb2682651a406b509a172946107541c |
|
BLAKE2b-256 | 209b6f9ae6deadad277d25994274c1334469b30f6e792880325df7eca424c2b4 |
Close
Hashes for light_curve_python-0.3.5-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f616481aa9f45d1ea4cadc043c3ee08ab3851c87f33060dfd4ce74c55342741b |
|
MD5 | 53f330599c61dd1ed178b4a2f0224ed6 |
|
BLAKE2b-256 | f990faf2b4d2a3d5932de272caefe9ea7740c7d9775d6847b82ce4b6e751ec3f |
Close
Hashes for light_curve_python-0.3.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38a0ce6939007ff229835feb053d8d01f80fd4c10b82759d353c683ec1d7bb23 |
|
MD5 | e8916d72e80b36a3dcade1d64b066584 |
|
BLAKE2b-256 | ff85705bf5df7fc3a03af66ad68f8e767e6e4a114095030a04eb60834130450b |
Close
Hashes for light_curve_python-0.3.5-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9878d96f7be8facacb690f9c9bed8673d17a27a898e778c21423c36ae52764b |
|
MD5 | 6d3d4d2b2a04f1521d9d56c94329e7fa |
|
BLAKE2b-256 | 851954baa0f9ae94f237b29e8540d7ae504f82874595f77e69449bef88b9aee4 |
Close
Hashes for light_curve_python-0.3.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9ab920674236b2dabdf7d155052ad3bcebf4418d2c440796f59eb64be127e3e |
|
MD5 | 26d8cabfbc7b09be5e53c9ccdb80b933 |
|
BLAKE2b-256 | ccab7c096d42ddce5a3f840c9dd214bef8ad2454f9c58dbd322b59e3751548a0 |
Close
Hashes for light_curve_python-0.3.5-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d631c803ac7234159791aa6d0bd79c1fbfbef37110c3cc49ab5cf9b3720923ea |
|
MD5 | 06bb06595184a83806b19b5b86500922 |
|
BLAKE2b-256 | 58449a2cff66ff5420edc560485be59cb95e471b52f9447c5ff3394f4bd63839 |
Close
Hashes for light_curve_python-0.3.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a06f6137b468a0bb5cdee3a73259fed9976acd03adacdf11254d71fe565f6cbc |
|
MD5 | c39406fe9d4800c1df66eea559f0cdd5 |
|
BLAKE2b-256 | d01be22048b49b93a0f666ec4fe755babfdec4ed817ba0bd0071acde9978647e |
Close
Hashes for light_curve_python-0.3.5-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10e1dcbe29c49552d70ab4172dbe7e7917460631aadc62b2e2a6819915597185 |
|
MD5 | bc2f6f571b29ce6350d5d6f220612a30 |
|
BLAKE2b-256 | e1bf2e22f839dcf31e489ef53dd165eba4dc58d080b3ba2999b0f232553e11e1 |