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

Fix massdef in miscentering calculations and virial delta_mdef #662

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

hsinfan1996
Copy link
Collaborator

No description provided.

@coveralls
Copy link

coveralls commented Feb 5, 2025

Coverage Status

coverage: 100.0%. remained the same
when pulling 8573b92 on issue/660/miscentering_massdef
into 047fed4 on main.

@combet
Copy link
Collaborator

combet commented Feb 6, 2025

Thank you @hsinfan1996 - this was super efficient :)

I confirm it behaves as expected for mean and critical now, but I just realised we still have a problem when mass_def=virial. In that case, I think Delta_vir is computed internally in the backend as a function of cosmology (i.e. it's not to the user to set a value for Delta).

However, when mis_from_backend=False, the code still uses user-defined self.delta_mdef which is not the right value for Delta_vir (unless the user computed it beforehand correctly).

So at the moment, having mis_from_backend=False and mass_def=virial does not behave as expected (mis_from_backend=True is alright of course, just much slower).

I see 2 options:

  • simply prevent the combination mis_from_backend=False and mass_def=virial, with a printout explanation that mis_from_backend=False is only valid for mean and critical mass definition.
  • implement a way to get Delta_vir from the backend and use that value when mass_def=virial.

Maybe option 1 is sufficient for the time being? What do you think @hsinfan1996?

@hsinfan1996
Copy link
Collaborator Author

hsinfan1996 commented Feb 6, 2025

I was thinking about virial massdef too. For the CCL backend, I can implement the function for getting Delta_vir right away. For NumCosmo, I think I know what function to use, but I will need some time to implement it. Hopefully, someone more familiar with NC can help me. So for now, I go for option 2.

@hsinfan1996
Copy link
Collaborator Author

hsinfan1996 commented Feb 7, 2025

@combet I added the functions that calculate Delta_vir to the supported backends (NC<=0.22 for now). However, since getting Delta_vir requires the redshift, which is different from other mass definitions, I am thinking what is the best way to set Delta_vir to the cluster or for it to be utilized by other functions. Any ideas? @m-aguena

@m-aguena m-aguena marked this pull request as draft February 7, 2025 15:49
@hsinfan1996 hsinfan1996 changed the title Fix massdef in miscentering calculations Fix massdef in miscentering calculations and virial delta_mdef Feb 8, 2025
@hsinfan1996 hsinfan1996 marked this pull request as ready for review February 10, 2025 03:20
@hsinfan1996
Copy link
Collaborator Author

To support virial massdef properly, all functions that call the relevant ones in generic.py have to get virial delta_mdef from the backends, so I added some functions to do the job.

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.

Bug in miscentering when mass def=critical and mis_from_backend=False
3 participants