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
t = np.linspace(0.0, 1.0, 101)
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)))
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.1.tar.gz
(48.8 kB
view hashes)
Built Distributions
Close
Hashes for light_curve_python-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdbdead1a3ee63a288b15e8e874e8a7492ca4eb464eddc08e68698c18a45f9c6 |
|
MD5 | 72c0f47e7dde522a280a9621775288fa |
|
BLAKE2b-256 | bb6b93aafa86fad70a75ed3d7380e783bcc842223e4c184584cb873410332be1 |
Close
Hashes for light_curve_python-0.3.1-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47b858d9cd6cfd0790e3c7ea36c846a378f623e67fa3c28fc0e7281970dd1922 |
|
MD5 | 576eaee9d5cacd099c94be50adfa7be3 |
|
BLAKE2b-256 | 64de11f8cfd26d5e04eb99296beb74c87cde0211953c9b896336213f837190f5 |
Close
Hashes for light_curve_python-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5a16c718865b9f5739cd105e2fed18ea7e82ede981d40603dbb33400de4fbaf |
|
MD5 | a65d8ed5e5daefa23282b40c05aa425c |
|
BLAKE2b-256 | 6dca7a8a5e09065a118a8f17b235545c8afc09ae6ab17f8800b0fab209243326 |
Close
Hashes for light_curve_python-0.3.1-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84a07423d961d00762d9f579801a5f73ed08e597ba0a612745ba131fa16a7aa7 |
|
MD5 | 39fc8540f155a81ffc98854d7c3c7c2b |
|
BLAKE2b-256 | b202872dffa3449ff2e080052f56f34859d5a6b1baa5af26bc27917efd6be76e |
Close
Hashes for light_curve_python-0.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d061b352ae3f9a58cd29282978869a58347344c570ac5ab9eb71342f6391d13 |
|
MD5 | c45290bdfd1b543ecbd81d1324d89ed2 |
|
BLAKE2b-256 | ee941cfafef7c9ad4c8a4946059bb9bd6e1ac0e936a8dda2de5685e6e207a61f |
Close
Hashes for light_curve_python-0.3.1-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0264f7743e49b91c30d8801e67cc12de1059c03b0300fa85d0e00c90b4f9b4c |
|
MD5 | 7b4f00e25c06e1a1dec416d0bacba3f1 |
|
BLAKE2b-256 | 70a4f25c9484ede3067a98e25051242a34115643290e64e0ab6de7a4e9404c16 |
Close
Hashes for light_curve_python-0.3.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e85a542d82b7c3fc4df7e8cf8f5fa9627dd6be25576bdc73ddd72f7f9addfa1 |
|
MD5 | 0ba2b9b8cac180518913f283c8498f5b |
|
BLAKE2b-256 | f9e5a339434fa1fab1ba2efffd80cf7cddce75024f5fa8d1d5c66833eb271907 |
Close
Hashes for light_curve_python-0.3.1-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c58a26e555b10d39df95c98202c736f724a9059789ec56ebafb9a60214177f97 |
|
MD5 | 288ad223408eb8009042106359263c58 |
|
BLAKE2b-256 | 90569382edd337a2f0aecfa49a810e11ff706b0e3e13c0871fe9b5d17eff6a2d |