@@ -233,14 +233,14 @@ def convergence_2d_via_cse_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs)
233233
234234 return self ._convergence_2d_via_cse_from (grid_radii = elliptical_radii )
235235
236- def convergence_func (self , grid_radius : float ) -> float :
237- return self .mass_to_light_ratio * self .image_2d_via_radii_from (grid_radius )
236+ def convergence_func (self , grid_radius : float , xp = np ) -> float :
237+ return self .mass_to_light_ratio * self .image_2d_via_radii_from (grid_radius , xp = xp )
238238
239239 @aa .grid_dec .to_array
240240 def potential_2d_from (self , grid : aa .type .Grid2DLike , xp = np , ** kwargs ):
241241 return np .zeros (shape = grid .shape [0 ])
242242
243- def image_2d_via_radii_from (self , radius : np .ndarray ):
243+ def image_2d_via_radii_from (self , radius : np .ndarray , xp = np ):
244244 """
245245 Returns the intensity of the profile at a given radius.
246246
@@ -249,14 +249,15 @@ def image_2d_via_radii_from(self, radius: np.ndarray):
249249 radius
250250 The distance from the centre of the profile.
251251 """
252- return self .intensity * np .exp (
252+ return self .intensity * xp .exp (
253253 - self .sersic_constant
254254 * (
255- ((radius . array / self .effective_radius ) ** (1.0 / self .sersic_index ))
255+ ((radius / self .effective_radius ) ** (1.0 / self .sersic_index ))
256256 - 1
257257 )
258258 )
259259
260+
260261 def decompose_convergence_via_mge (
261262 self , func_terms = 28 , func_gaussians = 20
262263 ) -> Tuple [List , List ]:
@@ -333,6 +334,7 @@ def sersic_2d(r):
333334 )
334335 )
335336
337+
336338 return self ._decompose_convergence_via_cse_from (
337339 func = sersic_2d ,
338340 radii_min = radii_min ,
0 commit comments