LSSTDESC / CLMM

A Python library for performing galaxy cluster mass reconstruction from weak lensing observables
BSD 3-Clause "New" or "Revised" License
23 stars 18 forks source link

Add miscentering to the theory module #588

Open combet opened 1 year ago

combet commented 1 year ago

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

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 commented 1 year ago

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

hsinfan1996 commented 1 year ago

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.