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.0.tar.gz
(48.5 kB
view hashes)
Built Distributions
Close
Hashes for light_curve_python-0.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a34285672b86ceeadd0175646ac7b314cb3b1e1a08af846226bb3b2240d931d7 |
|
MD5 | ac16de262b0128ce0bf01188002ef901 |
|
BLAKE2b-256 | a47e207f236be94df025ae879022e4d11d63a03f9445930370f6fee3c0167061 |
Close
Hashes for light_curve_python-0.3.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7cdf7ebe93b1f897df498302de843b459ec5e2c0b73a4791ca8c9501f43ba45 |
|
MD5 | 1132a9f914fcd0cc933a03d6224f3c8d |
|
BLAKE2b-256 | f02dcb31970212124b014c7ebb9d27b47930d730699a542617f000f378276a95 |
Close
Hashes for light_curve_python-0.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49759cf1d96a87ad95151f29265279e2370133c7c2e5ce0a32275dc1d1c272e0 |
|
MD5 | c2f8750af20c0dc300a6fe3ca0549aa3 |
|
BLAKE2b-256 | ddb3fc768de2acd5e4a480716e456d404d818e60348a67d465f6037f099c29ae |
Close
Hashes for light_curve_python-0.3.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 636094afa91f88765526c58b359f8d15f6a4f8c967c288461dd3d8092e54eb82 |
|
MD5 | e8aa22ddb7ab108bd4e8bce72f931fd4 |
|
BLAKE2b-256 | cdbd5f122bae769d1e614c8fbf2ab379c7dba91feb43b5d046f5571aae492596 |
Close
Hashes for light_curve_python-0.3.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a65604e20c855a94f505a36050ee8e1a0409d584c59ff7b88674a8076547f85 |
|
MD5 | 887bdf0f6378da4ed5336696e0fa4cd1 |
|
BLAKE2b-256 | 6a7e01ac6c3769fdf0a0171ce0b430dac2e2d8fe5b4e09b232090f8b8da4c46c |
Close
Hashes for light_curve_python-0.3.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a438d21f4f1f9f6bf0d3eed9e815152482e56a29a1238dee50d426e19545a18b |
|
MD5 | 070d03c948c65120b5c55f11c4e51e6a |
|
BLAKE2b-256 | 2fc1ca7fd4d14ca74d8bcb6b6c82e3262287eb785b3fd3baa0100b0db2b6563e |
Close
Hashes for light_curve_python-0.3.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 702fbba57df3cbffb11afb8a79c9e2928c371dbadd93117b6fc8da3391aa4430 |
|
MD5 | 9bfb7bbc7ae1951e34193c34020dae79 |
|
BLAKE2b-256 | 3a06becdcfd3d53a94fa10ecdae9814b3d892c930a62becff6b7d2b28951a234 |
Close
Hashes for light_curve_python-0.3.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da0a50191a87b3b79073b9092710ae08cdb93d45e541086d2918e94fe261be45 |
|
MD5 | 562c01e4a614124904a4b96fe523cbbc |
|
BLAKE2b-256 | 61e6046ceedcb8bada0fd4acc05a4841d079e10326db9eeee91b20c3b1485987 |