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.2.tar.gz
(112.2 kB
view hashes)
Built Distributions
Close
Hashes for light_curve_python-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b7e744c98f11098977bdb004d45cef30c0a1f8ace9bdcbb486518bb9976dbdd |
|
MD5 | 886a9d97641fc01c24a3edc08e6a8b92 |
|
BLAKE2b-256 | 35b0294f249ba9097c6c8830db86b7a0554a4ee029bbf31cad43169e33d2af12 |
Close
Hashes for light_curve_python-0.3.2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c49e9fcf24f39cdff5e523226463da1b6d2783f4dbca5d3930936690691ff9b |
|
MD5 | c80084b1366acb3e188843491d7911f6 |
|
BLAKE2b-256 | 37cad1cb5d0d00ab3379973e93f03b425b1ca10d3b66e9e7e49cfaed64e9b0a0 |
Close
Hashes for light_curve_python-0.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac2cbb3fa8b23feaabae518b1c35fac28a0fc7e50b4c3d35c37453bbcbb00b37 |
|
MD5 | 83295e5010a4bfc56f773ea304e76cd2 |
|
BLAKE2b-256 | f69d3081a29d4a6c32dc78c30d492b31334ee8f5550f70f53b5b8b32ed9c8cc1 |
Close
Hashes for light_curve_python-0.3.2-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef6401c917128498c0fa809783ce9cbf18aae0499c49c11fad78d879caa2ddab |
|
MD5 | 1372bc5021f3019ce4ceaa7f280cfd92 |
|
BLAKE2b-256 | a088452b135d21e96cca2ef0fa59358726bb37a2c8411c8d83e3355a36557c4c |
Close
Hashes for light_curve_python-0.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fec580bff38726218304d7807f789379dd9ebdd9de531da4ec0ad3b2d5aaed4a |
|
MD5 | a37765c0204441c78b8a98a43fb3f546 |
|
BLAKE2b-256 | 59fdc2628ca9df4e09791c1a0868c98e9e7d989dd0ee64e3d6a6c0ea563f54ed |
Close
Hashes for light_curve_python-0.3.2-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4262560cb1d4973d125d9eaf5791c3d803e76b670a78f4204af05e695eeff3a |
|
MD5 | 4c8d54184ea7dc5efe89291cec6226d2 |
|
BLAKE2b-256 | d8aed9a1fac16d3ec95c6fd9bd849e6276e6c635ef5c8618271f9d6adaef3054 |
Close
Hashes for light_curve_python-0.3.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55a2b833f7ce7c245185b675d27c9310d0a8d41de3f2513c9053ebe2f413d98e |
|
MD5 | 205690f63b49cd71747ed9f97301291d |
|
BLAKE2b-256 | c991e6d093a97e0fe7fb0768a5bbdbba7bf7ec911fcb363c012ff7b02bda8a55 |
Close
Hashes for light_curve_python-0.3.2-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb43446bf022d7dab73a69dfa4eca68a2b5c32657e2824276c5de82ca0d9aaf0 |
|
MD5 | 175d77aafe68522591b2bab0895ab044 |
|
BLAKE2b-256 | 82970ec072ed0ae7c59b3afda47446e36095c9098f2dcfd5039c1db64ac71bea |