For finding and processing Lorentzian line shapes.
Project description
Peak Finder
What Works
Run the code in train_test.ipynb
to see a more or less completely working Lorentzian peak generation model in action!
Data Generation
There are several types of data generation that work now. The simplest types are called single
and simple
and they can be found in efficient_data_generation.py
. Currently, all the models rely on these two types of data generation. But, it's also possible to generate an entire complete set of data as detailed below.
Full Data Set Generation
To make a bunch of data run generate_data.py
. This creates a generated_data
directory and fills it with 1000 randomly generated data sets. Each one is composed of the following three files:
*_background.csv
- Has the parameters for the big background Lorentzian.*_lorentz.csv
- Has the parameters for all of the generated Lorentzians.*_data.csv
- Has the actual generated data. First column is frequency and second is displacement.
All parameters are stored as row with amplitude, frequency, FWHM, phase
in that order.
All the actual Lorentz generation happens in generate_lorentz.py
. Import this to generate data with custom parameters or whathaveyou. Noise and other generation parameters can be toggled in generate_data()
here.
As I've set it up here, the in and out of phase components of the Lorentzian are defined as follows:
$$A_\text{in}=\frac{A_0}{2\Gamma}\frac{f-f_0}{\left(\frac{f-f_0}{\Gamma}\right)^2+\frac{1}{4}},\quad A_{\text{out}}=\frac{A_0}{4}\frac{1}{\left(\frac{f-f_0}{\Gamma}\right)^2+\frac{1}{4}}$$
Where the full version is then the following:
$$A(f,\theta)=A_\text{in}\cos(\theta)+A_\text{out}\sin(\theta)$$
(The LaTeX probably won't appear properly on GitHub. But it should render properly in any other markdown viewer.)
Project details
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
File details
Details for the file peak_finder-0.1.1.tar.gz
.
File metadata
- Download URL: peak_finder-0.1.1.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 034afcdc0a7d4f9b83aec4605012338860f056aec74ffcdec9d08b807f432d08 |
|
MD5 | 6eb6d4ed9695e78a983522f05c534d81 |
|
BLAKE2b-256 | f24c0f2fc0ca435ae64d678d85e09775abad4f213c3286dd25eea8727391ccb7 |
File details
Details for the file peak_finder-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: peak_finder-0.1.1-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1ebc3291913f7dc5d857b4eec45413197f51f3103dd2188d81758e5aca3c837 |
|
MD5 | 2135cdedfa475ff34e6f5912e931b21e |
|
BLAKE2b-256 | 204a42ce36a808cb8f112737f27b0b0efd3360c17bd3b1747f0566cfeff8b987 |