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

Discrepancy between d12 and color corrected HFI353 #128

Closed erussier closed 1 year ago

erussier commented 1 year ago

Hello, I plotted the PySM d12 dust power spectra and compared to the HFI353GHz. There seems to be an offset at large scales that we do not find when comparing the MKD map (without color correction) from here (https://apc.u-paris.fr/Downloads/Planck/PSM-Data/MKD-MODEL-PySM-2048/skyinbands/HFI/detector_F353/) and the HFI353GHz without color correction. This is what I get for Emodes and Bmodes. download download In principle, the PSM MKD and HFI353 without color correction should be compatible and d12 and color corrected HFI353 should also be compatible at least on the largest scales. Here is the jupyter notebook where I did this comparison: comp_dust_PS_d12_MKD_map.ipynb

zonca commented 1 year ago

thanks @erussier, can you please repeat the test at Nside 2048 and update the notebook?

zonca commented 1 year ago

also to test the implementation I am comparing with this reference notebook with a simple analysis ran at Nside 8: https://gist.github.com/brandonshensley/1dda561b245cda6497eb1b5ce2b7c267

can you check there if you find any errors?

zonca commented 1 year ago

@erussier can you please adapt the notebook to run at NSIDE 2048 instead of 512? In the notebook, when you write outputs, can you write to a local folder (`"./output") so the notebook can be executed by other people more easily? Don't worry about the other thing I suggested.

erussier commented 1 year ago

Hi @zonca, I ran the notebook at NSIDE 2048 except for the MKD map since the native NSIDE of the MKD map I have is 512. So if you want to run this notebook at NSIDE 2048, please change the NSIDE in the section "Plot map of Planck MKD model" and the path to the MKD map. Here it is: https://gist.github.com/erussier/89b656bba5c65331b5764d39754b7d38

zonca commented 1 year ago

the MKD is the most important map to have at 2048, @delabrou ran the MKD model at Nside 2048, those are the maps that I am using as inputs to PySM. I think the easiest for comparison would be to have MKD at Nside 2048 at 353GHz include all layers computed using those Nside 2048 templates and compare it directly to the output of PySM 3, the maps should be identical.

erussier commented 1 year ago

Hi @zonca, I found the MKD map at NSIDE = 2048 and indeed we get the same results between the MKD model at 353 GHz and d12. I guess we can close this issue.
image

image

zonca commented 1 year ago

Good news! Thanks

erussier commented 1 year ago

In fact, the mkd map I was using at NSIDE 2048 and used in the PySM pipeline, was generated without the color correction implemented. We need to multiply the mkd map by 0.92 to take into account the color correction. Probably the best thing to do is to change the input maps. @delabrou will generate new maps to use as inputs for PySM.

zonca commented 1 year ago

Sure, I can then replace the inputs

zonca commented 1 year ago

@erussier any news on the new maps?

zonca commented 1 year ago

@erussier @delabru what if I just apply the 0.911 factor (see https://github.com/galsci/pysm/issues/99#issue-1068953759) inside PySM?

erussier commented 1 year ago

Sorry for the late reply, we think that is okay to apply the 0.911 factor inside PySM, thank you.

zonca commented 1 year ago

@erussier @delabru ok, I implemented it in:

https://github.com/galsci/pysm/pull/141

can you please confirm that I just multiply the IQU template, I don't change anything in the spectral index map and the black body temperature?

delabrou commented 1 year ago

Yes, I confirm. You multiply all IQU templates by the colour correction factor (in the PSM I use 0.92).

delabrou commented 1 year ago

Do not do anything to the temperature and spectral index maps.