galsci / pysm

PySM 3: Sky emission simulations for Cosmic Microwave Background experiments
https://pysm3.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
33 stars 23 forks source link

Bugfix in 3.4.0b6 synchrotron small scale modulation #154

Closed zonca closed 1 year ago

zonca commented 1 year ago

Fixing bug discovered in https://github.com/galsci/pysm/issues/153

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

zonca commented 1 year ago

Comparison with @giuspugl's results

It looks good, consider they are different realizations of the small scales. edit, no they are the same realization, in fact the ratio agrees to about to machine precision of 1e-8 uK_RJ

image image image

Ratio

Scale is (1-1e-7, 1+1e-7)

image image image

zonca commented 1 year ago

when I generate instead the templates to a higher output ell, it is like using a different realization.

so, in order to simulate that case I run the same exact notebook that gives perfect agreement before with a different seed, I get relative differences of the order of 30% in Temperature and even higher in polarization. Spectra agree.

image

image

zonca commented 1 year ago

The production run, where I generate alms up to 16384, has the same level of disagreement:

image

giuspugl commented 1 year ago

Hi @zonca i 'd say it is consistent with my expectations. If we have higher lmax wrt the one set in my notebooks (ell=2000) then we'd see larger effects in the residuals.