From 31ec81823abc8aa3aa7eb15d3ef0fd775ee48a63 Mon Sep 17 00:00:00 2001 From: Gregory Ashton <gregory.ashton@ligo.org> Date: Fri, 1 May 2020 09:35:22 +1000 Subject: [PATCH] Initial work --- bilby/core/sampler/dynesty.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bilby/core/sampler/dynesty.py b/bilby/core/sampler/dynesty.py index 6dcf9fd13..768589bba 100644 --- a/bilby/core/sampler/dynesty.py +++ b/bilby/core/sampler/dynesty.py @@ -572,6 +572,16 @@ class Dynesty(NestedSampler): if self.sampler.pool is not None: self.sampler.M = self.sampler.pool.map + self.dump_samples_to_dat() + + def dump_samples_to_dat(self): + from dynesty.utils import resample_equal + sampler = self.sampler + weights = np.exp(sampler.saved_logwt - sampler.saved_logz[-1]) + samples = resample_equal(np.array(sampler.saved_v), weights) + self.search_parameter_keys + import IPython; IPython.embed() + def plot_current_state(self): if self.check_point_plot: import dynesty.plotting as dyplot -- GitLab