lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
230 stars 285 forks source link

Cross-correlations between the different galaxy number count contributions #455

Open ktanidis opened 2 years ago

ktanidis commented 2 years ago

Hi,

I was wondering if it is possible to calculate the cross-correlation between the different contributions in the galaxy number count spectra. For example to do all the permutations between density and rsd which are : dens[i]-rsd[j], dens[j]-rsd[i]. For the moment I see that all the contributions (density, rsd, lensing, gr) are included for the number counts simultaneously but to see their cross-correlations is not an option.

lesgourg commented 2 years ago

Hi @ktanidis, as far as I remember, you should get all these cross-correlations. Maybe you have 'non_diagonal=1'. You can try with 'non_diagonal' set to your actual number of bins, and I would expect that you will get all the possible cross-correlations.

ktanidis commented 2 years ago

Hi @lesgourg , and thank you for your quick reply. Yes I am aware of this option. But I guess that this gives you the full information which is (dens+rsd)[i]-(dens+rsd)[j] that is symmetric and is expected to be the same with (dens+rsd)[j]-(dens+rsd)[i]. I was wondering if it is possible to take not the full signal but only their cross-correlation which means den and rsd separately and not together for each bin, meaning den[i]-rsd[j] which is different than den[j]-rsd[i]. What I mean is similar to the existing option in class for cross-correlation between nCl and sCl but declaring now a list to do cross-correlation of nCl (den only) with nCl (rsd only)

lesgourg commented 2 years ago

OK I see the point. Indeed I am afraid that this is not implemented. You could give it a try, it should not be that difficult. It should only amount in a modification of transfer.c to store each contribution (den, rsd, etc.) separately instead of summing over them, plus small modifications in harmonic.c to compute additional cross-correlation. Let me know if this sounds like too hard and you would need help. Actually, every before that, you could look at another early implementation of this physics in CLASSgal, https://cosmology.unige.ch/content/classgal . I forgot whether in that eversion we had the cross-correlations, but it could be.

ktanidis commented 2 years ago

Thank you for your suggestions @lesgourg . I have had a look at CLASSgal and this feature is not included in there either. I was thinking indeed to modify the code as you proposed, or to do another workaround if it would require fewer modifications in the code. The other option would be to declare my own arbitrary number of bins with redshift (where I could choose where to calculate 'den' or 'rsd' only) inside the file "dNdz_selection =" which would now be a list of columns z,n1,n2,n3,... . I currently see the only choice is to convolve the "dNdz_selection =" which is now only z and an overall nz with the bins defined by selection=,selection_mean=,selection_width=. Is there a developer version that has this feature?

lesgourg commented 2 years ago

Indeed, the second option would be doable too. You would still have to code it yourself, we did not do any attempt in this direction. This extended functionality might be something we want in the public version. I would not have time to develop this myself but I'd be happy to help and consider integrating it in the public version. It still sounds to me like the first option makes more sense, because in a given redshift bin, your "den only", "red only", etc., should always have the same window/selection function, right? So, if you provide a file with columns z,n1,n2,n3,..., you would always provide to the code some redundant information, in the sense that the n1, n2 and n3 would have identical patterns, just shifted with respect to each other?