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
Built Distributions
Close
Hashes for light_curve_python-0.3.1_beta.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 416a552f9bc75ada0949bb712b2511b3866266550aa5c6e53cdb50e0f5bc2c7b |
|
MD5 | 6a27e9522cdb5b3eacc481373bd228e9 |
|
BLAKE2b-256 | d1471af74bf52fd6557dfd3cfab04b65b04fc1fa2dfc2848e303f7d91578316a |
Close
Hashes for light_curve_python-0.3.1_beta.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 901cd0839146a665a60f5a7f95678f0d57e398344567651e0d7d4206c8e60d3c |
|
MD5 | 28740ce96d7be5be9f6667367a821c77 |
|
BLAKE2b-256 | c321248573ac6e4d18bf0373a50028c57eb583887e286db979e39a62e3fa359a |
Close
Hashes for light_curve_python-0.3.1_beta.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef35b2b0c0c8ba3070282a27cbd8b07508a7ea7a82cecc8b69983029003f8c16 |
|
MD5 | 8c4f019ddad5c045c6b108b7fa03cad8 |
|
BLAKE2b-256 | f0309f6b637e1308559d298ce9498f899873758439aa1791c63bb109af5545ea |
Close
Hashes for light_curve_python-0.3.1_beta.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54f2013773437355c5def17d29b15ed6dd56fe682646393f7434e054d577f04c |
|
MD5 | 1cc21c5560383416d9f9209ce4670641 |
|
BLAKE2b-256 | fb46df52f303036f0216bc018cbcabc6cfaf539d50dbfda17661d4af20b7c94c |
Close
Hashes for light_curve_python-0.3.1_beta.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7d8880462a611200f568c5e3c0976a96efcf645b8917f81b704d39366749c99 |
|
MD5 | a7f6660a1c3a3b21a8f278e34521ed39 |
|
BLAKE2b-256 | dd5f1815328eaf91b03897a3a9a637b3c5eef2f36598f6fbf441056b666e9e66 |
Close
Hashes for light_curve_python-0.3.1_beta.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38cfd2b222897b3200916f52a7a66145e6cfd466edc72ee2d2112cf52ceb78ac |
|
MD5 | 51465630d201e87739054bc189dbd12d |
|
BLAKE2b-256 | 8affa5421adf29451c6621fb0746d751a184de51bed7d74dff1ca09ce316d80b |
Close
Hashes for light_curve_python-0.3.1_beta.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f1a94b23850de3960a8d8acfadee2b958f09650ee8dec574eebb3ec3ca91b9c |
|
MD5 | f9c6f453fe61cca8c7ea424afafc0e7c |
|
BLAKE2b-256 | 0e5c905da79c25c8297bb91b81e2b276a47c65265f507a1d1bd02042e2d28ef6 |
Close
Hashes for light_curve_python-0.3.1_beta.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 811afe45dea3fd86097c94874e1d73918b05c577dfba687ad86a0e5d5e1d48d9 |
|
MD5 | 332ef7d89f8fc468ac1d039867d5190c |
|
BLAKE2b-256 | 838a8cb8e6ea3b53b39cafc48c3f058fb4a2fdbd222ce60906ef7beaa3206c3b |
Close
Hashes for light_curve_python-0.3.1_beta.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c88d2657c25973d1f460c62842c2623643e83cb2b61925dcc86103764d5386b0 |
|
MD5 | b9fda1718d4e6ef71b6db4d662c85338 |
|
BLAKE2b-256 | 1b2c60c3632af2ca57c6c419ab3521970635602e83fdd594ef45e1678a205d15 |