Skip to content

Commit

Permalink
corrected mask shot noise
Browse files Browse the repository at this point in the history
  • Loading branch information
damonge committed Mar 5, 2024
1 parent 20f56d3 commit c99fc55
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/nmt_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,17 +858,22 @@ nmt_workspace *nmt_compute_coupling_matrix(int spin1,int spin2,
for(ll2=0;ll2<=w->lmax;ll2++) {
for(ll3=0;ll3<=w->lmax;ll3++) {
double fac=(2*ll3+1.)*sign_overall;
double Nw_term = Nw*(2*ll3+1)/(4*M_PI);
double Nw_term = 0;
if((spin1 == spin2) && (ll3 >= spin1) && (ll2 >= spin1)) {
Nw_term = Nw*fac/(4*M_PI);
if(spin1 > 0)
Nw_term *= 0.5;
}
if(w->ncls==1)
w->coupling_matrix_unbinned[1*ll2+0][1*ll3+0]=fac*c->xi_00[0][ll2][ll3]+Nw_term; //TT,TT
if(w->ncls==2) {
w->coupling_matrix_unbinned[2*ll2+0][2*ll3+0]=fac*c->xi_0s[0][pe1+pe2][ll2][ll3]+Nw_term; //TE,TE
w->coupling_matrix_unbinned[2*ll2+1][2*ll3+1]=fac*c->xi_0s[0][pb1+pb2][ll2][ll3]+Nw_term; //TB,TB
w->coupling_matrix_unbinned[2*ll2+0][2*ll3+0]=fac*c->xi_0s[0][pe1+pe2][ll2][ll3]; //TE,TE
w->coupling_matrix_unbinned[2*ll2+1][2*ll3+1]=fac*c->xi_0s[0][pb1+pb2][ll2][ll3]; //TB,TB
}
if(w->ncls==4) {
w->coupling_matrix_unbinned[4*ll2+0][4*ll3+3]=fac*c->xi_mm[0][pe1+pe2][ll2][ll3]+Nw_term; //EE,BB
w->coupling_matrix_unbinned[4*ll2+1][4*ll3+2]=-fac*c->xi_mm[0][pe1+pb2][ll2][ll3]+Nw_term; //EB,BE
w->coupling_matrix_unbinned[4*ll2+2][4*ll3+1]=-fac*c->xi_mm[0][pb1+pe2][ll2][ll3]+Nw_term; //BE,EB
w->coupling_matrix_unbinned[4*ll2+1][4*ll3+2]=-fac*c->xi_mm[0][pe1+pb2][ll2][ll3]-Nw_term; //EB,BE
w->coupling_matrix_unbinned[4*ll2+2][4*ll3+1]=-fac*c->xi_mm[0][pb1+pe2][ll2][ll3]-Nw_term; //BE,EB
w->coupling_matrix_unbinned[4*ll2+3][4*ll3+0]=fac*c->xi_mm[0][pb1+pb2][ll2][ll3]+Nw_term; //BB,EE
w->coupling_matrix_unbinned[4*ll2+0][4*ll3+0]=fac*c->xi_pp[0][pe1+pe2][ll2][ll3]+Nw_term; //EE,EE
w->coupling_matrix_unbinned[4*ll2+1][4*ll3+1]=fac*c->xi_pp[0][pe1+pb2][ll2][ll3]+Nw_term; //EB,EB
Expand All @@ -877,8 +882,8 @@ nmt_workspace *nmt_compute_coupling_matrix(int spin1,int spin2,
}
if(w->ncls==7) {
w->coupling_matrix_unbinned[7*ll2+0][7*ll3+0]=fac*c->xi_00[0][ll2][ll3]+Nw_term; //TT,TT
w->coupling_matrix_unbinned[7*ll2+1][7*ll3+1]=fac*c->xi_0s[0][pe2][ll2][ll3]+Nw_term; //TE,TE
w->coupling_matrix_unbinned[7*ll2+2][7*ll3+2]=fac*c->xi_0s[0][pb2][ll2][ll3]+Nw_term; //TB,TB
w->coupling_matrix_unbinned[7*ll2+1][7*ll3+1]=fac*c->xi_0s[0][pe2][ll2][ll3]; //TE,TE
w->coupling_matrix_unbinned[7*ll2+2][7*ll3+2]=fac*c->xi_0s[0][pb2][ll2][ll3]; //TB,TB
w->coupling_matrix_unbinned[7*ll2+3][7*ll3+6]=fac*c->xi_mm[0][pe2+pe2][ll2][ll3]+Nw_term; //EE,BB
w->coupling_matrix_unbinned[7*ll2+4][7*ll3+5]=-fac*c->xi_mm[0][pe2+pb2][ll2][ll3]+Nw_term; //EB,BE
w->coupling_matrix_unbinned[7*ll2+5][7*ll3+4]=-fac*c->xi_mm[0][pb2+pe2][ll2][ll3]+Nw_term; //BE,EB
Expand Down

0 comments on commit c99fc55

Please sign in to comment.