Gaussian Decompostion of a LiDAR Waveform
Project description
gdecomp: python binding of C++ signal gaussian decomposition.
This package aims at decomposing a signal (1D numpy array) into a sum of gaussian, typically used in full waveform lidar analysis. It is used in particular to process lidar simulations produced with pytools4dart. This code is inspired from C++ code developped by DART team (Jianbo Qi, Tiangang Yin), for DART radiative transfer simulator.
- Creation date: 2019-05-24
- Author: Florian de Boissieu
Requirements
Cython and Numpy are necessary and can be installed with (they should be installed at package installation otherwise):
pip install cython numpy
Install
Package gdecomp
can be installed with:
pip install gdecomp
Example
import gdecomp
import numpy as np
import matplotlib.pyplot as plt
x=np.arange(100)
gaus=np.array([[130, 20, 5],
[50, 50, 10],
[10, 70, 5]])
y=np.zeros(x.shape)
for i in range(gaus.shape[0]):
y += gaus[i,0] / (np.sqrt(2 * np.pi)*gaus[i,2]) * np.exp(-(x - gaus[i,1])**2 / (2 * gaus[i,2]**2))
out = gdecomp.GaussianDecomposition(y)
out = np.reshape(out, (-1, 3))
fit = np.zeros(y.size)
for i in range(out.shape[0]):
fit += out[i,0] / (np.sqrt(2 * np.pi)*out[i,2]) * np.exp(-(x - out[i,1])**2 / (2 * out[i,2]**2))
line1 = plt.plot(x, y, color='k', label='waveform')
line2 = plt.plot(x, fit, color='r', linestyle='--', label='fit')
plt.legend(loc='upper right')
Aknowledgements
This package includes cmpfit source code of CMPFIT library, software developed by the University of Chicago, as Operator of Argonne Nationa Laboratory. See src/mpfit/DISCLAIMER for copyright details of that code.
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 Distribution
Hashes for gdecomp-1.0.4rc4-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d430cbb82147a294616cf5c1e5b1df87285d9a0d7b621b566275f4b89a3011b3 |
|
MD5 | 8e63d8a886cafff0e21b650c2b8bcaea |
|
BLAKE2b-256 | 8f5960223c04b403bb68a2f7333fbebe7099b26edb9a516759d9b9266dd729c8 |