Problem
NFW + m3 Multipole lensing model exhibits discontinuities in the convergence profile around r ≈ 1.
Example:
Context
Relevant code is at:
|
return torch.where(x > 1, f_pos, torch.where(x < 1, f_neg, torch.zeros_like(x))) |
Suggested Fix
Apply TNFW-style patch to smooth out these discontinuities with Taylor expansion.
|
return torch.where( |
|
x < 1 - 1e-2, |
|
torch.arccosh(1 / x_lt1) / (1.0 - x_lt1**2).sqrt(), |
|
torch.where( |
|
x > 1 + 1e-2, |
|
torch.arccos(1 / x_gt1) / (x_gt1**2 - 1.0).sqrt(), |
|
1 - 2 * (x - 1) / 3 + 7 * (x - 1) ** 2 / 15, # where: x == 1 |
|
), |
|
) |
Problem
NFW + m3 Multipole lensing model exhibits discontinuities in the convergence profile around r ≈ 1.
Example:
Context
Relevant code is at:
caustics/src/caustics/lenses/func/nfw.py
Line 141 in 683ca5a
Suggested Fix
Apply TNFW-style patch to smooth out these discontinuities with Taylor expansion.
caustics/src/caustics/lenses/func/tnfw.py
Lines 58 to 66 in 683ca5a