Skip to content

Commit 2f8167c

Browse files
Jammy2211Jammy2211
authored andcommitted
fix save attributes so they use right settings inversion
1 parent 29177d1 commit 2f8167c

2 files changed

Lines changed: 5 additions & 46 deletions

File tree

autolens/imaging/model/analysis.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -112,45 +112,3 @@ def fit_from(
112112
xp=self._xp
113113
)
114114

115-
def save_attributes(self, paths: af.DirectoryPaths):
116-
"""
117-
Before the non-linear search begins, this routine saves attributes of the `Analysis` object to the `files`
118-
folder such that they can be loaded after the analysis using PyAutoFit's database and aggregator tools.
119-
120-
121-
For this analysis, it uses the `AnalysisDataset` object's method to output the following:
122-
123-
- The settings associated with the inversion.
124-
- The settings associated with the pixelization.
125-
- The Cosmology.
126-
- The adapt image's model image and galaxy images, as `adapt_images.fits`, if used.
127-
128-
This function also outputs attributes specific to lens modeling:
129-
130-
- The positions of the brightest pixels in the lensed source which are used to discard mass models.
131-
132-
The following .fits files are also output via the plotter interface:
133-
134-
- The mask applied to the dataset, in the `PrimaryHDU` of `dataset.fits`.
135-
- The imaging dataset as `dataset.fits` (data / noise-map / psf / over sampler / etc.).
136-
137-
It is common for these attributes to be loaded by many of the template aggregator functions given in the
138-
`aggregator` modules. For example, when using the database tools to perform a fit, the default behaviour is for
139-
the dataset, settings and other attributes necessary to perform the fit to be loaded via the pickle files
140-
output by this function.
141-
142-
Parameters
143-
----------
144-
paths
145-
The paths object which manages all paths, e.g. where the non-linear search outputs are stored,
146-
visualization, and the pickled objects used by the aggregator output by this function.
147-
"""
148-
super().save_attributes(paths=paths)
149-
150-
analysis = ag.AnalysisImaging(
151-
dataset=self.dataset,
152-
)
153-
154-
analysis.save_attributes(paths=paths)
155-
156-

autolens/interferometer/model/analysis.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import numpy as np
33
from typing import Optional
44

5+
from autoconf.dictable import to_dict
6+
57
import autofit as af
68
import autoarray as aa
79
import autogalaxy as ag
@@ -208,8 +210,7 @@ def save_attributes(self, paths: af.DirectoryPaths):
208210
"""
209211
super().save_attributes(paths=paths)
210212

211-
analysis = ag.AnalysisInterferometer(
212-
dataset=self.dataset,
213+
paths.save_json(
214+
"transformer_class",
215+
to_dict(self.dataset.transformer.__class__),
213216
)
214-
215-
analysis.save_attributes(paths=paths)

0 commit comments

Comments
 (0)