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.3.tar.gz
(114.7 kB
view hashes)
Built Distributions
Close
Hashes for light_curve_python-0.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45cad30c81deb42b176ce1e89a94a43ccedc18c070c33ca09be1bdb40a5b5de1 |
|
MD5 | a428056324606ca77e820cbb2bc48f90 |
|
BLAKE2b-256 | 889b69a39eae472a371ef16c671e35b36ccc8be1f53ee35d369afc76b8a8a877 |
Close
Hashes for light_curve_python-0.3.3-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95914436fd3cf94b7b462beb38651b018505b2bac7f0533a677df45c440dbf66 |
|
MD5 | 91f23b7dc31a2acc9b8281d784b57b3d |
|
BLAKE2b-256 | 75b4c451da2d3f1ab6a4dce8dc2641460a1d3bc75324e4b8f9155731fb99b37c |
Close
Hashes for light_curve_python-0.3.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69a993292875b72e7bfc7d84ab70f8c704b19f6e2485b97a026e637babce2609 |
|
MD5 | 996fe871e0c06cbda98682e2c79364c2 |
|
BLAKE2b-256 | 36c022521bde4beed8605fa50c7cbc6bc1bfa17bc5f406ea502491073796ebbf |
Close
Hashes for light_curve_python-0.3.3-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f1f56cfb45d693325e13fcdafa20a20a3410fb1539a8cfe3ac88b783877d808 |
|
MD5 | 38707060a8ab9951cce7f25caa6d3e42 |
|
BLAKE2b-256 | ce80cb53ff5608db947d52b53748ade468f3bf89b57c0a410ee6162c238673ce |
Close
Hashes for light_curve_python-0.3.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 346d5f3ffb53730e4befbad37544fbaec0dd999aef14d673439a473c4c6a7310 |
|
MD5 | f5295ce19adee197251a32057eb45ab3 |
|
BLAKE2b-256 | b9fe74f17ae937add4563ea5e9edd86dd58bad3772a38f6d936a4b317ec3e2ea |
Close
Hashes for light_curve_python-0.3.3-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c995eb8c6d2c827260abe783149a6b114ec1ca63d5709ebf8e3d80eacfde9f21 |
|
MD5 | ab7211a963e259604dcb3740cd79c7ea |
|
BLAKE2b-256 | 489960b7d4cdd395ac94de8cff917bfe80903dd7e45bb5c0770219cecc43210c |
Close
Hashes for light_curve_python-0.3.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1331dfc258412d324e55d7847720311f612055b06ddc1ea212b1edb78ceed94f |
|
MD5 | 7d14423ced6ed8f74c970bc2fc836975 |
|
BLAKE2b-256 | f0a5c5b6214c65898c0f0405c33d98d83dd6e78f5409608165701ce38a4a3bec |
Close
Hashes for light_curve_python-0.3.3-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c66785f632f94ee6da785fbee6e4d96c06eaffa22d9ce2574829b33eeb36bf73 |
|
MD5 | 285d5abebe3449662bd86d9209338208 |
|
BLAKE2b-256 | 0d761eec170223b06663bb758620a2e34c21ca4f4bb7d13cfeee2d1c3f3129fb |