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
2 changes: 1 addition & 1 deletion tools/extra_galaxies_centres_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@

info = {}

if os.path.exists(dataset_main_path / "info.json"):
if Path(dataset_main_path / "info.json").exists():
try:
with open(dataset_main_path / "info.json") as json_file:
info = json.load(json_file)
Expand Down
8 changes: 4 additions & 4 deletions tools/psf_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

import os
import json
from os import path
import autolens as al
import autolens.plot as aplt
import numpy as np
from pathlib import Path

"""
__Dataset__
Expand All @@ -32,10 +32,10 @@
"""

dataset_name = "102019586_NEG564463213499964061"
dataset_path = path.join("dataset", dataset_name)
dataset_path = Path("dataset") / dataset_name

psf_full = al.Convolver.from_fits(
file_path=path.join(dataset_path, "psf_full.fits"), hdu=0, pixel_scales=0.1
file_path=Path(dataset_path) / "psf_full.fits", hdu=0, pixel_scales=0.1
)

print("PSF Shape Before Trimming:")
Expand All @@ -48,7 +48,7 @@

psf = psf_full.resized_from(new_shape=new_shape)

psf.output_to_fits(file_path=path.join(dataset_path, "psf.fits"), overwrite=True)
psf.output_to_fits(file_path=Path(dataset_path) / "psf.fits", overwrite=True)


"""
Expand Down
3 changes: 1 addition & 2 deletions workflow/csv_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
# print(f"Working Directory has been set to `{workspace_path}`")

from pathlib import Path
from os import path

import autofit as af
import autolens as al
Expand Down Expand Up @@ -89,7 +88,7 @@
"""
from autofit.aggregator.aggregator import Aggregator

agg = Aggregator.from_directory(directory=path.join("output"), completed_only=True)
agg = Aggregator.from_directory(directory=Path("output"), completed_only=True)

"""
Use a query on the aggregator to only get results for the `mass_total[1]` model-fit, which contains the final lens
Expand Down
3 changes: 1 addition & 2 deletions workflow/example/csv/lens_mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# print(f"Working Directory has been set to `{workspace_path}`")

from pathlib import Path
from os import path

import autofit as af
import autolens as al
Expand Down Expand Up @@ -64,7 +63,7 @@
"""
from autofit.aggregator.aggregator import Aggregator

agg = Aggregator.from_directory(directory=path.join("output"), completed_only=True)
agg = Aggregator.from_directory(directory=Path("output"), completed_only=True)

"""
Use a query on the aggregator to only get results for the `mass_total[1]` model-fit, which contains the final lens
Expand Down
3 changes: 1 addition & 2 deletions workflow/example/csv/magnitudes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# print(f"Working Directory has been set to `{workspace_path}`")

from pathlib import Path
from os import path

import autofit as af
import autolens as al
Expand Down Expand Up @@ -64,7 +63,7 @@
"""
from autofit.aggregator.aggregator import Aggregator

agg = Aggregator.from_directory(directory=path.join("output"), completed_only=True)
agg = Aggregator.from_directory(directory=Path("output"), completed_only=True)

"""
Use a query on the aggregator to only get results for the `mass_total[1]` model-fit, which contains the final lens
Expand Down
3 changes: 1 addition & 2 deletions workflow/example/png/mge_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# print(f"Working Directory has been set to `{workspace_path}`")

from pathlib import Path
from os import path

import autofit as af
import autolens as al
Expand Down Expand Up @@ -65,7 +64,7 @@
"""
from autofit.aggregator.aggregator import Aggregator

agg = Aggregator.from_directory(directory=path.join("output"), completed_only=True)
agg = Aggregator.from_directory(directory=Path("output"), completed_only=True)

"""
Use a query on the aggregator to only get results for the `mass_total[1]` model-fit, which contains the final lens
Expand Down
5 changes: 2 additions & 3 deletions workflow/fits_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
# %cd $workspace_path
# print(f"Working Directory has been set to `{workspace_path}`")

from os import path
from pathlib import Path

import autofit as af
Expand Down Expand Up @@ -93,7 +92,7 @@
"""
from autofit.aggregator.aggregator import Aggregator

agg = Aggregator.from_directory(directory=path.join("output"), completed_only=True)
agg = Aggregator.from_directory(directory=Path("output"), completed_only=True)

"""
Use a query on the aggregator to only get results for the `mass_total[1]` model-fit, which contains the final lens
Expand Down Expand Up @@ -195,7 +194,7 @@

When we add a single .png, we cannot extract or make it, it simply gets added to the subplot.
"""
# image_rgb = Image.open(path.join(dataset_path, "rgb.png"))
# image_rgb = Image.open(Path(dataset_path) / "rgb.png")
#
# image = agg_fits.extract_fits(
# al.agg.subplot_dataset.data,
Expand Down
3 changes: 1 addition & 2 deletions workflow/png_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
# print(f"Working Directory has been set to `{workspace_path}`")

from pathlib import Path
from os import path

import autofit as af
import autolens as al
Expand Down Expand Up @@ -95,7 +94,7 @@
"""
from autofit.aggregator.aggregator import Aggregator

agg = Aggregator.from_directory(directory=path.join("output"), completed_only=True)
agg = Aggregator.from_directory(directory=Path("output"), completed_only=True)

"""
Use a query on the aggregator to only get results for the `mass_total[1]` model-fit, which contains the final lens
Expand Down
Loading