Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions config/priors/mesh/rectangular_bilinear_adapt_density.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
RectangularBilinearAdaptDensity:
shape_0:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
shape_1:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
40 changes: 40 additions & 0 deletions config/priors/mesh/rectangular_bilinear_adapt_image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
RectangularBilinearAdaptImage:
shape_0:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
shape_1:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
weight_power:
type : Uniform
lower_limit: 0.0
upper_limit: 10.0
width_modifier:
type: Absolute
value: 2.0
limits:
lower: -100.0
upper: 100.0
weight_floor:
type: LogUniform
lower_limit: 0.00001
upper_limit: 1.0
width_modifier:
type: Absolute
limits:
lower: 0.0
upper: inf
40 changes: 20 additions & 20 deletions ...riors/mesh/rectangular_adapt_density.yaml → ...s/mesh/rectangular_rtu_adapt_density.yaml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
RectangularAdaptDensity:
shape_0:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
shape_1:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
RectangularRTUAdaptDensity:
shape_0:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
shape_1:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
78 changes: 39 additions & 39 deletions .../priors/mesh/rectangular_adapt_image.yaml → ...ors/mesh/rectangular_rtu_adapt_image.yaml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
RectangularAdaptImage:
shape_0:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
shape_1:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
weight_power:
type : Uniform
lower_limit: 0.0
upper_limit: 10.0
width_modifier:
type: Absolute
value: 2.0
limits:
lower: -100.0
upper: 100.0
weight_floor:
type: LogUniform
lower_limit: 0.00001
upper_limit: 1.0
width_modifier:
type: Absolute
limits:
lower: 0.0
RectangularRTUAdaptImage:
shape_0:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
shape_1:
type: Uniform
lower_limit: 20.0
upper_limit: 45.0
width_modifier:
type: Absolute
value: 8.0
limits:
lower: 3.0
upper: inf
weight_power:
type : Uniform
lower_limit: 0.0
upper_limit: 10.0
width_modifier:
type: Absolute
value: 2.0
limits:
lower: -100.0
upper: 100.0
weight_floor:
type: LogUniform
lower_limit: 0.00001
upper_limit: 1.0
width_modifier:
type: Absolute
limits:
lower: 0.0
upper: inf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"To begin, make sure you have read tutorials 4 and 5 carefully, as a clear understanding of how the Bayesian\n",
"evidence works is key to understanding the adaption tutorials that close this chapter!\n",
"\n",
"Earlier in this chapter (tutorial 8) we investigated two pixelizations: the `RectangularAdaptDensity` mesh and the\n",
"Earlier in this chapter (tutorial 8) we investigated two pixelizations: the `RectangularBilinearAdaptDensity` mesh and the\n",
"`Delaunay` mesh with an `Overlay` image-mesh. We argued that the latter was better than the former, because it\n",
"dedicated more source-pixels to the regions of the source-plane where we had more data, e.g. the high-magnification\n",
"regions. Therefore, we could fit the data using fewer source pixels, which improved computational efficiency and\n",
Expand Down Expand Up @@ -255,7 +255,7 @@
"__Fitting__\n",
"\n",
"we'll make one more convenience function which fits the simulated imaging data with a\n",
"`RectangularAdaptDensity` mesh and `Constant` regularization scheme pixelization.\n",
"`RectangularBilinearAdaptDensity` mesh and `Constant` regularization scheme pixelization.\n",
"\n",
"We'll input the `coefficient` of each fit, so that for each simulated source we regularize it at an appropriate level. \n",
"There is nothing new in this function you haven't seen before."
Expand All @@ -278,7 +278,7 @@
" )\n",
"\n",
" pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(24, 24)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(24, 24)),\n",
" regularization=al.reg.Constant(coefficient=coefficient),\n",
" )\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, we're going to fit the image using the RectangularAdaptDensity magnification based grid. \n",
"Next, we're going to fit the image using the RectangularBilinearAdaptDensity magnification based grid. \n",
"\n",
"The code below does all the usual steps required to do this."
]
Expand All @@ -185,7 +185,7 @@
")\n",
"\n",
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(24, 24)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(24, 24)),\n",
" regularization=al.reg.Constant(coefficient=3.3),\n",
")\n",
"\n",
Expand Down Expand Up @@ -248,7 +248,7 @@
"Now lets take a look at brightness based adaption in action. \n",
"\n",
"Below, we define a source-galaxy using the `Hilbert` image-mesh (we discuss below how this adapts to the source light) \n",
"and `RectangularAdaptDensity` mesh and use this to fit the lens-data. "
"and `RectangularBilinearAdaptDensity` mesh and use this to fit the lens-data. "
]
},
{
Expand All @@ -262,7 +262,7 @@
")\n",
"\n",
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(24, 24)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(24, 24)),\n",
" regularization=al.reg.Constant(coefficient=0.5),\n",
")\n",
"\n",
Expand Down Expand Up @@ -460,7 +460,7 @@
"\n",
"\n",
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(24, 24)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(24, 24)),\n",
" regularization=al.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
Expand Down Expand Up @@ -509,7 +509,7 @@
"\n",
"\n",
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(24, 24)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(24, 24)),\n",
" regularization=al.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(24, 24)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(24, 24)),\n",
" regularization=al.reg.Constant(coefficient=3.3),\n",
")\n",
"\n",
Expand Down Expand Up @@ -245,7 +245,7 @@
"adapt_image = fit.model_data.slim\n",
"\n",
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(24, 24)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(24, 24)),\n",
" regularization=al.reg.Adapt(\n",
" inner_coefficient=0.005, outer_coefficient=1.9, signal_scale=3.0\n",
" ),\n",
Expand Down Expand Up @@ -374,7 +374,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(24, 24)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(24, 24)),\n",
" regularization=al.reg.Adapt(\n",
" inner_coefficient=0.001, outer_coefficient=0.2, signal_scale=2.0\n",
" ),\n",
Expand Down
10 changes: 5 additions & 5 deletions notebooks/chapter_3_pixelizations/tutorial_1_pixelizations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"There are multiple `Mesh`'s available. For now, we'll keep it simple and use a rectangular\n",
"grid, whose `shape` defines its $(y,x)$ dimensions.\n",
"\n",
"The `RectangularAdaptDensity` mesh adapts its pixels to the density of the traced source-plane\n",
"The `RectangularBilinearAdaptDensity` mesh adapts its pixels to the density of the traced source-plane\n",
"grid via the ray-guided transformed uniform (RTU) grid formulation of Enzi et al. (2026)\n",
"(https://arxiv.org/abs/2606.30620), which should be cited in published work using this mesh.\n",
"Note that whereas that paper pairs the RTU grid with a Gaussian-process source prior,\n",
Expand All @@ -132,7 +132,7 @@
"cell_type": "code",
"metadata": {},
"source": [
"mesh = al.mesh.RectangularAdaptDensity(shape=(25, 25))"
"mesh = al.mesh.RectangularBilinearAdaptDensity(shape=(25, 25))"
],
"outputs": [],
"execution_count": null
Expand Down Expand Up @@ -221,11 +221,11 @@
"cell_type": "code",
"metadata": {},
"source": [
"print(\"RectangularAdaptDensity Grid2D Pixel Centre 1:\")\n",
"print(\"RectangularBilinearAdaptDensity Grid2D Pixel Centre 1:\")\n",
"print(mapper.source_plane_mesh_grid[0])\n",
"print(\"RectangularAdaptDensity Grid2D Pixel Centre 2:\")\n",
"print(\"RectangularBilinearAdaptDensity Grid2D Pixel Centre 2:\")\n",
"print(mapper.source_plane_mesh_grid[1])\n",
"print(\"RectangularAdaptDensity Grid2D Pixel Centre 3:\")\n",
"print(\"RectangularBilinearAdaptDensity Grid2D Pixel Centre 3:\")\n",
"print(mapper.source_plane_mesh_grid[2])\n",
"print(\"etc.\")"
],
Expand Down
2 changes: 1 addition & 1 deletion notebooks/chapter_3_pixelizations/tutorial_2_mappers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
"cell_type": "code",
"metadata": {},
"source": [
"mesh = al.mesh.RectangularAdaptDensity(shape=(25, 25))\n",
"mesh = al.mesh.RectangularBilinearAdaptDensity(shape=(25, 25))\n",
"\n",
"pixelization = al.Pixelization(mesh=mesh)\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
"cell_type": "code",
"metadata": {},
"source": [
"mesh = al.mesh.RectangularAdaptDensity(shape=(25, 25))\n",
"mesh = al.mesh.RectangularBilinearAdaptDensity(shape=(25, 25))\n",
"\n",
"pixelization = al.Pixelization(mesh=mesh)\n",
"\n",
Expand Down Expand Up @@ -479,7 +479,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" regularization=al.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" regularization=al.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
Expand Down Expand Up @@ -227,7 +227,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" regularization=al.reg.Constant(coefficient=0.0),\n",
")\n",
"\n",
Expand Down Expand Up @@ -300,7 +300,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" regularization=al.reg.Constant(coefficient=100.0),\n",
")\n",
"\n",
Expand Down Expand Up @@ -422,7 +422,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" regularization=al.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
Expand Down
Loading
Loading