Cosmoglobe / Commander

Commander is an Optimal Monte-carlo Markov chAiN Driven EstimatoR which implements fast and efficient end-to-end CMB posterior exploration through Gibbs sampling.
GNU General Public License v3.0
20 stars 14 forks source link

input map with (unphysically) high polarisation quadrupole (or dipole) not recovered in runs #107

Closed lukashergt closed 2 years ago

lukashergt commented 3 years ago

Disclaimer: This issue came up during the component separation course AST9240 (so all this is based on that corresponding branch). Keep in mind that I am completely new to component separation and commander, so I might not be as precise in formulating this as I'd like to be... Nonetheless, I thought it might be good to summarize what I've been doing for our future selves.

The issue

I've stumbled over the issue that for an input map with a high (unphysical) polarisation dipole or similarly for a high polarisation quadrupole we don't recover the input map.

In the next few postings I'll document what modifications I've done and how they affected this issue.

Current situation
(AST9240_2021_sim branch)

The below plots are from a run where the dipole map was added to all CMB maps (i.e. I, Q, and U) instead of just to the CMB I map.

high pol dipole input, not same output

 

high pol dipole input, ncorr output

 

high pol dipole input, gain output

lukashergt commented 3 years ago

Modified branch v1:
no gain sampling, ncorr=0, correct_sl=false

The issue persists even when turning off gain sampling and when setting the correlated noise to zero. Note the reduced amplitude range when going from sample 0 (the input) to sample 1.

 

high dipole

high pol dipole input, not same output, despite gain, sl, and ncorr turned off

 

high quadrupole

(when plotting the quadrupole we need to smooth the map to see how the amplitude range drops)

high pol quadrupole input, not same output, despite gain, sl, and ncorr turned off

 

verifying constant gain and zero ncorr for both cases (high dipole or quadrupole)

ncorr map when ncorr set to zero

gain when no gain sampling

lukashergt commented 3 years ago

Modified branch v2:
remove cmb_pol=.false. when enable_tod_simulations

(still: no gain sampling, ncorr=0, correct_sl=false)

Here, I have modified the call to get_sky_signal in commander.f90 conditional on whether it is a simulation run (enable_tod_simulations is true) or whether it is a sampling run (enable_tod_simulations is false). For simulation runs I no longer pass cmb_pol:

-             !call get_sky_signal(i, j, s_sky(j,k)%p, mono=.false.)
-             call get_sky_signal(i, j, s_sky(j,k)%p, mono=.false., cmb_pol=.false.)
+             if (cpar%enable_tod_simulations) then
+                 call get_sky_signal(i, j, s_sky(j,k)%p, mono=.false.)
+             else
+                 call get_sky_signal(i, j, s_sky(j,k)%p, mono=.false., cmb_pol=.false.)
+             end if

Note, how now we roughly recover the input signal (after smoothing) and how the amplitude range is roughly the same (whereas previously it was significantly reduced in the samples).

high pol quadrupole input recovered with gain, sl, and ncorr turned off

lukashergt commented 3 years ago

Modified branch v3:
re-introduce ncorr

(still: no gain sampling and correct_sl=false and cmb_pol=.false. removed for sims)

Upon re-introducing the correlated noise sampling, a lot of the signal is pushed into the ncorr maps and the signal in the CMB maps is again reduced.

ncorr no longer turned off

 

ncorr map

lukashergt commented 3 years ago

Modified branch v4:
always remove cmb_pol=.false.

Now we always remove cmb_pol from get_sky_signal, not only when running simulations:

-             !call get_sky_signal(i, j, s_sky(j,k)%p, mono=.false.)
-             call get_sky_signal(i, j, s_sky(j,k)%p, mono=.false., cmb_pol=.false.)
+             call get_sky_signal(i, j, s_sky(j,k)%p, mono=.false.)
+             !call get_sky_signal(i, j, s_sky(j,k)%p, mono=.false., cmb_pol=.false.)

This lets us recover the CMB signal again, and reduces the leakage of signal into the correlated noise.

cmb maps

 

ncorr map

unfunfunt commented 2 years ago

This was fixed for BP10