Closed 1cosmologist closed 4 months ago
@carronj what do you think? As we are discussing this, why don't we generate the noise maps on the fly?
The nside of the CMB maps now comes as given from the s4 instrument model. But there is no problem at all to adapt the code to request any different nside and I can do that soon. For some unclear reason I did not do that for the noise maps. Yes in principle could be built on the fly. I guess I will sweat a lot handling the generator state because of potential issues with reproducibilty , but you probably point me to a super safe way to do that ? If so, I could produce as default to 4096 (not clear we will ever need that) as specified and ud_grade to anything else.
@carronj If our lensed CMB has lmax
of 4096, I do not think if need to go higher than NSIDE=2048
.
Correct me if I am wrong but the random numbers for chwide noise maps are being seeded by SeedSequence state entropy and not seeded from a key. Since the different frequency bands share the same rng, the order in which the maps are generated would matter. For on-the-fly noise generation, the order in which maps are queried would matter. I usually spawn child sequences one for each frequency to avoid this. The lmax
or npix
change can also change the results.
Let's keep nside 2048 then. I cant see the need for higher as of now since this should easily capture all the lensing signal.
Looks like to me that if we want the user to be able to ask for any sim we must set the seed for each and every sim beforehand in a deterministic fashion ?
Or we need a deterministic way of producing the seeds for each sim for each channel. If we constrain ourselves to only generate sims starting from Monte Carlo index 0 and not query a particular mc index, we can spawn child streams from one initial seed passed to SeedSequence.
There is no well defined prescription to incorporate the MC index other than say adding the MC index to the child seed sequence. JAX random has a method to do this deterministically (jax.random.fold_in
). But numpy random doesn't seem to have any such feature.
@carronj @1cosmologist what happened with this issue?
The original issue of having maps at NISDE=2048
has been fixed. But the question that @carronj asked in https://github.com/litebird/litebirdXS4/issues/13#issuecomment-1969834156 has not been resolved, I think.
Okay, if either of you thinks that the question is still relevant, please open a separate issue
going to close this one
Currently
maps.get_s4_map
fetches CMB-S4 LAT CMB-only maps atNSIDE=4096
. The noise maps are atNSIDE=2048
, while the lensed CMB is computed tilllmax=4096
. So we do not need to fetch the CMB-only LAT maps atNSIDE=4096
and increase compute time for each iteration to produce coadded maps. Can we switch to a default ofNSIDE=2048
for the LATs?