Skip to content

Commit e9ea0bb

Browse files
author
NiekWielders
committed
added convergence layer from grid
1 parent b414865 commit e9ea0bb

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

  • autogalaxy/profiles/mass/abstract

autogalaxy/profiles/mass/abstract/mge.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,31 @@ def zeta_from(self, grid: aa.type.Grid2DLike, sigma_log_list, xp=np):
286286

287287
return xp.where(ind_pos_y[None, :], core, xp.conj(core))
288288

289+
@aa.over_sample
290+
@aa.grid_dec.to_array
291+
@aa.grid_dec.transform
292+
def convergence_2d_via_mge_from(
293+
self, grid: aa.type.Grid2DLike, xp=np, *,
294+
sigma_log_list, three_D: bool, func_terms: int = 28, **kwargs,
295+
):
296+
"""
297+
Calculate the projected convergence at a given set of arc-second gridded coordinates.
298+
299+
Parameters
300+
----------
301+
grid
302+
The grid of (y,x) arc-second coordinates the convergence is computed on.
303+
304+
"""
305+
306+
eccentric_radii = self.mass_profile.eccentric_radii_grid_from(grid=grid, xp=xp, **kwargs)
307+
308+
return self._convergence_2d_via_mge_from(grid_radii=eccentric_radii, xp=xp, sigma_log_list=sigma_log_list,
309+
three_D=three_D, func_terms=func_terms
310+
)
311+
289312

290-
def convergence_2d_via_mge_from(self, grid_radii, xp=np, *, sigma_log_list, three_D: bool,
313+
def _convergence_2d_via_mge_from(self, grid_radii, xp=np, *, sigma_log_list, three_D: bool,
291314
func_terms: int = 28, **kwargs):
292315
"""Calculate the projected convergence at a given set of arc-second gridded coordinates.
293316
@@ -306,7 +329,6 @@ def convergence_2d_via_mge_from(self, grid_radii, xp=np, *, sigma_log_list, thre
306329
sigmas = xp.asarray(sigmas)[:, None]
307330
amps = xp.asarray(amps)[:, None]
308331

309-
grid_radii = grid_radii
310332
grid_radii = grid_radii[None, ...]
311333

312334
convergence = xp.sum(

0 commit comments

Comments
 (0)