diff --git a/bxa/xspec/solver.py b/bxa/xspec/solver.py index b42d4c3..4cdc20c 100644 --- a/bxa/xspec/solver.py +++ b/bxa/xspec/solver.py @@ -62,8 +62,6 @@ def store_chain(chainfilename, transformations, posterior, fit_statistic): old_model = transformations[0]['model'] names = [] for t in transformations: - if t.get('skip_setting', False): - continue if t['model'] != old_model: group_index += 1 old_model = t['model'] @@ -89,8 +87,6 @@ def set_parameters(transformations, values): assert len(values) == len(transformations) pars = [] for i, t in enumerate(transformations): - if t.get('skip_setting', False): - continue v = t['aftertransform'](values[i]) assert not isnan(v) and not isinf(v), 'ERROR: parameter %d (index %d, %s) to be set to %f' % ( i, t['index'], t['name'], v) diff --git a/examples/xspec/series/example_simplest.py b/examples/xspec/series/example_simplest.py index d05f3fd..6deb694 100644 --- a/examples/xspec/series/example_simplest.py +++ b/examples/xspec/series/example_simplest.py @@ -90,11 +90,17 @@ def loggaussian_hierarchical_prior(cube): for i, filename in enumerate(['sim1.fak', 'sim2.fak', 'sim3.fak'], start=1): AllData("%d:%d %s" % (i, i, filename)) s1 = AllData(i) - s1.ignore("**"); s1.notice("0.2-8.0") + s1.ignore("**-0.2, 8.0-**") + print("setting up model") m1 = AllModels(i) m1.wabs.nH.values = ",,0.01,0.01,1000,1000" + m1.powerlaw.norm.values = ",,1e-10,1e-10,1e1,1e1" #m1.powerlaw.norm.values = ",,1e-10,1e-10,1e1,1e1" #m1.powerlaw.PhoIndex.values = ",,1,1,3,3" + if i != 1: + m1.powerlaw.PhoIndex.link = '=%d' % AllModels(1).powerlaw.PhoIndex.index + if i != 1: + m1.powerlaw.norm.link = '=%d' % AllModels(1).powerlaw.norm.index transformations += [ bxa.create_uniform_prior_for( m1, m1.wabs.nH), ] @@ -128,5 +134,10 @@ def loggaussian_hierarchical_prior(cube): prior_function=combined_prior, outputfiles_basename='hierarchical3/', ) -results = solver.run(resume=True) +import ultranest.stepsampler +results = solver.run(resume=True, + run_kwargs=dict(frac_remain=0.5), + stepsampler_kwargs=dict( + generate_direction=ultranest.stepsampler.generate_mixture_random_direction, + initial_max_ncalls=100000, nsteps=100)) print('running analysis ... done!')