Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API(fields): support for generating biased tracer fields #138

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ntessore
Copy link
Collaborator

@ntessore ntessore commented Oct 20, 2023

This PR splits the interface for generating fields up so that it becomes possible to simulate multiple related fields, such as e.g. biased tracers.

The fundamental sampling of the Gaussian random field is done by the new generate_alms() generator, which returns the Gaussian alm for each shell. New functions alm_to_gaussian() and alm_to_lognormal() can transform these alm to the respective random fields. The mean and variance of the Gaussian random field are stored in alm.dtype.metadata, which helps in transforming the lognormal field without additional inputs being provided. The existing generate_gaussian() and generate_lognormal() are reimplemented in terms of the new functions.

For generating biased tracers specifically, there is a new function biased_cls() which will take cls and apply linear bias factors. For lognormal fields, these biased cls can be transformed to biased Gaussian gls with lognormal_gls() as usual. The new rescaled_alm() function can then be used to change the power spectrum of a sampled Gaussian alm from the unbiased to the biased gls.

Closes: #134
Closes: #131
Changed: The gaussian_gls() functions is now called discretized_cls() to better reflect its functionality.
Changed: The lognormal_gls() function no longer calls discretized_cls()/gaussian_gls() internally.
Added: A new generate_alms() generator for Gaussian alm.
Added: New functions alm_to_gaussian() and alm_to_lognormal() to transform Gaussian alm to the respective random fields.
Added: A new biased_cls() function to apply bias factors to a sequence of cls.
Added: A new rescaled_alm() function to change the power spectrum of a given alm array.

@ntessore
Copy link
Collaborator Author

A draft example of how the new functionality can be used is available here.

@ntessore ntessore changed the title ENH(fields): support for generating biased tracer fields API(fields): support for generating biased tracer fields Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate multiple related fields Rename gaussian_gls function to discretized_cls
1 participant