def test_21(verbose=False, plot=False): b = phoebe.load(os.path.join(dir, '21_export.phoebe')) b.run_compute() if plot: b.plot(show=True, time=0) return b
#!pip install -I "phoebe>=2.3,<2.4" # In[2]: import phoebe from phoebe import u # units import numpy as np logger = phoebe.logger('error') # We'll then start with the bundle from the end of the [emcee tutorial](./emcee.ipynb). If you're running this notebook locally, you will need to run that first to create the `emcee_advanced_tutorials.bundle` file that we will use here. # In[3]: b = phoebe.load('emcee_advanced_tutorials.bundle') # ## init_from parameter # # In cases where [continuing emcee from a previous run](./emcee_continue_from.ipynb) is insufficient, it may be ncessary to resample a new emcee run from the results of a previous run. This can be useful in several scenarios: # # * change the number of walkers # * resample from the "best" branch when other branches are stuck (NOTE: this is making some assumptions and should be used with caution) # * change the parameters being sampled (in this case, any NEW parameter will need to have initializing distributions created manually or from some other source) # * "merge" the results from multiple emcee runs (if RV- and LC-sensitive parameters were sampled independently but now you want to resample simultaneously) # # In all of these cases, we simply need to set the `init_from` parameter to a distribution that was created from the results of a previous emcee solution. # In[4]: print(b.get_parameter(qualifier='init_from', solver='emcee_solver'))
log_level='warning', pause=True) # In[1]: # only needed if starting script from here import matplotlib.pyplot as plt plt.rc('font', family='serif', size=14, serif='STIXGeneral') plt.rc('mathtext', fontset='stix') import phoebe import numpy as np logger = phoebe.logger('error') b = phoebe.load('inverse_paper_examples_before_emcee.bundle') # In[2]: # NOTE: append .progress to view any of the following plots before the run has completed b.import_solution('inverse_paper_examples_run_emcee.py.out', solution='emcee_sol') # To get as "clean" of posterior distributions as possible, we'll override the proposed thinning value and set it to 1 (effectively disabling thinning). # In[3]: print(b.get_value('thin', solution='emcee_sol')) # In[4]: