Action | Shortcut |
---|---|
Fit | <Control>f |
Reset | <Control>r |
Import File | <Control>o |
Export Results | <Control>s |
Open Settings | <Control>p |
Add/Remove Gaussian To/From Model | g / <Shift>g |
Add/Remove Lorentzian To/From Model | l / <Shift>l |
Add/Remove Pseudo-Voigt To/From Model | v / <Shift>v |
Add/Remove Line To/From Model | n / <Shift>n |
CSV files are imported via the pandas.read_csv() method, and a few select parameters for this method can be accessed from the settings window in kfit. Generally, a comma-separated plaintext file with or without a header row and with UTF-8 encoding can be import with no issues. A more robust, interactive file import dialog will be implemented in a future release.
The graph tab uses matplotlib backends for the figure and navigation toolbar. This means you can pan, zoom, adjust settings, and export the plot just as you would with a typical matplotlib
plot. If you are not familiar with matplotlib
, this documentation page describes how to use the interactive toolbar.
Note that zooming in/out on the graph also changes the range of the fitted data in kfit. This can be a useful way to crop out regions of data you are not interested in fitting. Exported results will adhere to this zoomed range as well. To return to viewing and fitting the full dataset, use the <Control>r
shortcut to reset the graph.
The export method will save two CSV files to the local filesystem:
-
*.csv
The original data, total fit, and component curves in the fit.
x data total_fit [model_component_1] ... [model_component_N] ... ... ... ... ... ... -
*.params.csv
The parameters for each model component, e.g. gau1_amplitude, lin1_slope, etc.
parameter value [model_component_1]_[parameter_1] [model_component_1]_[parameter_2] ... [model_component_N]_[parameter]_N
At the moment, kfit uses four stock models from the lmfit package: three peak-like models (Gaussian, Lorentzian, Pseudo-Voigt) and a Linear model. These base models can be added together to create a composite model for the data. In the future, support for more lmfit
models and user-defined custom models will be added.
sudo snap install kfit
Instructions for installing snapd
for each compatible linux distro:
Snap has been tested on:
-
Ubuntu 18.04 and 19.04 ✔️
-
Debian 10 ✔️
-
Red Hat Enterprise Linux 7 ✔️
-
Fedora 30*
-
OpenSUSE Tumbleweed*
*See #2
Install:
sudo apt install python3-dev python3-pip python3-gi python3-gi-cairo libgirepository1.0-dev gcc libcairo2-dev pkg-config gir1.2-gtk-3.0
git clone git@github.com:rhroberts/kfit.git
cd kfit
pip3 install ./
Run:
./kfit/kfit.py
Python packages
- lmfit
- matplotlib
- pandas
- numpy
- pycairo
- pygobject
Distro packages
- gcc
- pkg-config
- python3-dev
- python3-pip
- python3-gi
- python3-gi-cairo
- libgirepository1.0-dev
- libcairo2-dev
- gir1.2-gtk-3.0
STILL WORKING ON THIS
- Check out NOTES.md for development notes and TODOs