https://github.com/ywx649999311/eztao

A Python Toolkit for AGN Time Series Analysis using CARMA models

https://github.com/ywx649999311/eztao

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 7 committers (14.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.5%) to scientific vocabulary

Keywords

agn astronomy carma drw gaussian-processes time-series

Keywords from Contributors

sequences projection interactive serializer measurement cycles packaging charts network-simulation modular
Last synced: 9 months ago · JSON representation

Repository

A Python Toolkit for AGN Time Series Analysis using CARMA models

Basic Info
  • Host: GitHub
  • Owner: ywx649999311
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 11.8 MB
Statistics
  • Stars: 23
  • Watchers: 2
  • Forks: 9
  • Open Issues: 7
  • Releases: 13
Topics
agn astronomy carma drw gaussian-processes time-series
Created about 6 years ago · Last pushed 12 months ago
Metadata Files
Readme Changelog License

README.md

tests Binder Documentation Status ascl:2201.001

EzTao (易道)

EzTao is a toolkit for conducting AGN time-series/variability analysis, mainly utilizing the continuous-time auto-regressive moving average model (CARMA)

Installation

pip install git+https://github.com/ywx649999311/EzTao.git

Dependencies

python = ">=3.9,<3.13" celerite = ">= 0.3.0" scipy = "> 1.5.0" numba = ">= 0.57.0" matplotlib = ">=3.3.3" emcee = ">=0.3.0"

Quick Examples

Let's first simulate a DRW/CARMA(1,0) process with a variance of 0.3^2 and a relaxation timescale of 100 days. This time series will have a total of 200 data points and span 10 years. ```python import numpy as np import matplotlib.pyplot as plt from eztao.carma import DRW_term from eztao.ts import gpSimRand

define a DRW kernel & and simulate a process

amp = 0.2 tau = 100 DRWkernel = DRWterm(np.log(amp), np.log(tau)) t, y, yerr = gpSimRand(DRW_kernel, 10, 365*10, 200)

now, plot it

fig, ax = plt.subplots(1,1, dpi=150, figsize=(8,3)) ax.errorbar(t, y, yerr, fmt='.') ... ``` drw_sim

We can fit the simulated time series to the DRW model and see how well we can recover the input parameters. ```python from eztao.ts import drw_fit

bestfit = drwfit(t, y, yerr) print(f'Best-fit DRW parameters: {best_fit}') shell Best-fit DRW parameters: [0.17356983 88.36262467] ```

How does the power spectrum density (PSD) compare? ```python from eztao.carma import gp_psd

get psd functions

truepsd = gppsd(DRWkernel) bestpsd = gppsd(DRWterm(*np.log(best_fit)))

plot

