Skip to content

Commit

Permalink
Merge pull request #209 from Jammy2211/feature/multipole_2
Browse files Browse the repository at this point in the history
feature/mutlipole_2
  • Loading branch information
Jammy2211 authored Nov 6, 2024
2 parents 405c8d5 + a5288cf commit 9013366
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions autogalaxy/profiles/mass/total/power_law_multipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def deflections_yx_2d_from(
* self.einstein_radius ** (self.slope - 1.0)
* radial_grid ** (2.0 - self.slope)
)
/ (self.m**2.0 - (3.0 - self.slope))
/ (self.m**2.0 - (3.0 - self.slope)**2.0)
* self.k_m
* np.cos(self.m * (polar_angle_grid - self.angle_m))
)
Expand All @@ -182,7 +182,7 @@ def deflections_yx_2d_from(
* self.einstein_radius ** (self.slope - 1.0)
* radial_grid ** (2.0 - self.slope)
)
/ (self.m**2.0 - (3.0 - self.slope))
/ (self.m**2.0 - (3.0 - self.slope)**2.0)
* self.k_m
* np.sin(self.m * (polar_angle_grid - self.angle_m))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def test__deflections_yx_2d_from():

deflections = mp.deflections_yx_2d_from(grid=ag.Grid2DIrregular([[1.0, 0.0]]))

assert deflections[0, 0] == pytest.approx(-0.036501212434, 1e-3)
assert deflections[0, 1] == pytest.approx(-0.04812739471, 1e-3)
assert deflections[0, 0] == pytest.approx(-0.036120991, 1e-3)
assert deflections[0, 1] == pytest.approx(-0.0476260676, 1e-3)

mp = ag.mp.PowerLawMultipole(
m=4,
Expand All @@ -29,8 +29,8 @@ def test__deflections_yx_2d_from():

deflections = mp.deflections_yx_2d_from(grid=ag.Grid2DIrregular([[1.0, 0.0]]))

assert deflections[0, 0] == pytest.approx(-0.093819734, 1e-3)
assert deflections[0, 1] == pytest.approx(-0.12642225085, 1e-3)
assert deflections[0, 0] == pytest.approx(-0.096376665, 1e-3)
assert deflections[0, 1] == pytest.approx(-0.1298677210, 1e-3)


def test__convergence_2d_from():
Expand Down

0 comments on commit 9013366

Please sign in to comment.