litebird / litebird_sim

Simulation tools for LiteBIRD
GNU General Public License v3.0
18 stars 13 forks source link

Implement a Python-only destriper #260

Closed ziotom78 closed 1 year ago

ziotom78 commented 1 year ago

This PR implements a very simple destriper for the framework.

Here is the main highlights:

Pain points:

Stuff to do:

ziotom78 commented 1 year ago

From my point of view, this PR is ready to be reviewed. It introduces a number of breaking changes:

Finally, the problems I reported about a strange increase of power at high multipoles has been solved. It was due to an incorrect iteration over the detectors, such that all the detectors shared the same values for the baselines. With this bug fixed, the results of the new destriper agree quite well with TOAST2:

TT spectra

EE spectra

BB spectra

ziotom78 commented 1 year ago

After a call with @paganol , I have implemented the following additional changes:

Finally, I checked that when make_destriped_map is called while setting DestriperParameters.samples_per_baseline to None, it returns the very same map as the one produced by make_binned_map. (I only tested this in one case, but it was quite complex and I trust the result.) The same applies to the field BinnerResult.invnpp, which matches DestriperResult.nobs_matrix_cholesky.get_invnpp().

This means that in the future we might think about deprecating the current implementation for make_binned_map and rewrite it as a very tiny wrapper around make_destriped_map.

What's left is to check that the amount of memory used by make_destriped_map matches the expectations, then I believe we can merge this PR and release version 0.11.0.

marcobortolami commented 1 year ago

Hi:) just to let you know, I'm also reviewing the code:) I don't know if it can be seen, I'm using the GitHub review tool for the first time, I'm waiting to check all the files before submitting it, so my review is still "Pending". Anyway, I fully agree to the changes that came out after your call with Luca:)

marcobortolami commented 1 year ago

Thanks for your quick fixes:) for me this is ready to be merged!

paganol commented 1 year ago

Hi there. Thanks a lot!! You can merge for me, as well.

ziotom78 commented 1 year ago

Thank you all, especially @marcobortolami : your review was comprehensive and perfect!