fig, ax = plt.subplots(1,1, dpi=150, figsize=(6,3)) freq = np.logspace(-5, 2) ax.plot(freq, truepsd(freq), label='Input PSD') ax.plot(freq, bestpsd(freq), label='Best-fit PSD') ... ``` drw_psd

Note: How well the input and best-fit PSD match is up to how good the best-fit parameters are, which is highly influenced by the quality of the input time series.

For more examples, please check out the online documentation or run the tutorial notebooks at -> Binder.

Development

poetry is used to solve dependencies and to build/publish this package. Below shows how setup the environment for development (assuming you already have poetry installed on your machine). <!-- Warning: poetry is having issue installing llvmlite = 0.34.0 (used for eztao = ^0.4.0) under Python 3.9. The issue disappears for Python 3.8. --> 1. Clone this repository, and enter the repository folder. 2. Create a python virtual environment and activate it (the virtual environment name must be '.venv'). python -m venv .venv source .venv/bin/activate 3. Install dependencies and EzTao in editable mode. poetry install

Now you should be ready to start adding new features. Be sure to checkout the normal practice regarding how to use poetry on its website. When you are ready to push, also make sure the poetry.lock file is checked-in if any dependency has changed.

Citation

We are working on a paper to describe the full implementation of EzTao. In the meantime, if you find EzTao useful for your research, please consider acknowledging EzTao using the following:

@MISC{Yu2022, author = {{Yu}, Weixiang and {Richards}, Gordon T.}, title = "{EzTao: Easier CARMA Modeling}", keywords = {Software}, howpublished = {Astrophysics Source Code Library, record ascl:2201.001}, year = 2022, month = jan, eid = {ascl:2201.001}, pages = {ascl:2201.001}, archivePrefix = {ascl}, eprint = {2201.001}, adsurl = {https://ui.adsabs.harvard.edu/abs/2022ascl.soft01001Y}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} }

Owner

  • Name: Weixiang Yu
  • Login: ywx649999311
  • Kind: user

Physics PhD Candidate at Drexel University

GitHub Events

Total
  • Create event: 4
  • Release event: 1
  • Issues event: 7
  • Watch event: 3
  • Issue comment event: 5
  • Push event: 6
  • Pull request event: 5
Last Year
  • Create event: 4
  • Release event: 1
  • Issues event: 7
  • Watch event: 3
  • Issue comment event: 5
  • Push event: 6
  • Pull request event: 5

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 249
  • Total Committers: 7
  • Avg Commits per committer: 35.571
  • Development Distribution Score (DDS): 0.04
Past Year
  • Commits: 12
  • Committers: 3
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Weixiang Yu w****3@d****u 239
dependabot[bot] 4****] 3
Weixiang Yu y****9@g****m 3
LSSTAGNSC 1****s 1
Drew Oldag 4****g 1
David Wright d****v@g****m 1
Matt Lowery m****y@M****n 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 63
  • Total pull requests: 34
  • Average time to close issues: 5 months
  • Average time to close pull requests: 18 days
  • Total issue authors: 6
  • Total pull request authors: 6
  • Average comments per issue: 0.4
  • Average comments per pull request: 0.5
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 15
Past Year
  • Issues: 2
  • Pull requests: 8
  • Average time to close issues: 6 months
  • Average time to close pull requests: 13 minutes
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.25
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 6
Top Authors
Issue Authors
  • ywx649999311 (58)
  • karandogra987 (2)
  • nevencaplar (1)
  • mwl10 (1)
  • drewoldag (1)
Pull Request Authors
  • dependabot[bot] (18)
  • ywx649999311 (16)
  • davecwright3 (2)
  • mwl10 (1)
  • drewoldag (1)
  • gtrichards (1)
Top Labels
Issue Labels
enhancement (12) feature (11) bug (6) documentation (3) celerite2 (3)
Pull Request Labels
dependencies (18) python (6)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 116 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 2
  • Total versions: 13
  • Total maintainers: 1
pypi.org: eztao

A toolkit for Active Galactic Nuclei (AGN) time-series analysis.

  • Versions: 13
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 116 Last month
Rankings
Dependent packages count: 4.8%
Downloads: 9.1%
Average: 10.4%
Dependent repos count: 11.5%
Forks count: 11.9%
Stargazers count: 14.6%
Maintainers (1)
Last synced: 9 months ago

Dependencies

docs/requirements.txt pypi
  • celerite ==0.4.0
  • emcee ==3.0.0
  • ipykernel *
  • jinja2 <3.1
  • matplotlib ==3.3.3
  • nbsphinx >=0.8.6
  • numba ==0.51.0
  • scipy ==1.5.0
  • sphinx ==3.4.1
  • sphinx-copybutton ==0.3.1
  • sphinx_rtd_theme ==0.5.0
  • toml ==0.10.2
environment.yml pypi
  • corner *
  • eztao ==0.4.0
  • importlib-metadata *
poetry.lock pypi
  • alabaster 0.7.12 develop
  • atomicwrites 1.4.0 develop
  • attrs 21.4.0 develop
  • babel 2.9.1 develop
  • beautifulsoup4 4.10.0 develop
  • black 21.12b0 develop
  • bleach 4.1.0 develop
  • certifi 2021.10.8 develop
  • cffi 1.15.0 develop
  • charset-normalizer 2.0.12 develop
  • click 8.1.2 develop
  • colorama 0.4.4 develop
  • coverage 6.3.2 develop
  • defusedxml 0.7.1 develop
  • docutils 0.16 develop
  • entrypoints 0.4 develop
  • fastjsonschema 2.15.3 develop
  • idna 3.3 develop
  • imagesize 1.3.0 develop
  • importlib-resources 5.6.0 develop
  • iniconfig 1.1.1 develop
  • jinja2 3.1.1 develop
  • joblib 0.17.0 develop
  • jsonschema 4.4.0 develop
  • jupyter-client 7.2.1 develop
  • jupyter-core 4.9.2 develop
  • jupyterlab-pygments 0.1.2 develop
  • markupsafe 2.1.1 develop
  • mistune 0.8.4 develop
  • mypy-extensions 0.4.3 develop
  • nbclient 0.5.13 develop
  • nbconvert 6.4.5 develop
  • nbformat 5.3.0 develop
  • nbsphinx 0.8.8 develop
  • nest-asyncio 1.5.5 develop
  • pandas 1.1.5 develop
  • pandocfilters 1.5.0 develop
  • pathspec 0.9.0 develop
  • platformdirs 2.5.1 develop
  • pluggy 1.0.0 develop
  • py 1.11.0 develop
  • pycparser 2.21 develop
  • pygments 2.11.2 develop
  • pyrsistent 0.18.1 develop
  • pytest 6.2.5 develop
  • pytest-cov 2.12.1 develop
  • pytz 2022.1 develop
  • pywin32 303 develop
  • pyzmq 22.3.0 develop
  • requests 2.27.1 develop
  • snowballstemmer 2.2.0 develop
  • soupsieve 2.3.1 develop
  • sphinx 3.5.4 develop
  • sphinx-copybutton 0.3.3 develop
  • sphinx-rtd-theme 0.5.2 develop
  • sphinxcontrib-applehelp 1.0.2 develop
  • sphinxcontrib-devhelp 1.0.2 develop
  • sphinxcontrib-htmlhelp 2.0.0 develop
  • sphinxcontrib-jsmath 1.0.1 develop
  • sphinxcontrib-qthelp 1.0.3 develop
  • sphinxcontrib-serializinghtml 1.1.5 develop
  • testpath 0.6.0 develop
  • toml 0.10.2 develop
  • tornado 6.1 develop
  • traitlets 5.1.1 develop
  • typed-ast 1.5.2 develop
  • urllib3 1.26.9 develop
  • webencodings 0.5.1 develop
  • celerite 0.4.2
  • cycler 0.11.0
  • emcee 3.1.1
  • fonttools 4.31.2
  • importlib-metadata 4.11.3
  • kiwisolver 1.4.2
  • llvmlite 0.34.0
  • matplotlib 3.5.1
  • numba 0.51.2
  • numpy 1.21.1
  • packaging 21.3
  • pillow 9.1.0
  • pyparsing 3.0.7
  • python-dateutil 2.8.2
  • scipy 1.6.1
  • setuptools-scm 6.4.2
  • six 1.16.0
  • tomli 1.2.3
  • typing-extensions 4.1.1
  • zipp 3.8.0
pyproject.toml pypi
  • Sphinx ^3.4.1 develop
  • black ^21.7b0 develop
  • joblib ^0.17.0 develop
  • nbsphinx >=0.8.6 develop
  • pandas ^1.1.4 develop
  • pytest ^6.0.1 develop
  • pytest-cov ^2.10.1 develop
  • sphinx-copybutton ^0.3.1 develop
  • sphinx-rtd-theme ^0.5.0 develop
  • toml ^0.10.1 develop
  • celerite >= 0.3.0
  • emcee >=3.0.0
  • importlib-metadata >= 2.0.0
  • matplotlib ^3.3.0
  • numba >= 0.51.0
  • python ^3.7
  • scipy > 1.5.0