Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds CMB phi x galaxy density (pd) to python wrapper #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion python/cclassy.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ cdef extern from "class.h":
int has_tp
int has_dd
int has_td
int has_pd
int has_ll
int has_dl
int has_tl
Expand Down Expand Up @@ -216,6 +217,7 @@ cdef extern from "class.h":
int has_bb
int has_pp
int has_tp
int has_pd
int has_dd
int has_td
int has_ll
Expand All @@ -227,6 +229,7 @@ cdef extern from "class.h":
int index_lt_bb
int index_lt_pp
int index_lt_tp
int index_lt_pd
int index_lt_dd
int index_lt_td
int index_lt_ll
Expand Down Expand Up @@ -334,4 +337,4 @@ cdef extern from "class.h":
void * psp,
double R,
double z,
double * sigma)
double * sigma)
6 changes: 5 additions & 1 deletion python/classy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ cdef class Class:
(self.sp.has_td, self.sp.index_ct_td, 'td'),
(self.sp.has_ll, self.sp.index_ct_ll, 'll'),
(self.sp.has_dl, self.sp.index_ct_dl, 'dl'),
(self.sp.has_pd, self.sp.index_ct_pd, 'pd'),
(self.sp.has_tl, self.sp.index_ct_tl, 'tl')]
spectra = []

Expand Down Expand Up @@ -615,7 +616,7 @@ cdef class Class:
# computes the size, given the number of correlations needed to be computed
size = (self.sp.d_size*(self.sp.d_size+1)-(self.sp.d_size-self.sp.non_diag)*
(self.sp.d_size-1-self.sp.non_diag))/2;
for elem in ['dd', 'll', 'dl']:
for elem in ['dd', 'll', 'dl','pd']:
if elem in spectra:
cl[elem] = {}
for index in range(size):
Expand All @@ -637,6 +638,9 @@ cdef class Class:
if 'dl' in spectra:
for index in range(size):
cl['dl'][index][ell] = dcl[self.sp.index_ct_dl+index]
if 'pd' in spectra:
for index in range(size):
cl['pd'][index][ell] = dcl[self.sp.index_ct_pd+index]
if 'td' in spectra:
cl['td'][ell] = dcl[self.sp.index_ct_td]
if 'tl' in spectra:
Expand Down