pyatools 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. pyatools-0.1.0/LICENSE +22 -0
  2. pyatools-0.1.0/MANIFEST.in +5 -0
  3. pyatools-0.1.0/PKG-INFO +78 -0
  4. pyatools-0.1.0/README.rst +46 -0
  5. pyatools-0.1.0/pyatools.egg-info/PKG-INFO +78 -0
  6. pyatools-0.1.0/pyatools.egg-info/SOURCES.txt +47 -0
  7. pyatools-0.1.0/pyatools.egg-info/dependency_links.txt +1 -0
  8. pyatools-0.1.0/pyatools.egg-info/requires.txt +12 -0
  9. pyatools-0.1.0/pyatools.egg-info/top_level.txt +1 -0
  10. pyatools-0.1.0/pyproject.toml +35 -0
  11. pyatools-0.1.0/setup.cfg +4 -0
  12. pyatools-0.1.0/setup.py +47 -0
  13. pyatools-0.1.0/src/pyat/__init__.py +50 -0
  14. pyatools-0.1.0/src/pyat/_version.py +6 -0
  15. pyatools-0.1.0/src/pyat/ccf.c +27157 -0
  16. pyatools-0.1.0/src/pyat/ccf.pxd +63 -0
  17. pyatools-0.1.0/src/pyat/ccf.pyx +1111 -0
  18. pyatools-0.1.0/src/pyat/ccf_null_test.py +414 -0
  19. pyatools-0.1.0/src/pyat/ccf_old.py +612 -0
  20. pyatools-0.1.0/src/pyat/cosmology.py +42 -0
  21. pyatools-0.1.0/src/pyat/detrend.py +72 -0
  22. pyatools-0.1.0/src/pyat/drw.py +377 -0
  23. pyatools-0.1.0/src/pyat/estimate_syserr.py +116 -0
  24. pyatools-0.1.0/src/pyat/filter.py +122 -0
  25. pyatools-0.1.0/src/pyat/format_mica.py +151 -0
  26. pyatools-0.1.0/src/pyat/gsl_errno.c +65 -0
  27. pyatools-0.1.0/src/pyat/gsl_errno.h +81 -0
  28. pyatools-0.1.0/src/pyat/gsl_rng.c +680 -0
  29. pyatools-0.1.0/src/pyat/gsl_rng.h +222 -0
  30. pyatools-0.1.0/src/pyat/libccf.c +573 -0
  31. pyatools-0.1.0/src/pyat/libccf.h +62 -0
  32. pyatools-0.1.0/src/pyat/loadsed.py +64 -0
  33. pyatools-0.1.0/src/pyat/loadtemplate.py +64 -0
  34. pyatools-0.1.0/src/pyat/mean_rms_spectra.py +258 -0
  35. pyatools-0.1.0/src/pyat/rebin.c +17697 -0
  36. pyatools-0.1.0/src/pyat/rebin.pyx +188 -0
  37. pyatools-0.1.0/src/pyat/rebin_spectrum.py +252 -0
  38. pyatools-0.1.0/src/pyat/remove_outliers.py +41 -0
  39. pyatools-0.1.0/src/pyat/sim_rm.py +35 -0
  40. pyatools-0.1.0/src/pyat/spec_merge.py +205 -0
  41. pyatools-0.1.0/template/sedrl_shang2011.txt +267 -0
  42. pyatools-0.1.0/template/sedrq_shang2011.txt +260 -0
  43. pyatools-0.1.0/template/template_glikman2006.txt +10958 -0
  44. pyatools-0.1.0/template/template_sdss_vandenberk.txt +7778 -0
  45. pyatools-0.1.0/test/test.py +378 -0
  46. pyatools-0.1.0/test/test_drw.py +21 -0
  47. pyatools-0.1.0/test/test_iccf.py +89 -0
  48. pyatools-0.1.0/test/test_lc_rebin.py +30 -0
  49. pyatools-0.1.0/test/test_rebin_spectrum.py +88 -0
