Package: eztao
EzTao (易道)EzTaois a toolkit for conducting AGN time-series/variability analysis, mainly utilizing the continuous-time auto-regressive moving average model (CARMA)Installationpip install git+https://github.com/ywx649999311/EzTao.gitDependenciespython = ">=3.8,<3.12"
celerite = ">= 0.3.0"
scipy = "> 1.5.0"
numba = ">= 0.57.0"
matplotlib = ">=3.3.3"
emcee = ">=0.3.0"Quick ExamplesLet'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.importnumpyasnpimportmatplotlib.pyplotaspltfromeztao.carmaimportDRW_termfromeztao.tsimportgpSimRand# define a DRW kernel & and simulate a processamp=0.2tau=100DRW_kernel=DRW_term(np.log(amp),np.log(tau))t,y,yerr=gpSimRand(DRW_kernel,10,365*10,200)# now, plot itfig,ax=plt.subplots(1,1,dpi=150,figsize=(8,3))ax.errorbar(t,y,yerr,fmt='.')...We can fit the simulated time series to the DRW model and see how well we can recover the input parameters.fromeztao.tsimportdrw_fitbest_fit=drw_fit(t,y,yerr)print(f'Best-fit DRW parameters:{best_fit}')Best-fitDRWparameters:[0.1735698388.36262467]How does the power spectrum density (PSD) compare?fromeztao.carmaimportgp_psd# get psd functionstrue_psd=gp_psd(DRW_kernel)best_psd=gp_psd(DRW_term(*np.log(best_fit)))# plotfig,ax=plt.subplots(1,1,dpi=150,figsize=(6,3))freq=np.logspace(-5,2)ax.plot(freq,true_psd(freq),label='Input PSD')ax.plot(freq,best_psd(freq),label='Best-fit 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 theonline documentationor run the tutorial notebooks at ->.Developmentpoetryis used to solve dependencies and to build/publish this package. Below shows how setup the environment for development (assuming you already havepoetryinstalled on your machine).Warning:poetryis having issue installingllvmlite = 0.34.0(used foreztao = ^0.4.0) under Python 3.9. The issue disappears for Python 3.8.Clone this repository, and enter the repository folder.Create a python virtual environment and activate it (the virtual environment name must be '.venv').python -m venv .venv
source .venv/bin/activateInstall dependencies andEzTaoin editable mode.poetry installNow you should be ready to start adding new features. Be sure to checkout the normal practice regarding how to usepoetryon its website. When you are ready to push, also make sure the poetry.lock file is checked-in if any dependency has changed.CitationWe are working on a paper to describe the full implementation ofEzTao. In the meantime, if you findEzTaouseful for your research, please consider acknowledgingEzTaousing 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}
}