joezuntz / cosmosis-standard-library

11 stars 31 forks source link

Pass specific power spectra to project_2d.py #77

Closed andrejdvornik closed 1 year ago

andrejdvornik commented 1 year ago

Say for instance that one has a couple of different power spectra returned by halo model modules called matter_power_nl, galaxy_power,galaxy_matter_power with or without suffixes.

Is there a way to let project_2d.py know that for shear-shear projection it should use matter_power_nl (that is default and it works fine), for position-position it should usegalaxy_power, and so on?

From the documentation and code itself it seems that it is only accepting matter_power_nl (or matter_intrinsic_power, but no galaxy variation), even though it seems that it should be possible to specify what exactly to use (judging from the coded up classes for Power3D cases in the code.

Am I missing something that should be set in the config when specifying the n(z) and suffixes, or are the choices for using galaxy_power when calculating the Cell for clustering disabled by design?

joezuntz commented 1 year ago

Hi @andrejdvornik - this feature has been a little broken since the DES-Y3 analysis where we modified a great deal of code. The intention was for this to work, but it is disabled for now, since we moved to using LingalLingalSpectrum for linearly-biased clustering and NlgalNlgalSpectrum for non-linearly biased clustering (but which specifically uses fast-pt for the model).

I'll put together a fix for this now, it shouldn't take long.

andrejdvornik commented 1 year ago

Hi @joezuntz! Thank you for the answer! I did manage to get it to work with replacing the requested Power3D class, so if nothing else I can fork the module in my model. But looking forward for the fix!

Slightly related question. If one has a n(z) from a fits file, say containing 5 different tomographic bins, would it be possible to specify a different P(k) (say one has outputs in the form: galaxy_power_1, galaxy_power_2, etc.) for each tomographic bin? Before I dive in and try to implement this in this module, I thought I might ask first.

Workaround that I managed to get to work is to list list them separately, which requires to get 5 different n(z)s, but that also creates 5 different output Cells that one needs to manually combine together later.

joezuntz commented 1 year ago

Hi @andrejdvornik - I've had a look at your related question and made it possible too now, as part of the same change. You can see an example in the pull request demo 15:

https://github.com/joezuntz/cosmosis-standard-library/blob/71fdaed3b43b36d2efe1d04850490b02033e22f6/demos/demo15.ini#L102

The GenericClustering spectrum will get you the density C_ell from the galaxy_power 3D spectrum.

andrejdvornik commented 1 year ago

Oh nice! I will give it a test today and report back how it works! Thank you so much for this help!

andrejdvornik commented 1 year ago

Implemented with #78 and #81