mimical 0.0.3__tar.gz → 0.0.4__tar.gz
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-0.0.3 → mimical-0.0.4}/PKG-INFO +1 -1
- {mimical-0.0.3 → mimical-0.0.4}/mimical/fitting/fitter.py +5 -5
- {mimical-0.0.3 → mimical-0.0.4}/mimical.egg-info/PKG-INFO +1 -1
- {mimical-0.0.3 → mimical-0.0.4}/setup.py +1 -1
- {mimical-0.0.3 → mimical-0.0.4}/README.md +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical/__init__.py +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical/fitting/__init__.py +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical/fitting/prior_handler.py +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical/plotting/__init__.py +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical/plotting/plotting.py +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical/utils/__init__.py +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical/utils/filter_set.py +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical.egg-info/SOURCES.txt +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical.egg-info/dependency_links.txt +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical.egg-info/requires.txt +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/mimical.egg-info/top_level.txt +0 -0
- {mimical-0.0.3 → mimical-0.0.4}/setup.cfg +0 -0
|
@@ -147,8 +147,8 @@ class mimical(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 mimical(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()))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|