<commit_before>Non-thermal spectral fitting with emcee
=======================================

``emcee_specfit`` uses MCMC fitting of non-thermal X-ray, GeV, and TeV spectra
to constrain the properties of their parent relativistic particle distributions. 

The workhorse of ``emcee_specfit`` is the powerful `emcee
<http://dan.iel.fm/emcee>`_ affine-invariant ensemble sampler for Markov chain
Monte Carlo.


Installation
------------

Just run

::

    python setup.py install

or, to pull also the needed dependencies, use pip as 

::

    python setup.py sdist
    pip install dist/emcee_specfit-0.1.tar.gz


Usage
-----

The package consists of several convenience functions to which you must provide
a model function, a probability function for the parameter priors, and the
spectral data to be fit enclosed in a dictionary. An example is shown in the
file ``velax_demo.py``.

ToDo
----

- Write standard labels for parameters as a property of
  ``emcee.EnsembleSampler`` so that they can be accessed by other functions
  without knowing their order.
- For X-ray (sync) and GeV/TeV (IC) data, estimate initial magnetic field from
  Fx/Fvhe ratio.
- Write Convenience function to compute decorrelation energy of data and the
  corresponding electron and/or proton energy to be used as ``norm_energy``.
- Write method to derive lower/upper limits to non-present features, such as
  energy cutoffs. See `arXiv:gr-qc/0504042
  <http://arxiv.org/abs/gr-qc/0504042v1>`_ for an example.
<commit_msg>add labels to parameters (README)<commit_after>Non-thermal spectral fitting with emcee
=======================================

``emcee_specfit`` uses MCMC fitting of non-thermal X-ray, GeV, and TeV spectra
to constrain the properties of their parent relativistic particle distributions. 

The workhorse of ``emcee_specfit`` is the powerful `emcee
<http://dan.iel.fm/emcee>`_ affine-invariant ensemble sampler for Markov chain
Monte Carlo.


Installation
------------

Just run

::

    python setup.py install

or, to pull also the needed dependencies, use pip as 

::

    python setup.py sdist
    pip install dist/emcee_specfit-0.1.tar.gz


Usage
-----

The package consists of several convenience functions to which you must provide
a model function, a probability function for the parameter priors, and the
spectral data to be fit enclosed in a dictionary. An example is shown in the
file ``velax_demo.py``.

ToDo
----

- For X-ray (sync) and GeV/TeV (IC) data, estimate initial magnetic field from
  Fx/Fvhe ratio.
- Write Convenience function to compute decorrelation energy of data and the
  corresponding electron and/or proton energy to be used as ``norm_energy``.
- Write method to derive lower/upper limits to non-present features, such as
  energy cutoffs. See `arXiv:gr-qc/0504042
  <http://arxiv.org/abs/gr-qc/0504042v1>`_ for an example.

{'fraction_non_alphanumeric': 0.10760602874167544, 'fraction_numerical': 0.011917280056081317, 'mean_word_length': 3.920689655172414, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1908126', 'n_tokens_mistral': 873, 'n_tokens_neox': 797, 'n_words': 351}