mimical 0.0.5__tar.gz → 0.0.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mimical
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: Intesity modelling of multiply-imaged objects
5
5
  Author: Struan Stevenson
6
6
  Author-email: struan.stevenson@ed.ac.uk
@@ -149,7 +149,7 @@ class mimical(object):
149
149
 
150
150
 
151
151
  if os.path.isfile(dir_path+'/mimical/posteriors' + f'/{self.id}.txt'):
152
- samples = pd.read_csv(dir_path+'/mimical/posteriors' + f'/{self.id}.txt', delimiter=' ').to_numpy()
152
+ self.samples = pd.read_csv(dir_path+'/mimical/posteriors' + f'/{self.id}.txt', delimiter=' ').to_numpy()
153
153
 
154
154
  else:
155
155
  # Run sampler
@@ -169,20 +169,22 @@ class mimical(object):
169
169
  # Sample an appropriately weighted posterior for representative samples.
170
170
  n_post = 10000
171
171
  indices = np.random.choice(np.arange(points.shape[0]), size = n_post, p=np.exp(log_w))
172
- samples = points[indices]
173
- samples_df = pd.DataFrame(data=samples, columns=self.fitter_prior.keys)
172
+ self.samples = points[indices]
173
+ samples_df = pd.DataFrame(data=self.samples, columns=self.fitter_prior.keys)
174
174
  samples_df.to_csv(dir_path+'/mimical/posteriors' + f'/{self.id}.txt', sep=' ', index=False)
175
175
 
176
-
177
- # Plot and save the median-parameter fit
178
- Plotter().plot_median(self.images, self.wavs, self.convolved_models, samples, list(self.fitter_prior.keys), self.prior_handler)
179
- plt.savefig(dir_path+'/mimical/plots' + f'/{self.id}_best_model.pdf', bbox_inches='tight')
180
-
181
176
  # Return the median-parameter model
182
- fit_dic = dict(zip((np.array((list(self.fitter_prior.keys)))+"_50").tolist(), np.median(samples, axis=0).tolist()))
177
+ fit_dic = dict(zip((np.array((list(self.fitter_prior.keys)))+"_50").tolist(), np.median(self.samples, axis=0).tolist()))
183
178
 
184
179
  print("Finished.")
185
180
  print(" ")
186
181
 
187
182
  return fit_dic
183
+
184
+
185
+ def plot_model(self):
186
+ # Plot and save the median-parameter fit
187
+ Plotter().plot_median(self.images, self.wavs, self.convolved_models, self.samples, list(self.fitter_prior.keys), self.prior_handler)
188
+ plt.savefig(dir_path+'/mimical/plots' + f'/{self.id}_best_model.pdf', bbox_inches='tight')
189
+
188
190
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mimical
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: Intesity modelling of multiply-imaged objects
5
5
  Author: Struan Stevenson
6
6
  Author-email: struan.stevenson@ed.ac.uk
@@ -8,7 +8,7 @@ long_description = (this_directory / "README.md").read_text()
8
8
  setup(
9
9
  name='mimical',
10
10
 
11
- version='0.0.5',
11
+ version='0.0.6',
12
12
 
13
13
  description='Intesity modelling of multiply-imaged objects',
14
14
 
File without changes
File without changes
File without changes