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

A_mod suppression of non-linear power #142

Merged
merged 6 commits into from
Oct 31, 2024
Merged

Conversation

ajouellette
Copy link
Contributor

This is a very simple module to sample the phenomenological parameter A_mod from Amon & Efstathiou 2022.

Copy link
Owner

@joezuntz joezuntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this! I have three pretty minor requests for changes and then I'd love to merge it.

purpose: Modify the non-linear matter power spectrum using the A_mod phenomenological parameterization
url: ""
interface: amod.py
attribution: []
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this contribution! You should definitely give yourself credit by adding your name to the attribution list!

"

# List of parameters that can go in the params.ini file in the section for this module
params:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block should be replaced with:

params: {}

A_mod = block["amod_parameter", "a_mod"]

# for now assume pk_lin and pk_nonlin are defined on the same grids
assert (block["matter_power_lin", "z"] == block["matter_power_nl", "z"]).all()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you replace these with this, just to give some more info to the user:

z_same = np.allclose(block["matter_power_lin", "z"], block["matter_power_nl", "z"])
k_same = np.allclose(block["matter_power_lin", "k_h"], block["matter_power_nl", "k_h"])
if not k_same and z_same:
    raise ValueError("The redshift and k sampling of the linear and non-linear matter power must be the same to use the amod module")

@ajouellette
Copy link
Contributor Author

Cool! I just added the suggested changes.

@joezuntz joezuntz merged commit 70c5613 into joezuntz:main Oct 31, 2024
15 checks passed
@joezuntz
Copy link
Owner

Thanks so much!

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.

2 participants