Skip to content

Commit 2a1d963

Browse files
Jammy2211Jammy2211
authored andcommitted
finish
1 parent 3d108ab commit 2a1d963

5 files changed

Lines changed: 39 additions & 19 deletions

File tree

autogalaxy/abstract_fit.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ def linear_light_profile_intensity_dict(
110110
reconstruction = self.inversion.reconstruction_dict[linear_obj_func]
111111

112112
for i, light_profile in enumerate(linear_obj_func.light_profile_list):
113-
linear_light_profile_intensity_dict[light_profile] = float(reconstruction[i])
113+
linear_light_profile_intensity_dict[light_profile] = float(
114+
reconstruction[i]
115+
)
114116

115117
return linear_light_profile_intensity_dict
116118

autogalaxy/analysis/chaining_util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ def mass_light_dark_basis_from(
500500
lmp_model.centre = light_profile.centre
501501
lmp_model.ell_comps = light_profile.ell_comps
502502

503-
504503
print(light_profile.intensity)
505504
print(type(light_profile.intensity))
506505

autogalaxy/profiles/basis.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ def deflections_yx_2d_from(
215215
"""
216216
if len(self.mass_profile_list) > 0:
217217
return sum(
218-
[mass.deflections_yx_2d_from(grid=grid, xp=xp) for mass in self.profile_list]
218+
[
219+
mass.deflections_yx_2d_from(grid=grid, xp=xp)
220+
for mass in self.profile_list
221+
]
219222
)
220223
return xp.zeros((grid.shape[0], 2))
221224

autogalaxy/profiles/light/linear/abstract.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ def __init__(
203203
"""
204204
)
205205

206-
super().__init__(grid=grid, regularization=regularization, settings=settings, xp=xp)
206+
super().__init__(
207+
grid=grid, regularization=regularization, settings=settings, xp=xp
208+
)
207209

208210
self.blurring_grid = blurring_grid
209211
self.psf = psf
@@ -307,7 +309,7 @@ def operated_mapping_matrix_override(self) -> Optional[np.ndarray]:
307309
image=image_2d,
308310
blurring_image=blurring_image_2d,
309311
use_mixed_precision=self.settings.use_mixed_precision,
310-
xp=self._xp
312+
xp=self._xp,
311313
)
312314

313315
blurred_image_2d_list.append(blurred_image_2d.array)

autogalaxy/profiles/mass/stellar/gaussian.py

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,18 @@ def zeta_from(self, grid: aa.type.Grid2DLike, xp=np):
197197

198198
ind_pos_y = y >= 0
199199

200-
scale = q / (xp.asarray(self.sigma, dtype=xp.float64)
201-
* xp.sqrt(xp.asarray(2.0, dtype=xp.float64) * (1.0 - q2)))
200+
scale = q / (
201+
xp.asarray(self.sigma, dtype=xp.float64)
202+
* xp.sqrt(xp.asarray(2.0, dtype=xp.float64) * (1.0 - q2))
203+
)
202204

203205
xs = x * scale
204206
ys = xp.abs(y) * scale
205207

206208
z1 = xs + 1j * ys
207209
z2 = q * xs + 1j * ys / q
208210

209-
exp_term = xp.exp(
210-
-(xs * xs) * (1.0 - q2)
211-
- (ys * ys) * (1.0 / q2 - 1.0)
212-
)
211+
exp_term = xp.exp(-(xs * xs) * (1.0 - q2) - (ys * ys) * (1.0 / q2 - 1.0))
213212

214213
core = -1j * (self.wofz(z1, xp=xp) - exp_term * self.wofz(z2, xp=xp))
215214

@@ -243,10 +242,13 @@ def wofz(self, z, xp=np):
243242
w_large = 1j * inv_sqrt_pi / t
244243

245244
# ---------- Region 5 ----------
246-
U5 = xp.asarray([1.320522, 35.7668, 219.031,
247-
1540.787, 3321.990, 36183.31], dtype=xp.float64)
248-
V5 = xp.asarray([1.841439, 61.57037, 364.2191,
249-
2186.181, 9022.228, 24322.84, 32066.6], dtype=xp.float64)
245+
U5 = xp.asarray(
246+
[1.320522, 35.7668, 219.031, 1540.787, 3321.990, 36183.31], dtype=xp.float64
247+
)
248+
V5 = xp.asarray(
249+
[1.841439, 61.57037, 364.2191, 2186.181, 9022.228, 24322.84, 32066.6],
250+
dtype=xp.float64,
251+
)
250252

251253
t = inv_sqrt_pi
252254
for u in U5:
@@ -259,10 +261,22 @@ def wofz(self, z, xp=np):
259261
w5 = xp.exp(-z2) + 1j * z * t / s
260262

261263
# ---------- Region 6 ----------
262-
U6 = xp.asarray([5.9126262, 30.180142, 93.15558,
263-
181.92853, 214.38239, 122.60793], dtype=xp.float64)
264-
V6 = xp.asarray([10.479857, 53.992907, 170.35400,
265-
348.70392, 457.33448, 352.73063, 122.60793], dtype=xp.float64)
264+
U6 = xp.asarray(
265+
[5.9126262, 30.180142, 93.15558, 181.92853, 214.38239, 122.60793],
266+
dtype=xp.float64,
267+
)
268+
V6 = xp.asarray(
269+
[
270+
10.479857,
271+
53.992907,
272+
170.35400,
273+
348.70392,
274+
457.33448,
275+
352.73063,
276+
122.60793,
277+
],
278+
dtype=xp.float64,
279+
)
266280

267281
t = inv_sqrt_pi
268282
for u in U6:

0 commit comments

Comments
 (0)