Skip to content

Commit

Permalink
Merge branch 'satakihino' into marcosertoli/satakihino
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosertoli authored Jul 18, 2023
2 parents 5152222 + 4dbeddd commit fd01f98
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions indica/workflows/example_bayes_opt_brems.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
from indica.workflows.bayes_workflow import plot_bayes_result
from indica.workflows.bayes_workflow import sample_with_autocorr

# import matplotlib.pylab as plt
from indica.bayesmodels import BayesModels
from indica.bayesmodels import get_uniform
from indica.models.helike_spectroscopy import Helike_spectroscopy
from indica.models.interferometry import Interferometry
from indica.models.plasma import Plasma
from indica.readers.read_st40 import ReadST40
from indica.workflows.bayes_workflow import plot_bayes_result
from indica.workflows.bayes_workflow import sample_with_autocorr
import indica.readers.read_st40 as read_st40
from indica.models.diode_filters import BremsstrahlungDiode

# TODO: allow conditional prior usage even when only
# one param is being optimisied i.e. 1 is constant
Expand Down Expand Up @@ -116,7 +125,6 @@ def run(
],
priors=priors,
)

ndim = param_names.__len__()
start_points = bm.sample_from_priors(param_names, size=nwalkers)
move = [(emcee.moves.StretchMove(), 1.0), (emcee.moves.DEMove(), 0.0)]
Expand Down Expand Up @@ -158,7 +166,6 @@ def run(
print(sampler.acceptance_fraction.sum())
plot_bayes_result(**result, figheader=result_path)


if __name__ == "__main__":
phantom_profile_params = {
"Ne_prof.y0": 5e19,
Expand All @@ -169,7 +176,7 @@ def run(
"Ne_prof.wped": 2,
"Nimp_prof.y0": 1e18,
"Nimp_prof.y1": 1e17,
"Nimp_prof.peaking": 7, # 2
"Nimp_prof.peaking": 7,
"Te_prof.y0": 3000,
"Te_prof.peaking": 2,
"Ti_prof.y0": 5000,
Expand Down

0 comments on commit fd01f98

Please sign in to comment.