Metadata-Version: 2.2
Name: pyeebls
Version: 0.2.0
Summary: Python f2py extension wrapping eebls.f by Kovacs et al. 2002.
Keywords: astronomy,period-finding,fortran
Author-Email: Waqas Bhatti <waqas.afzal.bhatti@gmail.com>
License: MIT License
         
         Copyright (c) 2015 Dan Foreman-Mackey, Ruth Angus, and contributors
         Copyright (c) 2016-2017 Waqas Bhatti, and contributors
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Project-URL: Homepage, https://github.com/waqasbhatti/pyeebls
Project-URL: Documentation, https://github.com/waqasbhatti/pyeebls
Project-URL: Bug Tracker, https://github.com/waqasbhatti/pyeebls/issues
Requires-Python: >=3.8
Requires-Dist: numpy<2
Description-Content-Type: text/markdown

# pyeebls

This is a module that wraps Geza Kovacs' eebls.f. Taken from Daniel
Foreman-Mackey's [python-bls](https://github.com/dfm/python-bls.git)
module and broken out for easier use by other packages. This is used by the
[astrobase.periodbase](https://github.com/waqasbhatti/astrobase/tree/master/astrobase/periodbase) module.

## eebls.f

- Kovacs, Zucker & Mazeh 2002, A&A, Vol. 391, 369
- http://arxiv.org/abs/astro-ph/0206099
- http://www.konkoly.hu/staff/kovacs/eebls.f

## python-bls

- Foreman-Mackey, D., Angus, R., et al. 2012
- https://github.com/dfm/python-bls.git

## pyeebls

- Bhatti, W., et al. 2017
- https://github.com/waqasbhatti/pyeebls

### Installation

This package is available from PyPI: https://pypi.python.org/pypi/pyeebls. If
you're using Python 2.7, 3.4--3.6 on 64-bit Linux or Python 2.7/3.6 on 64-bit
Windows or Mac OSX >= 10.12, you should be able to install the binary wheels
from PyPI so no Fortran compiler is needed.

```bash
(venv)$ pip install pyeebls
```

If this is not the case, you'll need to have numpy installed, along with a
Fortran compiler:

```bash
(venv)$ pip install numpy # in a virtualenv
# or use dnf/yum/apt install numpy to install systemwide

## you'll need a Fortran compiler to install pyeebls!         ##
## on Linux: dnf/yum/apt install gcc gcc-gfortran             ##
## on OSX (using homebrew): brew install gcc && brew link gcc ##
```

Then, install pyeebls using pip (preferably in a virtualenv or use the --user
flag):

```bash
(venv)$ pip install pyeebls
```

Or download the tarball from PyPI, extract the files, and run setup.py:

```bash
(venv)$ python setup.py install
```


### Documentation

There's only one function to use in this module.

```python

def pyeebls.eebls(times, mags, workarr_u, workarr_v,
                  nfreq, freqmin, stepsize,
                  nbins, minduration, maxduration):
```
Calculates the BLS spectrum for the input times and mags arrays.

### Parameters

`times` : *ndarray* :
        A numpy array containing the times of the measurements.

`mags` : *ndarray* :
        A numpy array containing the mags or fluxes to use as measurements.

`workarr_u`, `workarr_v` : *ndarray* :
        Numpy arrays that must be the same size as times, used as temp
        workspaces by the Fortran function.

`nfreq` : *int* :
        The number of frequencies to search for the best period.

`freqmin` : *float* :
        The minimum frequency to use.

`stepsize` : *float* :
        The stepsize in frequency units to use while searching.

`nbins` : *int* :
        The number of bins to use when phasing up the light curve at a
        single test period.

`minduration` : *float* :
        The minimum transit duration in phase units to consider when testing for
        a transit.

`maxduration` : *float* :
        The minimum transit duration in phase units to consider when testing for
        a transit.


### Returns

A sequence of results:

```
(power, bestperiod, bestpower, transdepth,
 transduration, transingressbin, transegressbin)
```

`power` : *ndarray* :
        A numpy array containing the values of the BLS spectrum at each tested
        frequency.

`bestperiod` : *float* :
        The period at the highest peak in the frequency spectrum.

`bestpower` : *float* :
        The power at the highest peak in the frequency spectrum.

`transdepth` : *float* :
        The depth of the transit at the best period.

`transduration` : *float* :
        The length of the transit as a fraction of the phase. This is the
        so-called 'q' parameter.

`transingressbin` : *int* :
        The phase bin index for the start of the transit.

`transegressbin` : *int* :
        The phase bin index for the end of the transit.


### See Also

- the comments at the top of eebls.f in this package
- the [astrobase.periodbase.kbls](https://github.com/waqasbhatti/astrobase/blob/master/astrobase/periodbase/kbls.py) module for a high-level interface to this module


## License

The license for the Python files is the MIT License. eebls.f is provided by
G. Kovacs; it appears to be re-distributable, but please make sure to cite
Kovacs, et al. 2002 if you use this implementation.
