Closed giuspugl closed 3 years ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
I combined the I dust map from 2nd Planck release as it has been optimized to better remove CIB. As QU maps i 've used the maps from 3rd Planck release .
We then transform the maps to Pol.tens. formalism. I then estimated spectral indices for the fit performing the fit in several ell ranges.
Smaller scales are injected similarly as in #72 and we see the combined map shows good match .
View / edit / reply to this conversation on ReviewNB
zonca commented on 2021-05-11T00:59:48Z ----------------------------------------------------------------
Jacques suggested to use the apodized mask, I was using the 2 degrees mask from planck in the last version of my notebook https://nbviewer.jupyter.org/gist/zonca/b398f85f701088ba60e3e66a20e0f48f.
Unless we are reason to believe the non apodized mask is better.
giuspugl commented on 2021-05-11T21:31:08Z ----------------------------------------------------------------
Ok will do that, though not expecting large differences from this .
View / edit / reply to this conversation on ReviewNB
zonca commented on 2021-05-11T00:59:49Z ----------------------------------------------------------------
as we discussed, another option is to use the unires
version for fitting, the worry is that the variable resolution could have extra signal at small scales coming from some regions of the sky. I think it would be nice to have 2 versions of the notebook to compare the spectra.
giuspugl commented on 2021-05-11T21:32:03Z ----------------------------------------------------------------
Yeah, I did also that case, will include a new notebook with the unires
version
View / edit / reply to this conversation on ReviewNB
zonca commented on 2021-05-11T00:59:49Z ----------------------------------------------------------------
what about just removing the value from the Planck paper? does it give NaNs?
It probably makes more sense to adjust the monopole before transforming to poltens.
giuspugl commented on 2021-05-11T22:46:37Z ----------------------------------------------------------------
If we subtract the value reported by Planck the NaNs reduce to 149 pixels, think we should be fine
View / edit / reply to this conversation on ReviewNB
zonca commented on 2021-05-11T00:59:50Z ----------------------------------------------------------------
I think it is useful to compare with anafast
but we should deconvolve the mask with polspice
or namaster
giuspugl commented on 2021-05-11T21:36:32Z ----------------------------------------------------------------
I agree with you, the results shown in the plots are obtained with namaster
, sorry for the confusion
View / edit / reply to this conversation on ReviewNB
zonca commented on 2021-05-11T00:59:51Z ----------------------------------------------------------------
how are those spectra computed? by a previous run?
it would be useful to make an if
statement. If the npz
is available, load it, otherwise compute it and save it.
giuspugl commented on 2021-05-11T21:37:41Z ----------------------------------------------------------------
they are computed with namaster, but unfortunately i can't run namaster on jupyter notebook , so have to run it on an interactive node .
View / edit / reply to this conversation on ReviewNB
zonca commented on 2021-05-11T00:59:51Z ----------------------------------------------------------------
In the last version of #72 I reduced those ell ranges, I think they are too high here, we are doing the fit where the effect of the beam is very large.
giuspugl commented on 2021-05-11T21:40:07Z ----------------------------------------------------------------
ok will perform a fit at lower ells
thanks Giuseppe! I added a few comments, but better also double-check my suggestions with someone more expert in this kind of analysis!
Ok will do that, though not expecting large differences from this .
View entire conversation on ReviewNB
Yeah, I did also that case, will include a new notebook with the unires
version
View entire conversation on ReviewNB
I agree with you, the results shown in the plots are obtained with namaster
, sorry for the confusion
View entire conversation on ReviewNB
they are computed with namaster, but unfortunately i can't run namaster on jupyter notebook , so have to run it on an interactive node .
View entire conversation on ReviewNB
If we subtract the value reported by Planck we don't have the NaNs . So will use that value and remove the monopole before hand
View entire conversation on ReviewNB
The argument against the unires maps is that treatment of polarization systematics in Planck evolved from the 2015 to the 2018 release. I wonder if that accounts for the qualitative differences we are seeing? Rather than use the unires QU maps, it may be worth investigating the NPIPE raw 353 GHz QU maps instead.
I addressed most of @zonca comments on the notebooks, in particular :
varres
maps with the GAL080
mask apodized with 2 degree radius notice in particular the light green line ( with large scale only) and the orange line encoding spectra with gaussian small scales injected . Finally, I transformed back the maps into real quantities and got reasonable power spectra (mild decrease in power in TT at ell>600)
gonna clean up a bit the notebook and commit it to this PR.
The argument against the unires maps is that treatment of polarization systematics in Planck evolved from the 2015 to the 2018 release. I wonder if that accounts for the qualitative differences we are seeing? Rather than use the unires QU maps, it may be worth investigating the NPIPE raw 353 GHz QU maps instead.
discussed with @keskitalo and we agreed that this is something that can be surely done, although we have to deal with synchrotron and CMB residuals when using the NPIPE maps as those haven't been processed with component separation.
If everything is working for varres--and I think it looks really good!--no need to go to the NPIPE maps. Relieved to see those -0.5 spectra!
Notebook with varres
maps available at
https://gist.github.com/giuspugl/4fb30306e99dfed4a193c80fe9c3c94a
View / edit / reply to this conversation on ReviewNB
zonca commented on 2021-05-13T18:39:05Z ----------------------------------------------------------------
I think we want to keep the mask apodized, that should provide better behavior in namaster
giuspugl commented on 2021-05-13T18:48:09Z ----------------------------------------------------------------
Yes sorry if that wasn't clear, when running namaster always the mask is apodized.
View / edit / reply to this conversation on ReviewNB
zonca commented on 2021-05-13T18:39:06Z ----------------------------------------------------------------
Just for temperature, we should probably multiply the small scales by a map of the intensity heavily smoothed, maybe 3 degrees? And normalized, I think we need to adjust the normalization so that the spectra look reasonable (have no sharp boundaries or other anomalous features) both when we take spectra on the masked sky and on the full sky.
View / edit / reply to this conversation on ReviewNB
zonca commented on 2021-05-13T18:39:07Z ----------------------------------------------------------------
it is really strange this big loss of power, is it possible that the small scales were lost in the processing?
Maybe overplotting just the small scales both in logpoltens and TT can help understand what is going on.
thanks @giuspugl! great progress, I am worried that the loss of power in TT (IQU) compared to Poltens could be caused by a bug somewhere.
Yes sorry if that wasn't clear, when running namaster always the mask is apodized.
View entire conversation on ReviewNB
Agreed, looking great @giuspugl ! Re: loss of power in TT: is there also a small knee in BB at the same ell?
I've dug a bit into the mismatch we discussed last week, see the gist https://gist.github.com/giuspugl/4fb30306e99dfed4a193c80fe9c3c94a I am finding that the reason for the mismatch is mostly driven by the fact that the i map with large scales in the logpol tensor formalism shows the largest contribution when we transform back to IQU maps. I think we are hitting a limitation of this proposed formalism proposed, although i 'd like to stress that a by-product of this formalism is that the smaller scales even if simulated uniformly they present a modulation by the larger scales of the intensity maps.
If we simply let i = ln(I) does everything look ok, or are there other problems that fix doesn't address?
There is undoubtedly a nicer way to share this, but I've put together a little proof of concept here: https://www.dropbox.com/s/zl64y70bsouco99/polfractens.ipynb?dl=0
Given that this looks reasonable, the current thought is that there is a bug in the code joining the small and large scales in alm-space. Stay tuned.
The tests performed with @brandonshensley are converging to the fact that using a map with variable resolution (e.g. Planck 2015 I map) can be the reason why we see a knee in the power spectra of real quantities as stated above by @seclark.
To further simplify the test we therefore proceeded by considering the Planck 2018 unires
map which has the downside of being coarser in terms of resolution , 80' , and of being less optimized in the removal of the CIB but as a pro it has the same resolution in each region of the sky.
We repeated the same procedure as outlined above and we restricted in particular to the case with P=0
, i.e. i = log( I )
The procedure so far i used :
i = log(I)
i
mapss
map
ls= Alm2map(almxfl(i,sigmoid))
ls
and ss
in step 5 but we can't combine ss
and ls
together as the two maps are estimated on different domains, the former estimated by fitting the spectra estimated with namaster and the other estimated from pseudo -alm . We fix this issue by running 2., 3. and 4. on fullsky quantities (i.e. using anafast
) . We transform to the i
map and estimate the power spectrum with anafast
With a lower reso, we have to restrict our fitting range in ell=30-100 .The spectral index of the fitted power law is -1.58. A comparison on the map level of the maps with and without small scales injected by extrapolating the power law is shown below :
and the TT power spectrum estimated from the I' map (solid orange) , compared with the input I with 80' reso (solid blue). As you can see the spectra behave as expected. Notice that for the real quantities we can keep estimating the spectra with Namaster on the 80% of the sky.
We now want to inject a modulation of the small scales similarly to what was done in the PySM2, since so far the amplitude is uniform across the sky.
We therefore :
a. smoothed the same I map used above to 5 deg,
b. take the log10
,
c. saturate to 2 all the pixels whose log10
value is >2
.
d. Minmax rescale the map from 0.1 to 1 .
In this way we shrink the dynamic range where we expect the scales to be modulated by the dust intensity profile, A . Below the map produced following the steps from a-d .
Then we follow the steps from 1-5 and just changed the definition in 5. as : I’ = exp(ls +( A*ss ))
below you can see a direct comparison of the maps produced with the modulation defined above for a region at ~intermediate Gal. latitudes (same area as the one shown above)
Notice how the small scales now are dimmer in the vicinity of low intensity regions and viceversa.
Finally, we want to check whether this modulation affects the power spectrum.
the anafast power spectrum obtained from the logarithmic map (shown in solid orange) do not seem to be affected by the modulation ( compared with the input i map spectrum shown in solid blue) .
As well as the TT power spectrum estimated from the I' map (solid orange) , compared with the input I with 80' reso (solid blue).
unires
both for IQU maps, given the fact that we don't see the inconsistency observed in TT spectra when varres
maps are chosen. This sounds really promising @giuspugl! Glad to hear that the tests are converging. From a conversation with @brandonshensley, I am curious now what the histogram of the polarization fraction looks like after the addition of small scales
With the last commit , we show reasonable results in injecting small scales in the poltens formalism on the dust emission.
in this way, we make our modeling of smaller angular scale to fully benefit of the currently available data sets, where Intensity maps have been assessed at good high SNR at smaller resolutions than polarization ones. We summarize the preprocessing steps as it follows:
thanks @giuspugl
do you think this is completed? should I start turning this into production code to be merged into PySM3? Or better first produce IQU maps to be shared with the Panex group for further analysis?
We decided that we 're ready to port it into PySM3, please let me know if I can be of any help on this!
very good! I'll start to work on this and keep you posted.
@giuspugl should I use the gnilc_gaussian_scales.ipynb
notebook inside this pull request or expansion_logpoltens.ipynb
in the Gist?
@giuspugl can you please make /global/cscratch1/sd/giuspugl/workstation/FG_extension/extending_gnilc_dust/ readable so I can compare results?
Sure, i made a new directory
/global/cscratch1/sd/giuspugl/workstation/FG_extension/extending_gnilc_dust
you 'd be able to access .
continues in #82
I 've identified several issues in https://github.com/healpy/pysm/pull/72 that can lead into errors in the estimates.
I am using exactly the same routines and the same inputs used in https://github.com/healpy/pysm/pull/72 to further debug the procedure, the main difference is that i perform the estimates on GAL060 mask, instead of GAL080 ( in https://github.com/healpy/pysm/pull/72 )
Think a source of error can be related to the monopole subtraction :
Monopole subtraction
Estimate the monopole term from the map outside the galactic mask to have a rough estimate of the CIB monopole . However, I don't perform the monopole subtraction before injecting small scales but once the maps with Large and small scales are coadded together .
In fact, I noticed that:
Estimating the monopole at high Gal. latitudes (excluding the Gal. plane) leads to ~0.16 MJy/srad , which is very closed to the value reported by Section 2.2 of Planck 2018 XII value reported: 0.13 MJy/sr .