Skip to content

Commit

Permalink
fixed normalisation for negative m modes in spherical harmonics
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlouden committed Oct 25, 2017
1 parent fcbe3c9 commit a26da43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c_src/brightness_maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,14 @@ double spherical(double lat, double lon, double *a, int therm_flag){
val = val + a[k]*norm*fx2*cos(m*phi);
}
else if (m < 0){
norm = pow(2.0*(2.0*l + 1.0)*factorial(l-m)/factorial(l+m),0.5);
norm = pow(2.0*(2.0*l + 1.0)*factorial(l-pow(pow(m,2),0.5))/factorial(l+pow(pow(m,2),0.5)),0.5);
val = val + a[k]*norm*fx2*sin(pow(pow(m,2),0.5)*phi);
}
else if (m == 0){
norm = pow((2.0*l + 1.0),0.5);
val = val + a[k]*norm*fx2;
}

// printf("%i m %i l %f val %f a[k] %f norm \n",m,l,val, a[k], norm);
// printf("%i %i %i %i %i\n",l-m,l+m,factorial(l-m), factorial(l+m),factorial(l-m)/factorial(l+m));

Expand Down

0 comments on commit a26da43

Please sign in to comment.