Skip to content

Commit e637a51

Browse files
Jammy2211Jammy2211
authored andcommitted
git push
Merge branch 'feature/jax_w_tilde_preload'
2 parents 98e52e7 + 9f309c7 commit e637a51

8 files changed

Lines changed: 29 additions & 15 deletions

File tree

CITATIONS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If you use decomposed mass models (e.g. stellar mass models like an ``Sersic`` o
2222
an ``NFW``) please cite the following paper https://arxiv.org/abs/2106.11464 under
2323
citation key ``Oguri2021``. Our deflection angle calculations are based on this method.
2424

25-
If you specifically use a decomposed mass model with the ``GeneralizedNFW`` please cite the following paper https://academic.oup.com/mnras/article/488/1/1387/5526256 under
25+
If you specifically use a decomposed mass model with the ``gNFW`` please cite the following paper https://academic.oup.com/mnras/article/488/1/1387/5526256 under
2626
citation key ``Anowar2019``.
2727

2828
The citations.bib file above also includes my work on `using strong lensing to study galaxy structure

autolens/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from autoconf import jax_wrapper
22
from autoconf.dictable import from_dict, from_json, output_to_json, to_dict
33
from autoarray import preprocess
4-
from autoarray.dataset.interferometer.w_tilde import load_curvature_preload_if_compatible
4+
from autoarray.dataset.interferometer.w_tilde import (
5+
load_curvature_preload_if_compatible,
6+
)
57
from autoarray.dataset.imaging.w_tilde import WTildeImaging
68
from autoarray.dataset.imaging.dataset import Imaging
79
from autoarray.dataset.interferometer.dataset import (
@@ -40,6 +42,9 @@
4042
from autoarray.structures.grids.uniform_2d import Grid2D
4143
from autoarray.structures.grids.irregular_2d import Grid2DIrregular
4244
from autoarray.structures.mesh.rectangular_2d import Mesh2DRectangular
45+
from autoarray.structures.mesh.rectangular_2d_uniform import (
46+
Mesh2DRectangularUniform,
47+
) # noqa
4348
from autoarray.structures.mesh.delaunay_2d import Mesh2DDelaunay
4449
from autoarray.structures.triangles.shape import Circle
4550
from autoarray.structures.triangles.shape import Triangle

autolens/exc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PixelizationException(af.exc.FitException):
3232
"""
3333
Raises exceptions associated with the `inversion/pixelization` modules and `Pixelization` classes.
3434
35-
For example if a `RectangularMagnification` mesh has dimensions below 3x3.
35+
For example if a `RectangularAdaptDensity` mesh has dimensions below 3x3.
3636
3737
This exception overwrites `autoarray.exc.PixelizationException` in order to add a `FitException`. This means that
3838
if this exception is raised during a model-fit in the analysis class's `log_likelihood_function` that model

autolens/interferometer/simulator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ def via_deflections_and_galaxies_from(
9696

9797
return self.via_image_from(image=image)
9898

99-
def via_source_image_from(self, tracer : Tracer, grid : aa.type.Grid2DLike, source_image : aa.Array2D) -> aa.Imaging:
99+
def via_source_image_from(
100+
self, tracer: Tracer, grid: aa.type.Grid2DLike, source_image: aa.Array2D
101+
) -> aa.Imaging:
100102
"""
101103
Simulate an `Interferometer` dataset from an input image of a source galaxy.
102104
@@ -127,8 +129,7 @@ def via_source_image_from(self, tracer : Tracer, grid : aa.type.Grid2DLike, sour
127129
"""
128130

129131
image = tracer.image_2d_via_input_plane_image_from(
130-
grid=grid,
131-
plane_image=source_image
132+
grid=grid, plane_image=source_image
132133
)
133134

134-
return self.via_image_from(image=image)
135+
return self.via_image_from(image=image)

autolens/lens/subhalo.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,10 @@ def figure_figures_of_merit_grid(
367367
max_value = np.round(np.nanmax(array_overlay), 2)
368368
fit_plotter.set_title(label=f"Image {max_value}")
369369

370-
fit_plotter.figures_2d_of_planes(plane_index=-1, subtracted_image=True)
370+
try:
371+
fit_plotter.figures_2d_of_planes(plane_index=-1, subtracted_image=True)
372+
except AttributeError:
373+
pass
371374

372375
if reset_filename:
373376
self.set_filename(filename=None)
@@ -384,10 +387,15 @@ def figure_mass_grid(self):
384387

385388
array_overlay = self.result.subhalo_mass_array
386389

387-
visuals_2d = self.visuals_2d + self.visuals_2d.__class__(
388-
array_overlay=array_overlay,
389-
mass_profile_centres=self.result.subhalo_centres_grid,
390-
)
390+
try:
391+
visuals_2d = self.visuals_2d + self.visuals_2d.__class__(
392+
array_overlay=array_overlay,
393+
mass_profile_centres=self.result.subhalo_centres_grid,
394+
)
395+
except TypeError:
396+
visuals_2d = self.visuals_2d + self.visuals_2d.__class__(
397+
array_overlay=array_overlay,
398+
)
391399

392400
self.update_mat_plot_array_overlay(evidence_max=np.max(array_overlay))
393401
self.mat_plot_2d.colorbar.manual_log10 = True

docs/api/pixelization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Mesh [ag.mesh]
4646
:template: custom-class-template.rst
4747
:recursive:
4848

49-
RectangularMagnification
49+
RectangularAdaptDensity
5050
Delaunay
5151
Voronoi
5252
Voronoi

docs/general/citations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If you use decomposed mass models (e.g. stellar mass models like an ``Sersic`` o
3030
an ``NFW``) please cite the following paper https://arxiv.org/abs/2106.11464 under
3131
citation key ``Oguri2021``. Our deflection angle calculations are based on this method.
3232

33-
If you specifically use a decomposed mass model with the ``GeneralizedNFW`` please cite the following paper https://academic.oup.com/mnras/article/488/1/1387/5526256 under
33+
If you specifically use a decomposed mass model with the ``gNFW`` please cite the following paper https://academic.oup.com/mnras/article/488/1/1387/5526256 under
3434
citation key ``Anowar2019``.
3535

3636
Science Papers

test_autolens/config/priors/pixelizations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ delaunay.DelaunayMagnification:
5050
width_modifier:
5151
type: Absolute
5252
value: 8.0
53-
rectangular.RectangularMagnification:
53+
rectangular.RectangularAdaptDensity:
5454
shape_0:
5555
limits:
5656
lower: 3.0

0 commit comments

Comments
 (0)