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.0_rc.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47a88df7b5c57467ebdd7d50a87d813248b1d46797d92493781a0a8ae6e09cff |
|
MD5 | 0f91bec5d49da013443a7ad0c7b5413a |
|
BLAKE2b-256 | 5748ee96c94904dba2800c8fb0250bafd834a958c991437c458d5a47c41f2a8e |
Close
Hashes for light_curve_python-0.3.0_rc.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5e5bc120b6b116cdde8e8c82a6585c20449705212a3571d24b1f9e0fdd7af30 |
|
MD5 | 8b01a85293a0ae580dd672d48a29e73f |
|
BLAKE2b-256 | a775f58c75f107acef18095cc6e490540a3733d0bf90bfe2c8165d96e0eafea4 |
Close
Hashes for light_curve_python-0.3.0_rc.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 388639fa75f7fbf4198e22b398962209e750b1a9cde607a5d80d9332b9c4dd93 |
|
MD5 | 64aa9de34c4a179d9ca75dddf4727d9e |
|
BLAKE2b-256 | 760843cad5127498a399f30717efc306a33773598a0e076392f8e002432be0ae |
Close
Hashes for light_curve_python-0.3.0_rc.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 303e419f312d4bbd905f0dce57b8dd54cd9b207c467b7233b821573e988bbc8e |
|
MD5 | 5bed9f706f41da45872a3af2a8924b77 |
|
BLAKE2b-256 | 6aef5039bec9ff9d7d6922d575011fa381c5b58c29529079f4e95fc930d8113d |
Close
Hashes for light_curve_python-0.3.0_rc.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b37f92f77f3505d37f648961b52a2c13a0f27073b21b760c4de7453e7b01eae |
|
MD5 | 9ad030805b1c259f5a43bdb9661c9b13 |
|
BLAKE2b-256 | 2f82db3827d747cd2b0f67506b421dc0ab0b17b0b372b690bd7e55059d80cfa8 |
Close
Hashes for light_curve_python-0.3.0_rc.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9da5cb3d401ae4ea40f7fbe556ec00f61dd3777ffc012653972e61b9a5b0a825 |
|
MD5 | 2318a325e1d3405f88676d78092caff9 |
|
BLAKE2b-256 | 79768fbcdd60a733d3753061da1ca528d0843949c7c97c5393bfe2e2212ccf02 |
Close
Hashes for light_curve_python-0.3.0_rc.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9badb93e96e24b0f94f162e959bf3552650b9b3974a7219b8a4110186614aaec |
|
MD5 | d120d346e51552d1f0025a8e46b5cd82 |
|
BLAKE2b-256 | aa91564f6675faad1e143ed5c37f6bee8ed14a493179f712922b7015558ce72a |
Close
Hashes for light_curve_python-0.3.0_rc.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 851641d0f7dc3bb0b1fa1e8c86238c21328c32f3041ebbe0f484c108fe01a0ac |
|
MD5 | 4ca441894a49012e2d4e41241e73dd24 |
|
BLAKE2b-256 | 310079e6c53b58b8b289647376af1d7ff05043311c1167148d6b27cb1b8bdc04 |
Close
Hashes for light_curve_python-0.3.0_rc.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba1bc3db7c27ef12fd273c49d3abb7eb9b3ca3dd73cd18b2381f23a1fef640b4 |
|
MD5 | 59356187ba024b6e9dfd5ddfe249a194 |
|
BLAKE2b-256 | d725ec2c13eb410e3f521f58b75ece67b988448ac29fe2051c3e5d89c0b5bb5b |