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
Built Distributions
Close
Hashes for light_curve_python-0.3.4_beta.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1d03c2dc93722925b19ea77f2659d906f0df01cbdc6a062f1916ff728d940e2 |
|
MD5 | 567aaac79ecf0efc164247ed4524069e |
|
BLAKE2b-256 | d2e340bf4f5c3e3d776634290fe2b2e63a894b1585a95d48ec9f6c94a65a4459 |
Close
Hashes for light_curve_python-0.3.4_beta.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7df825233462086306df8637cb0df56e0f6d6b73525878df0d8720aa34649f5e |
|
MD5 | 1f0c865cb1d03a8f87a376e2f1d2f62f |
|
BLAKE2b-256 | 81b96f83bdf9e58c2d8dc23fbdbf5de43aaa75fa9a8e36e9a1c6219d2ffef747 |
Close
Hashes for light_curve_python-0.3.4_beta.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b36b8170ddf9d32581d712522bca67ed8d33e69d80194bfe50a6158427eeb94 |
|
MD5 | aac55ce25c759debfcae8d5c33fdc2bc |
|
BLAKE2b-256 | a701978da4ae1a2dfedc5a83bd03e2339719c53038493e8e501d2bca5edf3aa3 |
Close
Hashes for light_curve_python-0.3.4_beta.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c52e7022419b52eb81c4447be77de60ebd9431ec67fe5219b931fa5b5adbb851 |
|
MD5 | 7ed25f8f841a2299ce05f8047a05e6e9 |
|
BLAKE2b-256 | 25bb3775d88a53c3ea8f6f29ffc42289999a58664603424027c777de2ba9d9b3 |
Close
Hashes for light_curve_python-0.3.4_beta.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83495654cfb23eb33f99a735839c62001cc204faa17168415b5958844d32a86e |
|
MD5 | a887a16c4aae50b5246a7ec3d5cb7111 |
|
BLAKE2b-256 | a762ee0e01dd8ff4a37a23423ec8413eb36885e0c12520625c7a961ebe2279b5 |
Close
Hashes for light_curve_python-0.3.4_beta.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09c5b56b799fe5466595fd7682340573df5de07400165f1d6c865a0deef4e8fc |
|
MD5 | ffe425efbcfdb46ead1ca95a709d04c2 |
|
BLAKE2b-256 | 36d86c2c88a21b669ba116c60e1c76a9edebd3bf18602cc4aa9f2b156c555f2e |
Close
Hashes for light_curve_python-0.3.4_beta.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32e8587e2a37ecd71925756e91d5292aa201b0e02ed17bfe2ef8da489856d3f8 |
|
MD5 | 0b6329d06a782ececb957707ddc84690 |
|
BLAKE2b-256 | 72b9bf388cd44d748a2f0273906616c6f92d363fa31b322aedd213dd13bfdc7b |
Close
Hashes for light_curve_python-0.3.4_beta.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1516154315329952a535e98b5f9b72ac50ecfd0eb9ab7ce3cc44552de1ca5f97 |
|
MD5 | 5faae8da9222ef47cf19ec4bf4bd9bcd |
|
BLAKE2b-256 | b84fb15c19669e2b09b96e83f0c0c9bb03f5591991c94555647f9ceefd9b971b |
Close
Hashes for light_curve_python-0.3.4_beta.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c64989f6281f95393e9b03bdb67397d1eebfcc581944c54b63046a07e927aeb |
|
MD5 | 8ed5bd915a279bbc9bcf85f35f19e102 |
|
BLAKE2b-256 | a1632d3f667e2eb1f8867a11848a7abc643e920a9947c86a9605254d77e35f9d |