Skip to content

Commit 5320deb

Browse files
author
Merry Duparc
committed
udpdate get_cov_blocks with no CV
1 parent 665fa9c commit 5320deb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

project/SO/pISO/python/covariance/get_covariance_blocks.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
nl_dict=nl_dict,
7171
bl_dict=bl_dict)
7272

73+
# ps_all_zeros = {msa: {msb: {spec: np.zeros_like(ps) for spec, ps in db.items()} for msb, db in da.items()} for msa, da in ps_all.items()}
74+
ps_all_zeros = {k: np.zeros_like(v) for k, v in ps_all.items()}
75+
7376
ncovs, na_list, nb_list, nc_list, nd_list = pspipe_list.get_covariances_list(d)
7477

7578
if d["use_toeplitz_cov"] == True:
@@ -137,6 +140,19 @@
137140
binned_mcm=binned_mcm,
138141
cov_T_E_only=cov_T_E_only,
139142
dtype=np.float32)
143+
144+
analytic_cov_nocv = so_cov.generalized_cov_spin0and2(coupling,
145+
[na, nb, nc, nd],
146+
n_splits,
147+
ps_all_zeros,
148+
nl_all,
149+
lmax,
150+
binning_file,
151+
mbb_inv_ab,
152+
mbb_inv_cd,
153+
binned_mcm=binned_mcm,
154+
cov_T_E_only=cov_T_E_only,
155+
dtype=np.float32)
140156

141157
if apply_kspace_filter == True:
142158
# Some heuristic correction for the number of modes lost due to the transfer function
@@ -148,5 +164,7 @@
148164
# sqrt(tf) is an approx for the number of modes masked in a given map so (2l+1)*fsky*sqrt(tf)
149165
# is our proxy for the number of modes
150166
analytic_cov /= np.outer(one_d_tf ** (1.0 / 4.0), one_d_tf ** (1.0 / 4.0))
167+
analytic_cov_nocv /= np.outer(one_d_tf ** (1.0 / 4.0), one_d_tf ** (1.0 / 4.0))
151168

152169
np.save(f"{cov_dir}/analytic_cov_{na_r}x{nb_r}_{nc_r}x{nd_r}.npy", analytic_cov)
170+
np.save(f"{cov_dir}/analytic_cov_{na_r}x{nb_r}_{nc_r}x{nd_r}_nocv.npy", analytic_cov_nocv)

0 commit comments

Comments
 (0)