.. |citation| image:: https://img.shields.io/badge/DOI-10.1371/journal.pone.0218789-blue
            :target: https://doi.org/10.1371/journal.pone.0218789


.. |binder| image:: https://img.shields.io/badge/start-Jscatter-F5A252.svg?logo=data:image/png;base64, 
            :alt: Binder
            :target: https://mybinder.org/v2/gl/biehl/jscatter/master?labpath=src/jscatter/examples/notebooks/Jscatter_Introduction.ipynb

.. |install| image:: https://img.shields.io/pypi/v/jscatter?labelColor=black?logoColor=blue   :alt: PyPI
    :target: https://pypi.org/project/jscatter/

.. |license| image:: https://img.shields.io/badge/license-GPLv3-orange
            :target: https://www.gnu.org/licenses/gpl-3.0.en.html

.. |pyversion| image:: https://img.shields.io/pypi/pyversions/jscatter?color=orange   :alt: PyPI - Python Version
            :target: https://pypi.org/project/jscatter/

.. |docs| image:: https://img.shields.io/readthedocs/jscatter?color=orange
            :alt: Read the Docs
            :target: https://jscatter.readthedocs.io/en/latest/

.. |beginners| image:: https://img.shields.io/badge/Beginners-Guide-orange
            :alt: Beginners Guide
            :target: https://jscatter.readthedocs.io/en/latest/BeginnersGuide.html


**The aim of Jscatter is treatment of experimental data and models**:

* Reading and analyzing experimental data with associated attributes as temperature, wavevector, comment, ....
* Multidimensional fitting taking attributes into account.
* Providing useful models for **neutron and X-ray scattering** form factors, structure factors
  and dynamic models (quasi elastic neutron scattering) and other topics.
* Simplified plotting with paper ready quality.
* Easy model building for non programmers.
* Python scripts/Jupyter Notebooks to document data evaluation and modelling.

|binder| |citation| |install| |license| |pyversion| |docs| |beginners|

.. image:: http://jscatter.readthedocs.io/en/latest/_images/Jscatter.jpeg
    :align: right
    :alt: Jscatter Logo

**Main concept**

* Data are **organised** in **dataArray/dataList** with attributes
  as .temperature, .wavevector, .pressure  and methods for filter, merging and more.
* Multidimensional, attribute dependent **fitting** (least square Levenberg-Marquardt,
  Bayesian fit, differential evolution, ...).
* Provide relative simple **plotting** commands to allow a fast view on data and possible later pretty up.
* User write models using the existing **model library** or self created models.

  The model library contains routines e.g. for vectorized quadrature (formel)
  or specialised models for scattering as **formfactor**, **structurefactor**, **dynamic**
  and **biomacromolecules**.


**Documentation**

Documentation located at `<http://jscatter.readthedocs.io>`_.
A number of examples how to use Jscatter is provided and can be run from Jscatter.

A short example how to use Jscatter ::

  import jscatter as js

  i5=js.dL(js.examples.datapath+'/iqt_1hho.dat')     # read the data (16 sets) with attributes
  # define a model for the fit
  diffusion=lambda A,D,t,wavevector,elastic=0:A*np.exp(-wavevector**2*D*t)+elastic

  # do the fit
  i5.fit(model=diffusion,                     # the fit function
         freepar={'D':[0.08],'A':0.98},       # start parameters, "[]" -> independent fit
         fixpar={'elastic':0.0},              # fixed parameters
         mapNames={'t':'X','wavevector':'q'}) # map names from the model to names from the data

  p=js.grace(1.2,0.8)                         # open a plot
  p.plot(i5,symbol=[-1,0.4,-1],legend='Q=$q') # plot with Q values in legend
  p.plot(i5.lastfit,symbol=0,line=[1,1,-1])   # plot fit as lines
  p.save('test.agr')



** Released under the GPLv3 **

