Skip to main content

Fast fitting of 2D-Spectra with established routines

Project description

SpectraFit

poet:

Now, it is completely rewritten and is more flexible.

Scope:

  • Fitting of 2d data
  • Using established and advanced solver methods
  • Extensibility of the fitting function
  • Guarantee traceability of the fitting results
  • Saving all results for publications in a CSV-format
  • Saving all results in a NoSQL-format (JSON) for project management
  • Having an API interface for Graph-databases

Installation:

via pip:

pip install spectrafit

Usage:

SpectraFit needs as command line tool only two things:

  1. The reference data, which should be fitted.
  2. The input file, which contains the initial model.

As model files json, toml, and yaml are supported. By making use of the python **kwargs feature, the input file can call most of the following functions of LMFIT. LMFIT is the workhorse for the fit optimization, which is macro wrapper based on:

  1. NumPy
  2. SciPy
  3. uncertainties

In case of SpectraFit, we have further extend the package by:

  1. Pandas
  2. Statsmodels
  3. numdifftools
  4. Matplotlib in combination with Seaborn
poetry run spectrafit data_file.txt input_file.json
poetry run spectrafit -h
Would you like to fit ...? Enter y/n: y
usage: spectrafit [-h] [-o OUTFILE] [-i INPUT] [-ov] [-disp] [-e0 ENERGY_START] [-e1 ENERGY_STOP] [-s SMOOTH] [-sh SHIFT] [-c COLUMN COLUMN] [-sep {    ,,,;,:,|, ,s+}] [-dec {.,,}] [-hd HEADER] [-np] [-v] [-vb] infile

Fast Fitting Program for ascii txt files.

positional arguments:
  infile                Filename of the specta data

optional arguments:
  -h, --help            show this help message and exit
  -o OUTFILE, --outfile OUTFILE
                        Filename for the export, default to set to input name.
  -i INPUT, --input INPUT
                        Filename for the input parameter, default to set to 'fitting_input.toml'.Supported fileformats are: '*.json', '*.yaml', and '*.toml'
  -ov, --oversampling   Oversampling the spectra by using factor of 5; default to False.
  -disp                 Hole or splitted Table on the Screen; default to 'hole'.
  -e0 ENERGY_START, --energy_start ENERGY_START
                        Starting energy in eV; default to start of energy.
  -e1 ENERGY_STOP, --energy_stop ENERGY_STOP
                        Ending energy in eV; default to end of energy.
  -s SMOOTH, --smooth SMOOTH
                        Number of smooth points for lmfit; default to 0.
  -sh SHIFT, --shift SHIFT
                        Constant applied energy shift; default to 0.0.
  -c COLUMN COLUMN, --column COLUMN COLUMN
                        Selected columns for the energy- and intensity-values; default to 0 for energy (x-axis) and 1 for intensity (y-axis).
  -sep {        ,,,;,:,|, ,s+}, --seperator {   ,,,;,:,|, ,s+}
                        Redefine the type of seperator; default to ' '.
  -dec {.,,}, --decimal {.,,}
                        Type of decimal seperator; default to '.'.
  -hd HEADER, --header HEADER
                        Selected the header for the dataframe; default to None.
  -np, --noplot         No plotting the spectra and the fit of `spectrafit`.
  -v, --version         Display the current version of `spectrafit`.
  -vb, --verbose        Display the initial configuration parameters as a dictionary.

Documentation:

Please see the extended documentation for the full usage of SpectraFit.

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

spectrafit-0.2.2.tar.gz (132.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spectrafit-0.2.2-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file spectrafit-0.2.2.tar.gz.

File metadata

  • Download URL: spectrafit-0.2.2.tar.gz
  • Upload date:
  • Size: 132.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.10 Darwin/20.6.0

File hashes

Hashes for spectrafit-0.2.2.tar.gz
Algorithm Hash digest
SHA256 7a887350b157e4423097a029ca261b2f5c7588ab6906b0d2e630c1ca443f33a0
MD5 9f202649dd89948761887a0ec13c2466
BLAKE2b-256 4e750c100d6144af2f7dbfdc68f5e3853d0096c3c49fcd6f29197dbcc050d2ec

See more details on using hashes here.

File details

Details for the file spectrafit-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: spectrafit-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.10 Darwin/20.6.0

File hashes

Hashes for spectrafit-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9db50b617fb7077bbb5816869af699d361ecc7106187a2d2e436053ae0ae02c6
MD5 a039b4ee521c9473d596eec7e10b6033
BLAKE2b-256 8e72d1fd5d77f8815c7e50ad6beae00bfbf681989b948aa37f031303523fa0e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page