AdriJD / beamconv

Code library to simulate CMB detector data with realistic optics-related contributions
MIT License
10 stars 10 forks source link

small fix(?) to tools.shift_blm #9

Closed mreineck closed 2 years ago

mreineck commented 2 years ago

I think that the newly added code which enforces that the output blm are purely real for m=0 is only correct if eb==True. For eb==False the corresponding values of blmm2_new and blmp2_new only need to be complex conjugate, as far as I understand (but I might be completely wrong).

AdriJD commented 2 years ago

Hi Martin, sorry for the delay. I think you're right, thanks for spotting this. Setting m=0 to be real for the ±2 coefficients is not what we want. I must have been confused by the case where you use the shift function to construct a set of spin-0 coefficients from a pair of ±2 coefficients, e.g. blm = ((-2)bl(m+2) + (+2)bl(m-2)) / 2. You want bl0 to be real, but that works out regardless whether (±2)bl0 are real or not. So I should have not made this change.

I pushed a change that has the fix that you suggested, but also updates the tests to reflect this change. So I'll close this pull request but the change you suggested is now in the main code.

mreineck commented 2 years ago

I pushed a change that has the fix that you suggested, but also updates the tests to reflect this change. So I'll close this pull request but the change you suggested is now in the main code.

Perfect, thanks!