mimical 0.0.2__py3-none-any.whl → 0.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mimical/__init__.py +1 -1
- mimical/fitting/__init__.py +1 -1
- mimical/fitting/fitter.py +10 -10
- {mimical-0.0.2.dist-info → mimical-0.0.4.dist-info}/METADATA +2 -2
- mimical-0.0.4.dist-info/RECORD +12 -0
- mimical-0.0.2.dist-info/RECORD +0 -12
- {mimical-0.0.2.dist-info → mimical-0.0.4.dist-info}/WHEEL +0 -0
- {mimical-0.0.2.dist-info → mimical-0.0.4.dist-info}/top_level.txt +0 -0
mimical/__init__.py
CHANGED
mimical/fitting/__init__.py
CHANGED
mimical/fitting/fitter.py
CHANGED
|
@@ -15,14 +15,14 @@ from ..plotting import Plotter
|
|
|
15
15
|
from ..utils import filter_set
|
|
16
16
|
|
|
17
17
|
dir_path = os.getcwd()
|
|
18
|
-
if not os.path.isdir(dir_path + "/
|
|
19
|
-
os.system('mkdir ' + dir_path + "/
|
|
20
|
-
os.system('mkdir ' + dir_path + "/
|
|
21
|
-
os.system('mkdir ' + dir_path + "/
|
|
18
|
+
if not os.path.isdir(dir_path + "/mimical"):
|
|
19
|
+
os.system('mkdir ' + dir_path + "/mimical")
|
|
20
|
+
os.system('mkdir ' + dir_path + "/mimical/plots")
|
|
21
|
+
os.system('mkdir ' + dir_path + "/mimical/posteriors")
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class mimical(object):
|
|
26
26
|
""" Bayesian Observer of Galaxies - Fit.
|
|
27
27
|
Fits multi-filter images of galaxies simultaeneously using Petrofit and Nautilus
|
|
28
28
|
by specifying either an individual filter dependency for model parameters or
|
|
@@ -147,8 +147,8 @@ class BOGfit(object):
|
|
|
147
147
|
raise Exception("Prior labels do not match model parameters.")
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
if os.path.isfile(dir_path+'/
|
|
151
|
-
samples = pd.read_csv(dir_path+'/
|
|
150
|
+
if os.path.isfile(dir_path+'/mimical/posteriors' + f'/{self.id}.txt'):
|
|
151
|
+
samples = pd.read_csv(dir_path+'/mimical/posteriors' + f'/{self.id}.txt', delimiter=' ').to_numpy()
|
|
152
152
|
|
|
153
153
|
else:
|
|
154
154
|
# Run sampler
|
|
@@ -163,19 +163,19 @@ class BOGfit(object):
|
|
|
163
163
|
|
|
164
164
|
# Plot and save the corner plot
|
|
165
165
|
corner.corner(points, weights=np.exp(log_w), bins=20, labels=np.array(self.fitter_prior.keys), color='purple', plot_datapoints=False, range=np.repeat(0.999, len(self.fitter_prior.keys)))
|
|
166
|
-
plt.savefig(dir_path+'/
|
|
166
|
+
plt.savefig(dir_path+'/mimical/plots' + f'/corner_{self.id}.pdf', bbox_inches='tight')
|
|
167
167
|
|
|
168
168
|
# Sample an appropriately weighted posterior for representative samples.
|
|
169
169
|
n_post = 10000
|
|
170
170
|
indices = np.random.choice(np.arange(points.shape[0]), size = n_post, p=np.exp(log_w))
|
|
171
171
|
samples = points[indices]
|
|
172
172
|
samples_df = pd.DataFrame(data=samples, columns=self.fitter_prior.keys)
|
|
173
|
-
samples_df.to_csv(dir_path+'/
|
|
173
|
+
samples_df.to_csv(dir_path+'/mimical/posteriors' + f'/{self.id}.txt', sep=' ', index=False)
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
# Plot and save the median-parameter fit
|
|
177
177
|
Plotter().plot_median(self.images, self.wavs, self.convolved_models, samples, list(self.fitter_prior.keys), self.prior_handler)
|
|
178
|
-
plt.savefig(dir_path+'/
|
|
178
|
+
plt.savefig(dir_path+'/mimical/plots' + f'/{self.id}_best_model.pdf', bbox_inches='tight')
|
|
179
179
|
|
|
180
180
|
# Return the median-parameter model
|
|
181
181
|
fit_dic = dict(zip((np.array((list(self.fitter_prior.keys)))+"_50").tolist(), np.median(samples, axis=0).tolist()))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mimical
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary: Intesity modelling of multiply-imaged objects
|
|
3
|
+
Version: 0.0.4
|
|
4
|
+
Summary: Intesity modelling of multiply-imaged objects
|
|
5
5
|
Author: Struan Stevenson
|
|
6
6
|
Author-email: struan.stevenson@ed.ac.uk
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
mimical/__init__.py,sha256=cBuyDtPwn6KcIkjlT7oct36jigvYDJmbZNmnt1I1QJU,75
|
|
2
|
+
mimical/fitting/__init__.py,sha256=xcnLoeBDtt4Le5NhD6GhJe2ZRPNSsEySRHFYNuJyNEQ,69
|
|
3
|
+
mimical/fitting/fitter.py,sha256=5JOJnPmvISlZ5ZJM5Nz1sYVj-uCCOmONXzbvCCj8ZnY,7690
|
|
4
|
+
mimical/fitting/prior_handler.py,sha256=yXvxbohS6f94CMRyeIViFc83hRYAj82IZNA5mzhMSRw,4193
|
|
5
|
+
mimical/plotting/__init__.py,sha256=I1ZpQA48g-YPkqwrDGgTrqaTxDUgR8n0mbBX0MdbZtU,30
|
|
6
|
+
mimical/plotting/plotting.py,sha256=OWTR-uOT4UpBw0XcKpl_uFSODuEdcfw7nIk3Sf1cOGY,2646
|
|
7
|
+
mimical/utils/__init__.py,sha256=yolMgYFpvXoHuyV-ijGo26SQ0_niw0gz__iAFgdiQiY,35
|
|
8
|
+
mimical/utils/filter_set.py,sha256=EITLa2c3FG3n1-v7KatKRwHCRyfZ4TTjsi_WM7Bz64k,6819
|
|
9
|
+
mimical-0.0.4.dist-info/METADATA,sha256=3fUVREfA3Vga9uBlFmRGh1POh_d2okQM8O3fTC2OdzQ,831
|
|
10
|
+
mimical-0.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
mimical-0.0.4.dist-info/top_level.txt,sha256=z6HTYpsoNjLUFayXjn8WyjX8C1mIbZw8Arb334cUbwc,8
|
|
12
|
+
mimical-0.0.4.dist-info/RECORD,,
|
mimical-0.0.2.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
mimical/__init__.py,sha256=jPAlI6xX4U07RG_3_BUtr34CN_jQmzuqgduf2QpCAhE,74
|
|
2
|
-
mimical/fitting/__init__.py,sha256=AVsW3xF_8s267G2EZAO7mqrr99Vdg8_AIIBwJkouvoY,68
|
|
3
|
-
mimical/fitting/fitter.py,sha256=QDI0piD7BIpXoP9vrdy5d-kHa8KCgYywfOyKvtAoW0E,7680
|
|
4
|
-
mimical/fitting/prior_handler.py,sha256=yXvxbohS6f94CMRyeIViFc83hRYAj82IZNA5mzhMSRw,4193
|
|
5
|
-
mimical/plotting/__init__.py,sha256=I1ZpQA48g-YPkqwrDGgTrqaTxDUgR8n0mbBX0MdbZtU,30
|
|
6
|
-
mimical/plotting/plotting.py,sha256=OWTR-uOT4UpBw0XcKpl_uFSODuEdcfw7nIk3Sf1cOGY,2646
|
|
7
|
-
mimical/utils/__init__.py,sha256=yolMgYFpvXoHuyV-ijGo26SQ0_niw0gz__iAFgdiQiY,35
|
|
8
|
-
mimical/utils/filter_set.py,sha256=EITLa2c3FG3n1-v7KatKRwHCRyfZ4TTjsi_WM7Bz64k,6819
|
|
9
|
-
mimical-0.0.2.dist-info/METADATA,sha256=2ZASBP2XSlBeFOtpUdmxwdKtmebyGMlFqkX7DJQnbEE,832
|
|
10
|
-
mimical-0.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
-
mimical-0.0.2.dist-info/top_level.txt,sha256=z6HTYpsoNjLUFayXjn8WyjX8C1mIbZw8Arb334cUbwc,8
|
|
12
|
-
mimical-0.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|