Skip to content

Commit

Permalink
horrible refactor nearly done
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammy2211 committed Dec 15, 2024
1 parent f8458f1 commit 7f1f9a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
11 changes: 9 additions & 2 deletions autogalaxy/aggregator/imaging/imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,20 @@ def _imaging_from(
except AttributeError:
psf = None

over_sampling = fit.value(name="dataset.over_sampling")
try:
over_sampling_uniform = aa.Array2D.from_primary_hdu(primary_hdu=fit.value(name="dataset.over_sampling_size_uniform")).native
except AttributeError:
over_sampling_uniform = 1
try:
over_sampling_pixelization = aa.Array2D.from_primary_hdu(primary_hdu=fit.value(name="dataset.over_sampling_size_pixelization")).native
except AttributeError:
over_sampling_pixelization = 1

dataset = aa.Imaging(
data=data,
noise_map=noise_map,
psf=psf,
over_sampling=over_sampling,
over_sampling=aa.OverSamplingDataset(uniform=over_sampling_uniform, pixelization=over_sampling_pixelization),
check_noise_map=False,
)

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 @@ -178,9 +178,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_sampling_size_uniform",
hdu=self.dataset.grids.uniform.over_sampling_size.native.hdu_for_output,
prefix="dataset",
)
paths.save_fits(
name="over_sampling_size_pixelization",
hdu=self.dataset.grids.pixelization.over_sampling_size.native.hdu_for_output,
prefix="dataset",
)
paths.save_json(
Expand Down

0 comments on commit 7f1f9a9

Please sign in to comment.