Skip to content

Commit a9898cc

Browse files
Merge pull request #35 from CosmoStat/develop
v 0.0.6
2 parents 0e2a066 + 7f65c70 commit a9898cc

4 files changed

Lines changed: 32 additions & 13 deletions

File tree

cs_util/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323

2424
from warnings import warn
2525

26-
__version__ = "0.0.5"
26+
__version__ = "0.0.6"

cs_util/cat.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from datetime import datetime
1313
from astropy.io import fits
1414
from astropy.io import ascii
15+
from astropy.table import Table
1516

1617

1718
def write_header_info_sp(primary_header, name="unknown", version="unknown"):
@@ -106,6 +107,26 @@ def add_shear_bias_to_header(primary_header, R, R_shear, R_select, c):
106107
primary_header["c_2"] = (c[1], "Additive bias 2nd comp")
107108

108109

110+
def write_ascii_table_file(cols, names, fname):
111+
"""Write Ascii Table File.
112+
113+
Write ASCII file with table data.
114+
115+
Parameters
116+
----------
117+
cols : list
118+
data columns
119+
names : list of str
120+
column names
121+
fname : str
122+
output file name
123+
124+
"""
125+
t = Table(cols, names=names)
126+
with open(fname, "w") as fout:
127+
ascii.write(t, fout, delimiter="\t")
128+
129+
109130
def write_fits_BinTable_file(
110131
cols,
111132
output_path,

cs_util/cosmo.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717
import pyccl as ccl
1818

1919

20-
# Set ell_max to large value, for spline interpolation (in integral over
21-
# C_ell to get real-space correlation functions). Avoid aliasing
22-
# (oscillations)
23-
ccl.spline_params.ELL_MAX_CORR = 10_000_000
24-
25-
ccl.spline_params.N_ELL_CORR = 5_000
26-
27-
2820
def get_cosmo_default():
2921
"""Get Cosmo Default.
3022
@@ -44,6 +36,12 @@ def get_cosmo_default():
4436
n_s=0.96,
4537
)
4638

39+
# Set ell_max to large value, for spline interpolation (in integral over
40+
# C _ell to get real-space correlation functions). Avoid aliasing
41+
# ( oscillations)
42+
cos.cosmo.spline_params.ELL_MAX_CORR = 10_000_000
43+
cos.cosmo.spline_params.N_ELL_CORR = 5_000
44+
4745
return cos
4846

4947

@@ -302,9 +300,9 @@ def xipm_theo(
302300
for corr_type in ("GG+", "GG-"):
303301
xipm[corr_type] = ccl.correlation(
304302
cos,
305-
ell,
306-
cl,
307-
theta.to("deg"),
303+
ell=ell,
304+
C_ell=cl,
305+
theta=theta.to("deg"),
308306
type=corr_type,
309307
)
310308

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ astropy
22
datetime
33
numpy
44
matplotlib
5-
pyccl
5+
pyccl==2.6.1
66
vos

0 commit comments

Comments
 (0)