diff --git a/docs/autocorrintro.rst b/docs/autocorrintro.rst index f09b6f66..1b98fbf3 100644 --- a/docs/autocorrintro.rst +++ b/docs/autocorrintro.rst @@ -36,7 +36,7 @@ using the ``minAfactor`` argument when calling the MCMC. The autocorrelation factor is calculated for each parameter and the minimum of these values is returned in real time as the MCMC run progresses. -Once the minimum autocorrelation factor is below ``minAfactor``, this criterion +Once the minimum autocorrelation factor is above ``minAfactor``, this criterion for convergence is met. Whether or not ``minAfactor`` has been satisfied can be seen in the autocorrelation plot below. Once the maximum autocorrelation time has passed the dashed line labeled 'Autocorrelation Factor Criterion,' the chain is likely converged. After five consecutive status checks appear past the dashed line, the MCMC will halt if all other criterion have also been met. diff --git a/docs/tutorials/GaussianProcess-tutorial.ipynb b/docs/tutorials/GaussianProcess-tutorial.ipynb index 033582d9..0e3d8c92 100644 --- a/docs/tutorials/GaussianProcess-tutorial.ipynb +++ b/docs/tutorials/GaussianProcess-tutorial.ipynb @@ -270,7 +270,7 @@ " )\n", " # Add in instrument parameters\n", " like.params['gamma_'+tel_suffix] = radvel.Parameter(value=np.mean(vel[indices]), vary=False, linear=True)\n", - " like.params['jit_'+tel_suffix] = radvel.Parameter(value=jit_guesses[tel_suffix], vary=False, linear=True) \n", + " like.params['jit_'+tel_suffix] = radvel.Parameter(value=jit_guesses[tel_suffix], vary=True)\n", " likes.append(like)\n", "\n", "\n", @@ -594,4 +594,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/radvel/__init__.py b/radvel/__init__.py index a4074d46..9a1e31bb 100644 --- a/radvel/__init__.py +++ b/radvel/__init__.py @@ -29,7 +29,7 @@ def _custom_warningfmt(msg, *a, **b): __all__ = ['model', 'likelihood', 'posterior', 'mcmc', 'prior', 'utils', 'fitting', 'report', 'cli', 'driver', 'gp'] -__version__ = '1.4.2' +__version__ = '1.4.3' __spec__ = __name__ __package__ = __path__[0] diff --git a/radvel/mcmc.py b/radvel/mcmc.py index 8ed3aca6..f940b119 100644 --- a/radvel/mcmc.py +++ b/radvel/mcmc.py @@ -235,7 +235,7 @@ def mcmc(post, nwalkers=50, nrun=10000, ensembles=8, checkinterval=50, minAfacto if proceedname is None: raise ValueError('proceed set to true but no proceedname provided') else: - h5p = h5py.File(savename, 'r') + h5p = h5py.File(proceedname, 'r') msg = 'Loading chains and run information from previous MCMC' print(msg) statevars.prechains = [] @@ -328,7 +328,7 @@ def mcmc(post, nwalkers=50, nrun=10000, ensembles=8, checkinterval=50, minAfacto if not proceed: statevars.initial_positions.append(p0) else: - statevars.initial_positions.append(statevars.prechains[i][-1, :, :]) + statevars.initial_positions.append(statevars.prechains[e][-1, :, :]) statevars.samplers.append(emcee.EnsembleSampler(statevars.nwalkers, statevars.ndim, post.logprob_array, threads=1)) diff --git a/radvel/model.py b/radvel/model.py index 641cce0c..8ade16d5 100644 --- a/radvel/model.py +++ b/radvel/model.py @@ -229,13 +229,13 @@ def dict_to_vector(self): self.vector = vector def vector_names(self): - names = [0] * (len(self.params.keys())) + names = [0] * (len(self.params.keys()) + 2) for key in self.params.keys(): try: names[self.indices[key]] = key except KeyError: pass - self.names = names + self.names = [i for i in names if type(i) == str] def vector_to_dict(self): for key in self.params.keys(): diff --git a/radvel/plot/orbit_plots.py b/radvel/plot/orbit_plots.py index 10ec789e..2956c8c7 100644 --- a/radvel/plot/orbit_plots.py +++ b/radvel/plot/orbit_plots.py @@ -4,6 +4,7 @@ from matplotlib import pyplot as pl from matplotlib.ticker import MaxNLocator from astropy.time import Time +import copy import radvel from radvel import plot @@ -65,7 +66,7 @@ def __init__(self, post, saveplot=None, epoch=2450000, yscale_auto=False, yscale figwidth=7.5, fit_linewidth=2.0, set_xlim=None, text_size=9, highlight_last=False, show_rms=False, legend_kwargs=dict(loc='best'), status=None): - self.post = post + self.post = copy.deepcopy(post) self.saveplot = saveplot self.epoch = epoch self.yscale_auto = yscale_auto @@ -103,7 +104,8 @@ def __init__(self, post, saveplot=None, epoch=2450000, yscale_auto=False, yscale # convert params to synth basis synthparams = self.post.params.basis.to_synth(self.post.params) - self.post.params.update(synthparams) + self.post.params = synthparams + self.post.vector.dict_to_vector() self.model = self.post.likelihood.model self.rvtimes = self.post.likelihood.x