Metadata-Version: 2.1
Name: pdffit
Version: 0.1
Summary: Fit a Lognormal + Power law distribution to data
Home-page: https://github.com/shivankhullar/PDF_Fit
Author: Shivan Khullar
Author-email: shivankhullar@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/markdown
Requires-Dist: numpy (>=1.0)
Requires-Dist: scipy (>=1.0)

# PDF_Fit
A code to fit the LN+PL or LN+2PL form to the density PDF of star forming regions.
To use this:

```python
pip install pdffit
````

Once you have installed, you can use the following sample script - 
```python
from fitter import *
import numpy as np


sample_data = np.load('./sample_data.npz')

#xdata and ydata are just two arrays. 
xdata = sample_data['arr_0']
ydata = sample_data['arr_1']
sink = float(sample_data['arr_2'])

params = Params(s_cut_off = sink)

p0 = [1.7, 1.6, 0.8, 7.1]
PLPLresult = PLPLFit(xdata, ydata, p0, params, use_K21=True)

p0 = [1.85, 1.57]
PLresult = PLFit(xdata, ydata, p0, params)

print (PLresult.sigma_err, PLresult.alpha_err, PLPLresult.sigma_err, PLPLresult.sb)
#To know more about how to access the result: help(Result)

```

In case you want to dig deeper or just use the function for plotting:
```python
from LNPLPL_functions import *
from LNPL_functions import *
```
or whichever way you wish to import the modules and the functions within them. 


To get help on any function:
```python
help(function_name)
```

If you're on the pypi page, please checkout the github version to get the sample data if you need. 

