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.4.tar.gz
(123.1 kB
view hashes)
Built Distributions
Close
Hashes for light_curve_python-0.3.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86035460ab36fe1d6ab7134d3b4b38e39acbd3aa9a0d253f16c065a87a429f29 |
|
MD5 | c6d3627e0d94346b315326669015cf41 |
|
BLAKE2b-256 | 8945725c378c322970ab5559eb1d964dfff83bb30a3533d60c73c9ebc8160543 |
Close
Hashes for light_curve_python-0.3.4-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d50242bcfe9b6a556882e28a168ca6fef210ec1117f21f67a2e67561449bca80 |
|
MD5 | cfc85b86934460a3d502364ca1ffc479 |
|
BLAKE2b-256 | d5f2edc8d285ceca5563e9fdfcd078fce165a46341a882b64b9cc32bd108cf32 |
Close
Hashes for light_curve_python-0.3.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acf8f78c92d82471e9cfa6533570dfb081fb4bc81b52279ccbea5398bc80343a |
|
MD5 | 6570273764c446580c1c311d22077684 |
|
BLAKE2b-256 | 2c9c01cb09af7af25c71f2fce664976dc068f52416cd7a0d6d4e6633c3dab6af |
Close
Hashes for light_curve_python-0.3.4-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cadc0da4fa953b8297babfbf7b5d71a3937117c5ac245b3e025a83005e7f987 |
|
MD5 | ef16eaab2d49fbd18080a561f4dbc693 |
|
BLAKE2b-256 | fc0286324f74c7efe7fc883e11a30bbe4d75d11ee45ae7a216f7694a7e805952 |
Close
Hashes for light_curve_python-0.3.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95a1558c3d29636bc58bccdc4a8496fa6ab130ba3ffdc015d16a241c2ae53770 |
|
MD5 | cc78f8f6ef87927ef43c1ce3485903c2 |
|
BLAKE2b-256 | 442575d5acde32b0bd83dd51f15cc499e11d69c266e19ebb754c1f648f3e682f |
Close
Hashes for light_curve_python-0.3.4-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81edd303a6fec0cd315cadde43b3648d37e6bcad69e458337879520069bdfd26 |
|
MD5 | 11b3558857629d5cd817c7c407828ef5 |
|
BLAKE2b-256 | f2ae6aa83634363251dff86047c45a300082cd10abbc8fe1a17d862f3f980bad |
Close
Hashes for light_curve_python-0.3.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f4c56bb3f3ca9c3d00ffd1b1616ee77a0f58324ec58a26ae1d49bc5e94d6cee |
|
MD5 | bcc3e1c7ad92a37447a04875dd036bf1 |
|
BLAKE2b-256 | 798b0116e4d9c75904d04f4032174ab5a10b77c713351f98169b3faee4c8a481 |
Close
Hashes for light_curve_python-0.3.4-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64ed03cfe745f3316676b8633282752d65b2551a3e4b34595f794ee9133a12a8 |
|
MD5 | d77233352a0e4c28de9d81cae0886137 |
|
BLAKE2b-256 | 9f18462166df82b6e76adb703fac12fa3e19c1c1d1300d5504cf81c931a47fc0 |