Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
93efbfb
imitate tracer api for point solver
rhayes777 Sep 30, 2024
6b94371
docs
rhayes777 Sep 30, 2024
c58617f
help
Jammy2211 Oct 25, 2024
a6d492f
change to analaysis and confdig
Jammy2211 Nov 1, 2024
e2a8eb4
fix agg extra galaxies
Jammy2211 Nov 5, 2024
bb3cdfa
version
Jammy2211 Nov 6, 2024
e03770c
multipole updated
Jammy2211 Nov 6, 2024
405c8d5
Merge pull request #208 from Jammy2211/feature/multipole_fix
Jammy2211 Nov 6, 2024
8086f33
another fix
Jammy2211 Nov 6, 2024
a5288cf
fix unit test
Jammy2211 Nov 6, 2024
9013366
Merge pull request #209 from Jammy2211/feature/multipole_2
Jammy2211 Nov 6, 2024
813c346
black
Jammy2211 Nov 13, 2024
0ad6c4a
'Updated version in __init__ to 2024.11.13.2
rhayes777 Nov 13, 2024
ae60a5a
DelaunayDrawer
Jammy2211 Nov 14, 2024
5e2c9d9
add_poisson_noise -> add_poisson_noise_to_data
Jammy2211 Nov 18, 2024
ecc1469
docstring
Jammy2211 Nov 18, 2024
f00693d
docstring
Jammy2211 Nov 18, 2024
f77390d
fix unit test
Jammy2211 Nov 18, 2024
9602c16
Merge pull request #211 from Jammy2211/feature/disable_noise
Jammy2211 Nov 18, 2024
1c7382c
Merge branch 'main' into feature/delaunay_visual
Jammy2211 Nov 18, 2024
2f33282
Merge pull request #210 from Jammy2211/feature/delaunay_visual
Jammy2211 Nov 18, 2024
791b4e1
errors -> reconstruction_noise_map
Jammy2211 Nov 20, 2024
f731ab4
Merge pull request #212 from Jammy2211/feature/inversion_noise_map
Jammy2211 Nov 20, 2024
f7ba6da
mask overlay in scribbler
Jammy2211 Nov 20, 2024
85c8ca8
fix agg
Jammy2211 Nov 24, 2024
c9ea985
cleaning up big clean up of over sample decorator
Jammy2211 Dec 14, 2024
dcf1c7b
fix tests by removing OverSampling API
Jammy2211 Dec 15, 2024
6abc996
fix majority of tesrts
Jammy2211 Dec 15, 2024
f8458f1
black
Jammy2211 Dec 15, 2024
7f1f9a9
horrible refactor nearly done
Jammy2211 Dec 15, 2024
ed65517
remove config nonsense
Jammy2211 Dec 15, 2024
137d403
uniform -> lp
Jammy2211 Dec 15, 2024
812eaaa
add over sample to util
Jammy2211 Dec 15, 2024
be0817c
Merge pull request #195 from Jammy2211/feature/operate_deflections_api
rhayes777 Dec 16, 2024
00b4d50
Revert "feature/operate deflections api"
rhayes777 Dec 16, 2024
8055f80
simplify grid over sampled API
Jammy2211 Dec 16, 2024
fe1f255
simplify API
Jammy2211 Dec 16, 2024
11e62b2
Merge branch 'main' into feature/over_sampling_refactor
Jammy2211 Dec 18, 2024
d963ffa
remove Grid2DIRregularUniform
Jammy2211 Dec 18, 2024
90cfb65
remove OverSamplingDataset
Jammy2211 Dec 20, 2024
74867f0
Merge pull request #213 from Jammy2211/revert-195-feature/operate_def…
Jammy2211 Jan 14, 2025
6eeba99
Merge pull request #214 from Jammy2211/feature/over_sampling_refactor
Jammy2211 Jan 15, 2025
a091828
remove annoying unit test
Jammy2211 Jan 15, 2025
342b978
'Updated version in __init__ to 2025.1.18.7
rhayes777 Jan 18, 2025
2b5b461
Merge branch 'main' into feature/jax_merge
Jammy2211 Jan 22, 2025
df9f901
merge more changes from main
Jammy2211 Jan 22, 2025
5824414
fits objects
Jammy2211 Feb 11, 2025
e76d1d1
remove individual figures from plotter interface genetic
Jammy2211 Feb 19, 2025
98f1125
remove reference and use of subfolders
Jammy2211 Feb 19, 2025
d6d9ee0
plotter interface interferometer
Jammy2211 Feb 19, 2025
d7bb3e2
unit tests
Jammy2211 Feb 19, 2025
ac51ff2
plotter interface quantitiy
Jammy2211 Feb 19, 2025
bfd9a07
unit tests
Jammy2211 Feb 19, 2025
2cf8e5b
ellipse
Jammy2211 Feb 19, 2025
82cea44
fix some unit tests
Jammy2211 Feb 19, 2025
aa2264f
interface clean with unit tests passing
Jammy2211 Feb 19, 2025
a36c78c
cleaned up plots config
Jammy2211 Feb 19, 2025
d5bb566
added subplot 1D galaxies
Jammy2211 Feb 19, 2025
470f8be
1D galaxies plots
Jammy2211 Feb 19, 2025
23c0919
rename some adP IMAGE stuff[D
Jammy2211 Feb 19, 2025
cf65271
during analysis removed
Jammy2211 Feb 19, 2025
931c42e
galaxy_images.fits output in plotter_interface
Jammy2211 Feb 20, 2025
41f2d1a
added output of fit.fits
Jammy2211 Feb 20, 2025
7bf156a
first plotter interface of interferometer
Jammy2211 Feb 20, 2025
bb8cc3c
fits_dirty_images.fit
Jammy2211 Feb 20, 2025
2401679
output format from config
Jammy2211 Feb 20, 2025
07183a0
more .fits stuff working
Jammy2211 Feb 20, 2025
2bc6ed8
Merge branch 'feature/aggregate_images' into feature/images_refactor
Jammy2211 Feb 20, 2025
2bc883d
merge aggregator images which wraps autofit functionality
Jammy2211 Feb 20, 2025
ab3a389
docstrings
Jammy2211 Feb 21, 2025
a865c66
review
Jammy2211 Feb 21, 2025
a9157b9
Merge pull request #218 from Jammy2211/feature/images_refactor
Jammy2211 Feb 21, 2025
90c2e0e
Add the gNFWVirialMassgNFWConcSph profile to the dark package
Jammy2211 Feb 25, 2025
8eb6cc6
Merge pull request #219 from Jammy2211/feature/kassidy_gnfw
Jammy2211 Feb 25, 2025
6b0ac09
imports
Jammy2211 Feb 25, 2025
21cf628
grids.yaml
Jammy2211 Feb 26, 2025
bb79b1e
Merge branch 'main' into feature/jax_merge
Jammy2211 Mar 13, 2025
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
9 changes: 2 additions & 7 deletions autogalaxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from autoarray.dataset.imaging.dataset import Imaging # noqa
from autoarray.dataset.interferometer.dataset import Interferometer # noqa
from autoarray.dataset.dataset_model import DatasetModel
from autoarray.dataset.over_sampling import OverSamplingDataset
from autoarray.inversion.inversion.mapper_valued import MapperValued
from autoarray.inversion.pixelization import mesh # noqa
from autoarray.inversion import regularization as reg # noqa
Expand Down Expand Up @@ -35,11 +34,7 @@
from autoarray.structures.grids.uniform_1d import Grid1D # noqa
from autoarray.structures.grids.uniform_2d import Grid2D # noqa
from autoarray.structures.grids.irregular_2d import Grid2DIrregular # noqa
from autoarray.structures.grids.irregular_2d import Grid2DIrregularUniform # noqa
from autoarray.operators.over_sampling.uniform import OverSamplingUniform # noqa
from autoarray.operators.over_sampling.uniform import OverSamplerUniform # noqa
from autoarray.operators.over_sampling.iterate import OverSamplingIterate
from autoarray.operators.over_sampling.iterate import OverSamplerIterate
from autoarray.operators.over_sampling.over_sampler import OverSampler # noqa
from autoarray.structures.mesh.rectangular_2d import Mesh2DRectangular # noqa
from autoarray.structures.mesh.voronoi_2d import Mesh2DVoronoi # noqa
from autoarray.structures.mesh.delaunay_2d import Mesh2DDelaunay # noqa
Expand Down Expand Up @@ -113,4 +108,4 @@

conf.instance.register(__file__)

__version__ = "2024.9.21.2"
__version__ = "2025.1.18.7"
2 changes: 2 additions & 0 deletions autogalaxy/aggregator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
from autogalaxy.aggregator.ellipse.ellipses import EllipsesAgg
from autogalaxy.aggregator.ellipse.multipoles import MultipolesAgg
from autogalaxy.aggregator.ellipse.fit_ellipse import FitEllipseAgg
from autogalaxy.aggregator.subplot import SubplotDataset as subplot_dataset
from autogalaxy.aggregator.subplot import SubplotFit as subplot_fit
23 changes: 12 additions & 11 deletions autogalaxy/aggregator/dataset_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,17 @@ def _dataset_model_from(
except AttributeError:
dataset_model = None

if len(fit.children) > 0:
logger.info(
"""
Using database for a fit with multiple summed Analysis objects.

DatasetModel objects do not fully support this yet (e.g. variables across Analysis objects may not be correct)
so proceed with caution!
"""
)

return [dataset_model] * len(fit.children)
if fit.children is not None:
if len(fit.children) > 0:
Comment on lines +50 to +51
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None and empty array are both falsey

if fit.children:
    ...

logger.info(
"""
Using database for a fit with multiple summed Analysis objects.

DatasetModel objects do not fully support this yet (e.g. variables across Analysis objects may not be correct)
so proceed with caution!
"""
)

return [dataset_model] * len(fit.children)

return [dataset_model]
6 changes: 4 additions & 2 deletions autogalaxy/aggregator/galaxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ def _galaxies_from(fit: af.Fit, instance: af.ModelInstance) -> List[Galaxy]:
galaxies = instance.galaxies

if hasattr(instance, "extra_galaxies"):
galaxies = galaxies + fit.instance.extra_galaxies
if fit.instance.extra_galaxies is not None:
galaxies = galaxies + fit.instance.extra_galaxies

else:
galaxies = fit.instance.galaxies

if hasattr(fit.instance, "extra_galaxies"):
galaxies = galaxies + fit.instance.extra_galaxies
if fit.instance.extra_galaxies is not None:
galaxies = galaxies + fit.instance.extra_galaxies

if fit.children is not None:
if len(fit.children) > 0:
Expand Down
26 changes: 23 additions & 3 deletions autogalaxy/aggregator/imaging/imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,40 @@ def _imaging_from(
except AttributeError:
psf = None

over_sampling = fit.value(name="dataset.over_sampling")

dataset = aa.Imaging(
data=data,
noise_map=noise_map,
psf=psf,
over_sampling=over_sampling,
check_noise_map=False,
)

mask = aa.Mask2D.from_primary_hdu(primary_hdu=fit.value(name="dataset.mask"))

dataset = dataset.apply_mask(mask=mask)

try:
over_sample_size_lp = aa.Array2D.from_primary_hdu(
primary_hdu=fit.value(name="dataset.over_sample_size_lp")
).native
over_sample_size_lp = over_sample_size_lp.apply_mask(mask=mask)
except AttributeError:
over_sample_size_lp = 1

try:
over_sample_size_pixelization = aa.Array2D.from_primary_hdu(
primary_hdu=fit.value(name="dataset.over_sample_size_pixelization")
).native
over_sample_size_pixelization = over_sample_size_pixelization.apply_mask(
mask=mask
)
except AttributeError:
over_sample_size_pixelization = 1

dataset = dataset.apply_over_sampling(
over_sample_size_lp=over_sample_size_lp,
over_sample_size_pixelization=over_sample_size_pixelization,
)

dataset_list.append(dataset)

return dataset_list
Expand Down
2 changes: 0 additions & 2 deletions autogalaxy/aggregator/interferometer/interferometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ def _interferometer_from(
)
)

over_sampling = fit.value(name="dataset.over_sampling")
transformer_class = fit.value(name="dataset.transformer_class")

dataset = aa.Interferometer(
data=data,
noise_map=noise_map,
uv_wavelengths=uv_wavelengths,
real_space_mask=real_space_mask,
over_sampling=over_sampling,
transformer_class=transformer_class,
)

Expand Down
31 changes: 31 additions & 0 deletions autogalaxy/aggregator/subplot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from enum import Enum

class SubplotDataset(Enum):
"""
The subplots that can be extracted from the subplot_fit image.

The values correspond to the position of the subplot in the 4x3 grid.
"""

data = (0, 0)
data_log_10 = (1, 0)
noise_map = (2, 0)
psf = (0, 1)
psf_log_10 = (1, 1)
signal_to_noise_map = (2, 1)
over_sample_size_lp = (0, 2)
over_sample_Size_pixelization = (1, 2)

class SubplotFit(Enum):
"""
The subplots that can be extracted from the subplot_fit image.

The values correspond to the position of the subplot in the 4x3 grid.
"""

data = (0, 0)
signal_to_noise_map = (1, 0)
model_image = (2, 0)
normalized_residual_map = (0, 1)
normalized_residual_map_one_sigma = (1, 1)
chi_squared_map = (2, 1)
18 changes: 9 additions & 9 deletions autogalaxy/analysis/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def galaxies_via_instance_from(
if getattr(instance, "extra_galaxies", None) is not None:
return Galaxies(
galaxies=instance.galaxies + instance.extra_galaxies,
run_time_dict=run_time_dict
run_time_dict=run_time_dict,
)

return Galaxies(galaxies=instance.galaxies, run_time_dict=run_time_dict)
Expand Down Expand Up @@ -139,7 +139,7 @@ def profile_log_likelihood_function(
An `info_dict` is also created which stores information on aspects of the model and dataset that dictate
run times, so the profiled times can be interpreted with this context.

The results of this profiling are then output to hard-disk in the `prefiling` folder of the model-fit results,
The results of this profiling are then output to hard-disk in the `profiling` folder of the model-fit results,
which they can be inspected to ensure run-times are as expected.

Parameters
Expand Down Expand Up @@ -191,19 +191,19 @@ def profile_log_likelihood_function(
fit.figure_of_merit

try:
info_dict["image_pixels"] = self.dataset.grids.uniform.shape_slim
info_dict["sub_total_light_profiles"] = (
self.dataset.grids.uniform.over_sampler.sub_total
)
info_dict["image_pixels"] = self.dataset.grids.lp.shape_slim
info_dict[
"sub_total_light_profiles"
] = self.dataset.grids.lp.over_sampler.sub_total
except AttributeError:
pass

if fit.model_obj.has(cls=aa.Pixelization):
info_dict["use_w_tilde"] = fit.inversion.settings.use_w_tilde
try:
info_dict["sub_total_pixelization"] = (
self.dataset.grids.pixelization.over_sampler.sub_total
)
info_dict[
"sub_total_pixelization"
] = self.dataset.grids.pixelization.over_sampler.sub_total
except AttributeError:
pass
info_dict["use_positive_only_solver"] = (
Expand Down
11 changes: 8 additions & 3 deletions autogalaxy/analysis/analysis/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,14 @@ def save_attributes(self, paths: af.DirectoryPaths):
hdu=self.dataset.noise_map.hdu_for_output,
prefix="dataset",
)
paths.save_json(
name="over_sampling",
object_dict=to_dict(self.dataset.over_sampling),
paths.save_fits(
name="over_sample_size_lp",
hdu=self.dataset.grids.lp.over_sample_size.native.hdu_for_output,
prefix="dataset",
)
paths.save_fits(
name="over_sample_size_pixelization",
hdu=self.dataset.grids.pixelization.over_sample_size.native.hdu_for_output,
prefix="dataset",
)
paths.save_json(
Expand Down
3 changes: 3 additions & 0 deletions autogalaxy/analysis/chaining_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ def extra_galaxies_from(

# extra_galaxies = result.instance.extra_galaxies.as_model((LightProfile, mp.MassProfile,), fixed="centre", prior_pass=True)

if not hasattr(result.instance, "extra_galaxies"):
return None

if result.instance.extra_galaxies is None:
return None

Expand Down
Loading
Loading