Giter Club home page Giter Club logo

pypetal's Introduction

pyPETaL: A Pipeline for Estimating AGN Time Lags

Documentation Status pre-commit Workflow Status License codecov

pypi-ver python-ver pypi-downloads

ascl:2401.004

pyPETaL is a time-series data analysis pipeline for AGN reverberation mapping (RM) data. It combines multiple different popular softwares using for AGN RM analysis, including PyCCF, PyZDCF, JAVELIN, and PyROA. This pipeline also implements outlier rejection using Damped Random Walk Gaussian proces fitting, and detrending through the LinMix algorithm. pyPetal implements a weighting scheme (for all modules) in order to mitigate aliasing in peaks of time lag distributions between light curves.

pyPetal is very flexible, with almost every argument for each module allowing user input. pyPetal is designed to work with any combination of modules being run, allowing it to scale from the simplest to the most complex of projects.

Installation

pyPetal

pyPetal is available on PyPI and can be installed with pip:

    pip install pypetal

Or, if you want to install the latest development version:

    git clone https://github.com/Zstone19/pypetal.git
    cd pypetal
    pip install .

PLIKE is an optional algorithm that is used in pyPetal. There is a script available in the main directory to install and compile PLIKE (assuming that gfortran is installed). To install PLIKE, run the following command:

    sh build_plike.sh

Detrending

pyPetal offers the option to detrend the input light curves via the LinMix algorithm. This package is not offered in the base version of pyPetal, but can be installed with pip:

    pip install "linmix @ git+https://github.com/jmeyers314/linmix.git"

Or with poetry:

    poetry install --with extra

MICA2

pyPetal also offers MICA2 as an optional module. This package is more complex to install than the others - to find out more, read the MICA2 installation guide.

poetry can help to install some easily-installable python dependencies for MICA2:

    poetry install --with extra

The functionality and inputs of the MICA2 module are identical to the original software, so the best way to learn how this module functions is to read the MICA2 documentation.

NOTE: Seeing as this is an optional module, pyPetal will still compile and run if MICA2's dependencies are not installed. Each pyPetal run will assume run_mica2=False.

pyPetal and JAVELIN

The JAVELIN software used in pyPetal runs on Python 2, though the bulk of pyPetal software relies on Python >=3.8. To circumvent this issue, pyPetal has a JAVELIN "module" (pypetal-jav) that can be installed as a separate package and used in conjunction with pyPetal, in a Python 2 environment.

External requirements (not installed by pip or setup.py):

    A Fortran compiler (>F90)

pyPetal-jav is available on PyPI and can be installed with pip:

    pip install --no-deps pypetal-jav
    pip install pypetal-jav

Or, if you want to install the latest development version:

    git clone https://github.com/Zstone19/pypetal-jav.git
    cd pypetal-jav
    pip install .

NOTE: The user may need to install NumPy before installing pyPetal-jav through pip or setup.py. This is because JAVELIN requires NumPy in order to be installed. This can be done with:

    pip install numpy

Citing pyPetal

To cite the pyPetal code itself, use the ASCL reference:

    Stone Z., 2024, version xxxx, Astrophysics Source Code Library, record ascl:2401.004

Cit the paper pyPetal was used in: Shen et al. (2023)

pypetal's People

Contributors

pre-commit-ci[bot] avatar zstone19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pypetal's Issues

An Issue for not using MICA2 in PyPETaL v1.0.0

If I want use PyPETaL withthout MICA, I will get an error telling me " 'NoneType' object has no attribute 'bcast' ". I guess it is because you set comm=None if MICA2 doesn't exist. So I think you perhaps need to put lines 319-324 in pypetal/pipeline.py after if run_mica2.

Threading Issues with pyROA

When running through multiple objects with pyROA (i.e., using together=False in the pyROA module), things can break easily. I've had to make a few workarounds, as when running objects serially, some threads from one run don't stop before the next run is started. This can cause the whole code to break in general.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.