fix psi computation in ecliptic->galactic pointing rotation#543
Draft
mj-gomes wants to merge 1 commit into
Draft
fix psi computation in ecliptic->galactic pointing rotation#543mj-gomes wants to merge 1 commit into
mj-gomes wants to merge 1 commit into
Conversation
Contributor
Author
|
The error in the map_scanning documentation seems reasonable due to the changes, but the one in beam_convolution (https://github.com/litebird/litebird_sim/actions/runs/29433612982/job/87414564734?pr=543#step:7:115) looks a bit strange. Namely due to the big difference in the previously expected output TOD and the one we get now: Can someone with more expertise than me in beam convolution (@paganol ?) see if this is expected with the change in psi calculation, or if there is something still wrong ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
This PR fixes the error that I found recently and that I briefly mentioned in #542.
I noticed that scanning a map with a non ideal HWP resulted in bizarre output maps (which looked like some weird angle rotation was happening somewhere) compared to when doing the scanning in ecliptic coordinates.
I (+ Eric, + one LLM) managed to find the bug. Currently, when we convert pointings from ecliptic to galactic coordinates, we are only rotating the orientation angle psi considering the rotation of the north pole, and ignoring the fact that the whole reference frame changes (the definition of both north and east directions), and since psi is defined between the north and east directions, the rotation of psi was incorrect.
The reason to why this only showed up when the hwp was non ideal is unclear, but it can come from the fact that systematic effects rotate with psi independently of the hwp rotation angle (rho), while for an ideal hwp, the rotation is always (rho-psi), which perhaps cancels out the effects from an incorrect psi.
Now, for each sample, we first obtain the north and east directions in the ecliptic frame with theta and phi, then we get the orientation vector in this basis, and we rotate both the basis and the vector, and then we obtain psi in galactic coordinates doing the inverse operation from vector to angle in the new reference frame.
I am now getting the same output maps using galactic or ecliptic coordinates.
EDIT: apparently we have to change the expected outputs for some examples in the docs, I'll do that tomorrow.