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
28 changes: 27 additions & 1 deletion notebooks/chapter_4_pixelizations/tutorial_3_inversions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,33 @@
"metadata": {},
"source": [
"dataset_name = \"source_complex\"\n",
"dataset_path = Path(\"dataset\") / \"imaging\" / dataset_name\n",
"dataset_path = Path(\"dataset\") / \"imaging\" / dataset_name"
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Dataset Auto-Simulation__\n",
"\n",
"If the dataset does not already exist on your system, it will be created by running the corresponding\n",
"simulator script. This ensures that all example scripts can be run without manually simulating data first."
]
},
{
"cell_type": "code",
"metadata": {},
"source": [
"if al.util.dataset.should_simulate(str(dataset_path)):\n",
" import subprocess\n",
" import sys\n",
"\n",
" subprocess.run(\n",
" [sys.executable, \"scripts/simulator/source_complex.py\"],\n",
" check=True,\n",
" )\n",
"\n",
"dataset = al.Imaging.from_fits(\n",
" data_path=dataset_path / \"data.fits\",\n",
Expand Down
28 changes: 27 additions & 1 deletion notebooks/chapter_4_pixelizations/tutorial_5_borders.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,33 @@
"metadata": {},
"source": [
"dataset_name = \"x2_lens_galaxies\"\n",
"dataset_path = Path(\"dataset\") / \"imaging\" / dataset_name\n",
"dataset_path = Path(\"dataset\") / \"imaging\" / dataset_name"
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Dataset Auto-Simulation__\n",
"\n",
"If the dataset does not already exist on your system, it will be created by running the corresponding\n",
"simulator script. This ensures that all example scripts can be run without manually simulating data first."
]
},
{
"cell_type": "code",
"metadata": {},
"source": [
"if al.util.dataset.should_simulate(str(dataset_path)):\n",
" import subprocess\n",
" import sys\n",
"\n",
" subprocess.run(\n",
" [sys.executable, \"scripts/simulator/lens_x2.py\"],\n",
" check=True,\n",
" )\n",
"\n",
"dataset = al.Imaging.from_fits(\n",
" data_path=dataset_path / \"data.fits\",\n",
Expand Down
15 changes: 15 additions & 0 deletions scripts/chapter_4_pixelizations/tutorial_3_inversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
dataset_name = "source_complex"
dataset_path = Path("dataset") / "imaging" / dataset_name

"""
__Dataset Auto-Simulation__

If the dataset does not already exist on your system, it will be created by running the corresponding
simulator script. This ensures that all example scripts can be run without manually simulating data first.
"""
if al.util.dataset.should_simulate(str(dataset_path)):
import subprocess
import sys

subprocess.run(
[sys.executable, "scripts/simulator/source_complex.py"],
check=True,
)

dataset = al.Imaging.from_fits(
data_path=dataset_path / "data.fits",
noise_map_path=dataset_path / "noise_map.fits",
Expand Down
15 changes: 15 additions & 0 deletions scripts/chapter_4_pixelizations/tutorial_5_borders.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,21 @@ def perform_fit_with_source_galaxy_mask_and_border(
dataset_name = "x2_lens_galaxies"
dataset_path = Path("dataset") / "imaging" / dataset_name

"""
__Dataset Auto-Simulation__

If the dataset does not already exist on your system, it will be created by running the corresponding
simulator script. This ensures that all example scripts can be run without manually simulating data first.
"""
if al.util.dataset.should_simulate(str(dataset_path)):
import subprocess
import sys

subprocess.run(
[sys.executable, "scripts/simulator/lens_x2.py"],
check=True,
)

dataset = al.Imaging.from_fits(
data_path=dataset_path / "data.fits",
noise_map_path=dataset_path / "noise_map.fits",
Expand Down
Loading