cmbstack 0.1.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmbstack
3
- Version: 0.1.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
@@ -11,6 +11,7 @@ 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
 
@@ -0,0 +1,5 @@
1
+ __version__ = "0.1.1"
2
+
3
+ from cmbstack.pipeline import StackingPipeline
4
+
5
+ __all__ = ["StackingPipeline", "maps", "stacking"]
@@ -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
- # Function 1
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, Dl_dd, with
54
- D_ell in uK^2. The chosen column is converted from D_ell to C_ell via
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", "dd".
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
- ell, dl = np.loadtxt(path,usecols=(0,1),unpack=True)
72
- ell = ell.astype(int)
73
- lmax = ell.max()
74
- cl = dl_to_cl(ell,dl,lmax)
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
- # Function 2
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmbstack
3
- Version: 0.1.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
@@ -11,6 +11,7 @@ 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
 
@@ -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
@@ -1,3 +1,4 @@
1
1
  numpy
2
+ pandas
2
3
  healpy
3
4
  matplotlib
@@ -19,6 +19,7 @@ classifiers = [
19
19
  requires-python = ">=3.8"
20
20
  dependencies = [
21
21
  "numpy",
22
+ "pandas",
22
23
  "healpy",
23
24
  "matplotlib",
24
25
  ]
@@ -0,0 +1,3 @@
1
+ # pStats
2
+ # cProfiler
3
+
@@ -1,5 +0,0 @@
1
- __version__ = "0.1.0"
2
-
3
- from cmbstack.pipeline import StackingPipeline
4
-
5
- __all__ = ["StackingPipeline", "maps", "stacking"]
File without changes
File without changes
File without changes
File without changes
File without changes