cmbstack 0.0.5__tar.gz → 0.1.1__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.
- {cmbstack-0.0.5 → cmbstack-0.1.1}/PKG-INFO +9 -8
- {cmbstack-0.0.5 → cmbstack-0.1.1}/README.md +6 -6
- cmbstack-0.1.1/cmbstack/__init__.py +5 -0
- {cmbstack-0.0.5 → cmbstack-0.1.1}/cmbstack/maps.py +20 -10
- cmbstack-0.0.5/cmbstack/main.py → cmbstack-0.1.1/cmbstack/pipeline.py +16 -2
- {cmbstack-0.0.5 → cmbstack-0.1.1}/cmbstack.egg-info/PKG-INFO +9 -8
- {cmbstack-0.0.5 → cmbstack-0.1.1}/cmbstack.egg-info/SOURCES.txt +3 -2
- {cmbstack-0.0.5 → cmbstack-0.1.1}/cmbstack.egg-info/requires.txt +1 -0
- {cmbstack-0.0.5 → cmbstack-0.1.1}/pyproject.toml +2 -1
- {cmbstack-0.0.5 → cmbstack-0.1.1}/tests/test_find_peaks.py +0 -3
- {cmbstack-0.0.5 → cmbstack-0.1.1}/tests/test_round.py +1 -5
- cmbstack-0.1.1/tests/test_runtime.py +3 -0
- cmbstack-0.0.5/cmbstack/__init__.py +0 -1
- {cmbstack-0.0.5 → cmbstack-0.1.1}/cmbstack/stacking.py +0 -0
- {cmbstack-0.0.5 → cmbstack-0.1.1}/cmbstack.egg-info/dependency_links.txt +0 -0
- {cmbstack-0.0.5 → cmbstack-0.1.1}/cmbstack.egg-info/top_level.txt +0 -0
- {cmbstack-0.0.5 → cmbstack-0.1.1}/setup.cfg +0 -0
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cmbstack
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Stack patches of the CMB temperature sky around local maxima
|
|
5
5
|
Author-email: Isaac Alexis López Paredes <isaacalexis.lopezparedes@students.uniroma2.eu>, Anushka Sanjay Tilekar <anushka.tilekar.23@alumni.ucl.ac.uk>
|
|
6
6
|
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://
|
|
7
|
+
Project-URL: Homepage, https://cmbstack-docs.readthedocs.io/en/latest/index.html
|
|
8
8
|
Project-URL: Repository, https://github.com/IsaacLP/cmbstack.git
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Requires-Python: >=3.8
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
Requires-Dist: numpy
|
|
14
|
+
Requires-Dist: pandas
|
|
14
15
|
Requires-Dist: healpy
|
|
15
16
|
Requires-Dist: matplotlib
|
|
16
17
|
|
|
17
|
-
[](https://semaphorep.github.io/codeastro/)
|
|
19
|
+
[](https://pypi.org/project/cmbstack/)
|
|
20
|
+
[](https://pypi.org/project/cmbstack/)
|
|
21
|
+
[](https://opensource.org/licenses/MIT)
|
|
22
|
+

|
|
22
23
|
|
|
23
24
|
# cmbstack
|
|
24
25
|
|
|
@@ -44,7 +45,7 @@ pip install -e .
|
|
|
44
45
|
|
|
45
46
|
**From a power spectrum file:**
|
|
46
47
|
```python
|
|
47
|
-
from cmbstack
|
|
48
|
+
from cmbstack import StackingPipeline
|
|
48
49
|
|
|
49
50
|
pipeline = StackingPipeline.from_cl("path/to/spectrum.cl", nside=1024, seed=42)
|
|
50
51
|
stacked_result = pipeline.run()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[](https://semaphorep.github.io/codeastro/)
|
|
2
|
+
[](https://pypi.org/project/cmbstack/)
|
|
3
|
+
[](https://pypi.org/project/cmbstack/)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+

|
|
6
6
|
|
|
7
7
|
# cmbstack
|
|
8
8
|
|
|
@@ -28,7 +28,7 @@ pip install -e .
|
|
|
28
28
|
|
|
29
29
|
**From a power spectrum file:**
|
|
30
30
|
```python
|
|
31
|
-
from cmbstack
|
|
31
|
+
from cmbstack import StackingPipeline
|
|
32
32
|
|
|
33
33
|
pipeline = StackingPipeline.from_cl("path/to/spectrum.cl", nside=1024, seed=42)
|
|
34
34
|
stacked_result = pipeline.run()
|
|
@@ -13,6 +13,7 @@ power spectrum (temperature TT, lensing convergence, y-map, ...).
|
|
|
13
13
|
|
|
14
14
|
import numpy as np
|
|
15
15
|
import healpy as hp
|
|
16
|
+
import pandas as pd
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
def dl_to_cl(ell, dl,lmax):
|
|
@@ -46,12 +47,13 @@ def dl_to_cl(ell, dl,lmax):
|
|
|
46
47
|
|
|
47
48
|
return cl
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
def load_cl(path):
|
|
50
|
+
|
|
51
|
+
def load_cl(path, column="TT"):
|
|
51
52
|
"""Load a power-spectrum file and return C_ell for the requested spectrum.
|
|
52
53
|
|
|
53
|
-
The expected file columns are ell, Dl_TT, Dl_TE, Dl_EE, Dl_BB,
|
|
54
|
-
D_ell in uK^2
|
|
54
|
+
The expected file columns are ell, Dl_TT, Dl_TE, Dl_EE, Dl_BB, Dl_pp, with
|
|
55
|
+
D_ell in uK^2 (with names L, TT, TE, EE, BB, PP).
|
|
56
|
+
The chosen column is converted from D_ell to C_ell via
|
|
55
57
|
:func:`dl_to_cl` before being returned.
|
|
56
58
|
|
|
57
59
|
Parameters
|
|
@@ -59,7 +61,7 @@ def load_cl(path):
|
|
|
59
61
|
path : str
|
|
60
62
|
Path to the whitespace-delimited spectrum file.
|
|
61
63
|
column : str, optional
|
|
62
|
-
Which spectrum to return: one of "TT", "TE", "EE", "BB", "
|
|
64
|
+
Which spectrum to return: one of "TT", "TE", "EE", "BB", "PP".
|
|
63
65
|
Default "TT".
|
|
64
66
|
|
|
65
67
|
Returns
|
|
@@ -68,14 +70,22 @@ def load_cl(path):
|
|
|
68
70
|
C_ell array indexed from ell=0, suitable for passing to
|
|
69
71
|
:func:`simulate_map`.
|
|
70
72
|
"""
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
|
|
74
|
+
df = pd.read_csv(
|
|
75
|
+
path,
|
|
76
|
+
sep=r"\s+",
|
|
77
|
+
comment="#",
|
|
78
|
+
header=None,
|
|
79
|
+
names=["L", "TT", "TE", "EE", "BB", "PP"],
|
|
80
|
+
)
|
|
81
|
+
ell = df['L'].values.astype(int)
|
|
82
|
+
dl = df[column].values
|
|
83
|
+
lmax = ell.max()
|
|
84
|
+
cl = dl_to_cl(ell, dl, lmax)
|
|
75
85
|
|
|
76
86
|
return cl
|
|
77
87
|
|
|
78
|
-
|
|
88
|
+
|
|
79
89
|
def simulate_map(cl, nside=128, seed=None):
|
|
80
90
|
"""Simulate a Gaussian random HEALPix map from a power spectrum.
|
|
81
91
|
|
|
@@ -34,6 +34,16 @@ class StackingPipeline:
|
|
|
34
34
|
----------
|
|
35
35
|
normalized : numpy.ndarray or None
|
|
36
36
|
Set after run(); the normalized map.
|
|
37
|
+
positions : numpy.ndarray or None
|
|
38
|
+
Set after run(); the peak positions in (theta, phi) radians.
|
|
39
|
+
patches : numpy.ndarray or None
|
|
40
|
+
Set after run(); the extracted patches.
|
|
41
|
+
stacked : numpy.ndarray or None
|
|
42
|
+
Set after run(); the stacked image.
|
|
43
|
+
radius : numpy.ndarray or None
|
|
44
|
+
Set after run(); the radial distances of the profile in arcmin.
|
|
45
|
+
profile : numpy.ndarray or None
|
|
46
|
+
Set after run(); the radial profile of the stacked image.
|
|
37
47
|
"""
|
|
38
48
|
|
|
39
49
|
def __init__(self, sky_map, nside):
|
|
@@ -86,7 +96,9 @@ class StackingPipeline:
|
|
|
86
96
|
|
|
87
97
|
Returns
|
|
88
98
|
-------
|
|
89
|
-
|
|
99
|
+
self : StackingPipeline
|
|
100
|
+
The pipeline object itself, with all intermediate products stored as
|
|
101
|
+
attributes.
|
|
90
102
|
"""
|
|
91
103
|
|
|
92
104
|
self.normalized = maps.normalize_map(self.map)
|
|
@@ -100,4 +112,6 @@ class StackingPipeline:
|
|
|
100
112
|
if profile:
|
|
101
113
|
self.radius, self.profile = stacking.radial_profile(self.stacked,reso_arcmin=reso_arcmin)
|
|
102
114
|
|
|
103
|
-
return self
|
|
115
|
+
return self
|
|
116
|
+
|
|
117
|
+
StackingPipeline.__module__ = "cmbstack"
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cmbstack
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Stack patches of the CMB temperature sky around local maxima
|
|
5
5
|
Author-email: Isaac Alexis López Paredes <isaacalexis.lopezparedes@students.uniroma2.eu>, Anushka Sanjay Tilekar <anushka.tilekar.23@alumni.ucl.ac.uk>
|
|
6
6
|
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://
|
|
7
|
+
Project-URL: Homepage, https://cmbstack-docs.readthedocs.io/en/latest/index.html
|
|
8
8
|
Project-URL: Repository, https://github.com/IsaacLP/cmbstack.git
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Requires-Python: >=3.8
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
Requires-Dist: numpy
|
|
14
|
+
Requires-Dist: pandas
|
|
14
15
|
Requires-Dist: healpy
|
|
15
16
|
Requires-Dist: matplotlib
|
|
16
17
|
|
|
17
|
-
[](https://semaphorep.github.io/codeastro/)
|
|
19
|
+
[](https://pypi.org/project/cmbstack/)
|
|
20
|
+
[](https://pypi.org/project/cmbstack/)
|
|
21
|
+
[](https://opensource.org/licenses/MIT)
|
|
22
|
+

|
|
22
23
|
|
|
23
24
|
# cmbstack
|
|
24
25
|
|
|
@@ -44,7 +45,7 @@ pip install -e .
|
|
|
44
45
|
|
|
45
46
|
**From a power spectrum file:**
|
|
46
47
|
```python
|
|
47
|
-
from cmbstack
|
|
48
|
+
from cmbstack import StackingPipeline
|
|
48
49
|
|
|
49
50
|
pipeline = StackingPipeline.from_cl("path/to/spectrum.cl", nside=1024, seed=42)
|
|
50
51
|
stacked_result = pipeline.run()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
README.md
|
|
2
2
|
pyproject.toml
|
|
3
3
|
cmbstack/__init__.py
|
|
4
|
-
cmbstack/main.py
|
|
5
4
|
cmbstack/maps.py
|
|
5
|
+
cmbstack/pipeline.py
|
|
6
6
|
cmbstack/stacking.py
|
|
7
7
|
cmbstack.egg-info/PKG-INFO
|
|
8
8
|
cmbstack.egg-info/SOURCES.txt
|
|
@@ -10,4 +10,5 @@ cmbstack.egg-info/dependency_links.txt
|
|
|
10
10
|
cmbstack.egg-info/requires.txt
|
|
11
11
|
cmbstack.egg-info/top_level.txt
|
|
12
12
|
tests/test_find_peaks.py
|
|
13
|
-
tests/test_round.py
|
|
13
|
+
tests/test_round.py
|
|
14
|
+
tests/test_runtime.py
|
|
@@ -19,12 +19,13 @@ classifiers = [
|
|
|
19
19
|
requires-python = ">=3.8"
|
|
20
20
|
dependencies = [
|
|
21
21
|
"numpy",
|
|
22
|
+
"pandas",
|
|
22
23
|
"healpy",
|
|
23
24
|
"matplotlib",
|
|
24
25
|
]
|
|
25
26
|
|
|
26
27
|
[project.urls]
|
|
27
|
-
Homepage = "https://
|
|
28
|
+
Homepage = "https://cmbstack-docs.readthedocs.io/en/latest/index.html"
|
|
28
29
|
Repository = "https://github.com/IsaacLP/cmbstack.git"
|
|
29
30
|
|
|
30
31
|
[tool.setuptools.dynamic]
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import sys
|
|
2
1
|
import healpy as hp
|
|
3
2
|
import numpy as np
|
|
4
3
|
from pathlib import Path
|
|
5
4
|
import tempfile
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
from cmbstack.main import StackingPipeline
|
|
10
|
-
from cmbstack import maps
|
|
6
|
+
from cmbstack import StackingPipeline, maps
|
|
11
7
|
|
|
12
8
|
def test_fits_roundtrip(tmp_path):
|
|
13
9
|
'''Test that the Stacking Pipeline gives the same result from a map saved in memory and loading a .fits file'''
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|