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

Add miscentering to the theory module #588

Open
combet opened this issue Apr 5, 2023 · 3 comments · May be fixed by #622
Open

Add miscentering to the theory module #588

combet opened this issue Apr 5, 2023 · 3 comments · May be fixed by #622
Assignees

Comments

@combet
Copy link
Collaborator

combet commented Apr 5, 2023

Miscentered profiles (single cluster or stacked) should be added to the theory module. See e.g. the cluster-toolkit documentation.

  • for a single cluster --> new R_mis parameter to quantify the miscentering + 2 integrations
  • for a stack --> needs extra integration over a miscentering distribution

Is it better to create new 'miscentered' functions or have extra keywords to the existing ones? What precision are we happy to live with. If sticking with scipy.integrate, we'll have to sacrifice a bit accuracy for speed I believe...

@combet combet self-assigned this Apr 5, 2023
@combet
Copy link
Collaborator Author

combet commented May 26, 2023

Just pushed initial notebook that explores the set of integrals that need to be computed.

@hsinfan1996
Copy link
Collaborator

hsinfan1996 commented Jun 29, 2023

I made some optimization to the integrals and explored the possibilities of using different profiles and the CCL backend. The results on DeltaSigma_mis calculation are summarized here.

implementation/profile NFW EIN HER
backend independent 2 sec 3 min 2 sec
implementation/profile CCL NFW CCL EIN CCL HER NC NFW NC EIN NC HER CT NFW
optimized 40 sec 15 min^ 40 sec 20 sec 10 sec 15 sec 1 min
original 20 min X 7 min 7 min 4 min 7 min 30 min

X = (possibly) won't finish
^ Use CCL PR 1093 (Merged into master as CCL v2.8.1.dev73+g86125b08)

  1. Backend independent implementation means we do not rely on the backends to calculate the surface mass densities.
  2. Relaxing epsrel of quad_vec to 1e-6 will make the miscentering integrations work for the Hernquist profile (The default value is 1e-8) without compromising the precision of the profile.
  3. backend independent EIN can potentially be faster by correctly setting up quad_vec to use multiprocessing.

@combet combet linked a pull request May 8, 2024 that will close this issue
@AnnaNiemiec
Copy link
Collaborator

I have added an option to compute Sigma mean miscentered with dblquad instead of two nested quads. Testing this on the demo_theory_functionality_oo.ipynb notebook, it seems to increase the speed x2.
However, the two variants (simple quads and dblquad) appear much slower in this notebook, as compared to the explore_miscentering_theory.ipynb notebook.
For an NFW profile, I obtain the following times :

  • explore_miscentering_theory.ipynb :
    backend independant : 2s
    backend independant + dblquad : 0.3s

  • demo_theory_functionality_oo.ipynb :
    backend independant : 12s
    backend independant + dblquad : 5s

Not sure what is causing this difference

@combet combet linked a pull request Jul 17, 2024 that will close this issue
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 a pull request may close this issue.

3 participants