pyatools-0.1.0/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025-2030 Yan-Rong Li
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,5 @@
1
+ include LICENSE
2
+ include README.rst
3
+ include pyproject.toml
4
+ recursive-include src/pyat *.py *.pyx *.pxd *.c *.h
5
+ recursive-include template *.txt
@@ -0,0 +1,78 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyatools
3
+ Version: 0.1.0
4
+ Summary: Python Astronomical Tools
5
+ Author: Yan-Rong Li
6
+ Author-email: Yan‑Rong Li <liyropt@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/LiyrAstroph/PyAT
9
+ Project-URL: Documentation, https://pyat.readthedocs.io
10
+ Project-URL: Source, https://github.com/LiyrAstroph/PyAT
11
+ Keywords: astronomy,AGN,reverberation mapping,time series,spectra
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/x-rst
17
+ License-File: LICENSE
18
+ Requires-Dist: numpy
19
+ Requires-Dist: scipy
20
+ Requires-Dist: numba
21
+ Requires-Dist: celerite
22
+ Requires-Dist: corner
23
+ Requires-Dist: emcee
24
+ Requires-Dist: astropy
25
+ Provides-Extra: docs
26
+ Requires-Dist: sphinx>=7.0; extra == "docs"
27
+ Requires-Dist: numpydoc>=1.5; extra == "docs"
28
+ Requires-Dist: sphinx-rtd-theme>=1.3; extra == "docs"
29
+ Dynamic: author
30
+ Dynamic: license-file
31
+ Dynamic: requires-dist
32
+
33
+ PyAT
34
+ =====
35
+
36
+ **Py**\ thon **A**\ stronomical **T**\ ools.
37
+
38
+ PyAT is a package providing useful tools for astronomical analysis.
39
+ It is in continuous development and currently provides
40
+ the following procedures
41
+
42
+ - Estimate the systematic error of a light curve;
43
+ - Generate formatted input files for MICA package;
44
+ - Calculate mean and rms spectra and their line widths;
45
+ - Remove outliers from a light curve using the median filter;
46
+ - Rebin light curves using the inverse variance weighting;
47
+ - Rebin spectra by keeping the total flux unchanged;
48
+ - Calculate interpolated cross-correlation function (ICCF);
49
+ - Reconstruct light curves using damped random walk model;
50
+ - Detrend light curves using a linear trend;
51
+ - AGN spectral templates (Glikman et al. 2006; Vanden Berk et al. 2001);
52
+ - Quasar spectral energy distribution templates (Elvis et al. 1994; Shang et al. 2011);
53
+ - Merge spectral segments;
54
+ - Smooth data using Savitzky-Golay filter;
55
+ - Cosmological calculations.
56
+
57
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
58
+ Read `the documentation <https://pyat.readthedocs.io>`_
59
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
60
+
61
+ To install PyAT, use the terminal command
62
+
63
+ .. code-block:: python
64
+
65
+ #option 1: download the source code and run
66
+ python setup.py install --user
67
+ # or
68
+ python -m pip install .
69
+
70
+ #option 2: install PyAT directly from the GitHub repository
71
+ python -m pip install git+https://github.com/yanrongli/PyAT.git
72
+
73
+ #option 3: install PyAT from PyPI (if available)
74
+ python -m pip install pyatools
75
+
76
+ #note: the package name is `pyatools` instead of `pyat`
77
+ # to avoid conflict with other packages.
78
+
@@ -0,0 +1,46 @@
1
+ PyAT
2
+ =====
3
+
4
+ **Py**\ thon **A**\ stronomical **T**\ ools.
5
+
6
+ PyAT is a package providing useful tools for astronomical analysis.
7
+ It is in continuous development and currently provides
8
+ the following procedures
9
+
10
+ - Estimate the systematic error of a light curve;
11
+ - Generate formatted input files for MICA package;
12
+ - Calculate mean and rms spectra and their line widths;
13
+ - Remove outliers from a light curve using the median filter;
14
+ - Rebin light curves using the inverse variance weighting;
15
+ - Rebin spectra by keeping the total flux unchanged;
16
+ - Calculate interpolated cross-correlation function (ICCF);
17
+ - Reconstruct light curves using damped random walk model;
18
+ - Detrend light curves using a linear trend;
19
+ - AGN spectral templates (Glikman et al. 2006; Vanden Berk et al. 2001);
20
+ - Quasar spectral energy distribution templates (Elvis et al. 1994; Shang et al. 2011);
21
+ - Merge spectral segments;
22
+ - Smooth data using Savitzky-Golay filter;
23
+ - Cosmological calculations.
24
+
25
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26
+ Read `the documentation <https://pyat.readthedocs.io>`_
27
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28
+
29
+ To install PyAT, use the terminal command
30
+
31
+ .. code-block:: python
32
+
33
+ #option 1: download the source code and run
34
+ python setup.py install --user
35
+ # or
36
+ python -m pip install .
37
+
38
+ #option 2: install PyAT directly from the GitHub repository
39
+ python -m pip install git+https://github.com/yanrongli/PyAT.git
40
+
41
+ #option 3: install PyAT from PyPI (if available)
42
+ python -m pip install pyatools
43
+
44
+ #note: the package name is `pyatools` instead of `pyat`
45
+ # to avoid conflict with other packages.
46
+
@@ -0,0 +1,78 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyatools
3
+ Version: 0.1.0
4
+ Summary: Python Astronomical Tools
5
+ Author: Yan-Rong Li
6
+ Author-email: Yan‑Rong Li <liyropt@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/LiyrAstroph/PyAT
9
+ Project-URL: Documentation, https://pyat.readthedocs.io
10
+ Project-URL: Source, https://github.com/LiyrAstroph/PyAT
11
+ Keywords: astronomy,AGN,reverberation mapping,time series,spectra
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/x-rst
17
+ License-File: LICENSE
18
+ Requires-Dist: numpy
19
+ Requires-Dist: scipy
20
+ Requires-Dist: numba
21
+ Requires-Dist: celerite
22
+ Requires-Dist: corner
23
+ Requires-Dist: emcee
24
+ Requires-Dist: astropy
25
+ Provides-Extra: docs
26
+ Requires-Dist: sphinx>=7.0; extra == "docs"
27
+ Requires-Dist: numpydoc>=1.5; extra == "docs"
28
+ Requires-Dist: sphinx-rtd-theme>=1.3; extra == "docs"
29
+ Dynamic: author
30
+ Dynamic: license-file
31
+ Dynamic: requires-dist
32
+
33
+ PyAT
34
+ =====
35
+
36
+ **Py**\ thon **A**\ stronomical **T**\ ools.
37
+
38
+ PyAT is a package providing useful tools for astronomical analysis.
39
+ It is in continuous development and currently provides
40
+ the following procedures
41
+
42
+ - Estimate the systematic error of a light curve;
43
+ - Generate formatted input files for MICA package;
44
+ - Calculate mean and rms spectra and their line widths;
45
+ - Remove outliers from a light curve using the median filter;
46
+ - Rebin light curves using the inverse variance weighting;
47
+ - Rebin spectra by keeping the total flux unchanged;
48
+ - Calculate interpolated cross-correlation function (ICCF);
49
+ - Reconstruct light curves using damped random walk model;
50
+ - Detrend light curves using a linear trend;
51
+ - AGN spectral templates (Glikman et al. 2006; Vanden Berk et al. 2001);
52
+ - Quasar spectral energy distribution templates (Elvis et al. 1994; Shang et al. 2011);
53
+ - Merge spectral segments;
54
+ - Smooth data using Savitzky-Golay filter;
55
+ - Cosmological calculations.
56
+
57
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
58
+ Read `the documentation <https://pyat.readthedocs.io>`_
59
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
60
+
61
+ To install PyAT, use the terminal command
62
+
63
+ .. code-block:: python
64
+
65
+ #option 1: download the source code and run
66
+ python setup.py install --user
67
+ # or
68
+ python -m pip install .
69
+
70
+ #option 2: install PyAT directly from the GitHub repository
71
+ python -m pip install git+https://github.com/yanrongli/PyAT.git
72
+
73
+ #option 3: install PyAT from PyPI (if available)
74
+ python -m pip install pyatools
75
+
76
+ #note: the package name is `pyatools` instead of `pyat`
77
+ # to avoid conflict with other packages.
78
+
@@ -0,0 +1,47 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.rst
4
+ pyproject.toml
5
+ setup.py
6
+ pyatools.egg-info/PKG-INFO
7
+ pyatools.egg-info/SOURCES.txt
8
+ pyatools.egg-info/dependency_links.txt
9
+ pyatools.egg-info/requires.txt
10
+ pyatools.egg-info/top_level.txt
11
+ src/pyat/__init__.py
12
+ src/pyat/_version.py
13
+ src/pyat/ccf.c
14
+ src/pyat/ccf.pxd
15
+ src/pyat/ccf.pyx
16
+ src/pyat/ccf_null_test.py
17
+ src/pyat/ccf_old.py
18
+ src/pyat/cosmology.py
19
+ src/pyat/detrend.py
20
+ src/pyat/drw.py
21
+ src/pyat/estimate_syserr.py
22
+ src/pyat/filter.py
23
+ src/pyat/format_mica.py
24
+ src/pyat/gsl_errno.c
25
+ src/pyat/gsl_errno.h
26
+ src/pyat/gsl_rng.c
27
+ src/pyat/gsl_rng.h
28
+ src/pyat/libccf.c
29
+ src/pyat/libccf.h
30
+ src/pyat/loadsed.py
31
+ src/pyat/loadtemplate.py
32
+ src/pyat/mean_rms_spectra.py
33
+ src/pyat/rebin.c
34
+ src/pyat/rebin.pyx
35
+ src/pyat/rebin_spectrum.py
36
+ src/pyat/remove_outliers.py
37
+ src/pyat/sim_rm.py
38
+ src/pyat/spec_merge.py
39
+ template/sedrl_shang2011.txt
40
+ template/sedrq_shang2011.txt
41
+ template/template_glikman2006.txt
42
+ template/template_sdss_vandenberk.txt
43
+ test/test.py
44
+ test/test_drw.py
45
+ test/test_iccf.py
46
+ test/test_lc_rebin.py
47
+ test/test_rebin_spectrum.py
@@ -0,0 +1,12 @@
1
+ numpy
2
+ scipy
3
+ numba
4
+ celerite
5
+ corner
6
+ emcee
7
+ astropy
8
+
9
+ [docs]
10
+ sphinx>=7.0
11
+ numpydoc>=1.5
12
+ sphinx-rtd-theme>=1.3
@@ -0,0 +1 @@
1
+ pyat
@@ -0,0 +1,35 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools",
4
+ "numpy",
5
+ "cython",
6
+ ]
7
+ build-backend = "setuptools.build_meta"
8
+
9
+ [project]
10
+ name = "pyatools"
11
+ description = "Python Astronomical Tools"
12
+ readme = "README.rst"
13
+ requires-python = ">=3.8"
14
+ license = "MIT"
15
+ license-files = ["LICENSE"]
16
+ authors = [{name = "Yan‑Rong Li", email = "liyropt@gmail.com"}]
17
+ keywords = ["astronomy", "AGN", "reverberation mapping", "time series", "spectra"]
18
+ dynamic = ["version", "dependencies"]
19
+ classifiers = [
20
+ "Programming Language :: Python :: 3",
21
+ "Intended Audience :: Science/Research",
22
+ "Topic :: Scientific/Engineering :: Astronomy",
23
+ ]
24
+
25
+ [project.urls]
26
+ Homepage = "https://github.com/LiyrAstroph/PyAT"
27
+ Documentation = "https://pyat.readthedocs.io"
28
+ Source = "https://github.com/LiyrAstroph/PyAT"
29
+
30
+ [project.optional-dependencies]
31
+ docs = [
32
+ "sphinx>=7.0",
33
+ "numpydoc>=1.5",
34
+ "sphinx-rtd-theme>=1.3",
35
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,47 @@
1
+ #===================================================================================#
2
+ # PyAT: Python Astronomical Tools
3
+ # A package providing basic, common tools in astronomical analysis
4
+ #
5
+ # Yan-Rong Li, liyropt@gmail.com
6
+ # 2023-08-31
7
+ #===================================================================================#
8
+
9
+ from setuptools import setup, find_packages
10
+ from setuptools.extension import Extension
11
+ from Cython.Build import cythonize
12
+ from numpy import get_include
13
+ from glob import glob
14
+ import os
15
+
16
+ # use relative path (relative to setup.py)
17
+ ext_dir = "src/pyat"
18
+
19
+ extensions = cythonize([
20
+ Extension(name="pyat.rebin",
21
+ sources=glob(os.path.join(ext_dir, "rebin.pyx")),
22
+ libraries=["c", "m"],
23
+ include_dirs=[get_include()]
24
+ ),
25
+
26
+ Extension(name="pyat.ccf",
27
+ sources=[os.path.join(ext_dir, "ccf.pyx")]
28
+ + [os.path.join(ext_dir, "libccf.c")]
29
+ + glob(os.path.join(ext_dir, "gsl*.c")),
30
+ depends=[os.path.join(ext_dir, "ccf.pxd")]
31
+ + [os.path.join(ext_dir, "libccf.h")]
32
+ + glob(os.path.join(ext_dir, "gsl*.h")),
33
+ libraries=["c", "m"],
34
+ include_dirs=[get_include()]
35
+ ),
36
+ ])
37
+
38
+ setup(
39
+ name="pyatools",
40
+ version="0.1.0",
41
+ author="Yan-Rong Li",
42
+ packages=["pyat", "pyat.template"],
43
+ package_dir={'pyat':'src/pyat', 'pyat.template':'template'},
44
+ package_data={"pyat.template": ["*.txt"]},
45
+ ext_modules = extensions,
46
+ install_requires=["numpy","scipy","numba","celerite","corner","emcee","astropy"],
47
+ )
@@ -0,0 +1,50 @@
1
+ #===================================================================================#
2
+ # PyAT: Python Astronomical Tools
3
+ # A package providing basic, common tools in astronomical analysis
4
+ #
5
+ # Yan-Rong Li, liyropt@gmail.com
6
+ # 2023-08-31
7
+ #===================================================================================#
8
+ __all__ = ["version", "__version__",
9
+ "remove_outliers",
10
+ "format_mica", "load_mica",
11
+ "estimate_syserr", "estimate_syserr_median_filter",
12
+ "get_mean_rms", "get_line_widths",
13
+ "rebin_spectrum", "rebin_spectrum_with_error", "get_bin_edge",
14
+ "iccf_slow", "iccf_oneway_slow", "iccf_mc_slow", "iccf_mc_oneway_slow",
15
+ "iccf", "iccf_mc", "iccf_oneway", "iccf_mc_oneway",
16
+ "iccf_peak", "iccf_peak_oneway",
17
+ "iccf_peak_significance", "iccf_oneway_peak_significance",
18
+ "iccf_ndeff", "iccf_sigma_null", "iccf_prmax_null",
19
+ "drw_recon", "drw_modeling", "drw_modeling_fast",
20
+ "genlc_psd_drw", "genlc_psd_pow", "genlc_psd_drw_data",
21
+ "detrend",
22
+ "rebin", "rebin_sig",
23
+ "load_template", "list_templates",
24
+ "load_sed", "list_seds",
25
+ "spec_merge",
26
+ "cosmology",
27
+ "smooth_savgol"]
28
+ # Developed by Yan-Rong Li, liyanrong@ihep.ac.cn
29
+
30
+ from ._version import __version__, version
31
+
32
+ from pyat.remove_outliers import remove_outliers
33
+ from pyat.format_mica import format_mica, load_mica
34
+ from pyat.estimate_syserr import estimate_syserr, estimate_syserr_median_filter
35
+ from pyat.mean_rms_spectra import get_mean_rms, get_line_widths
36
+ from pyat.rebin_spectrum import rebin_spectrum, rebin_spectrum_with_error, get_bin_edge
37
+ from pyat.ccf_old import iccf_slow, iccf_oneway_slow, iccf_mc_slow, iccf_mc_oneway_slow
38
+ from pyat.ccf import iccf, iccf_mc, iccf_oneway, iccf_mc_oneway, \
39
+ iccf_peak_significance, iccf_oneway_peak_significance, \
40
+ iccf_peak, iccf_peak_oneway
41
+ from pyat.ccf_null_test import iccf_ndeff, iccf_sigma_null, iccf_prmax_null
42
+ from pyat.drw import drw_recon, drw_modeling, drw_modeling_fast, \
43
+ genlc_psd_drw, genlc_psd_pow, genlc_psd_drw_data
44
+ from pyat.detrend import detrend
45
+ from pyat.rebin import rebin, rebin_sig
46
+ from pyat.loadtemplate import load_template, list_templates
47
+ from pyat.spec_merge import spec_merge
48
+ from pyat.loadsed import load_sed, list_seds
49
+ from pyat.cosmology import cosmology
50
+ from pyat.filter import smooth_savgol
@@ -0,0 +1,6 @@
1
+ """Package version."""
2
+ __version__ = "0.1.0"
3
+
4
+ def version() -> str:
5
+ """Return package version string."""
6
+ return __version__