In [1]:
from __future__ import print_function, division
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(context="poster")
# from IPython.display import display, Math
from ipywidgets import interactive, interact_manual, \
RadioButtons, FloatSlider, fixed
import numpy as np
# from astropy.modeling import models, fitting
## Boilerplate path hack to give access to full clustered_SNe package
import sys, os
if __package__ is None:
if os.pardir not in sys.path[0]:
file_dir = os.getcwd()
sys.path.insert(0, os.path.join(file_dir,
os.pardir,
os.pardir))
from clustered_SNe.analysis.visualize_helpers import parameter_study_wrapper
from clustered_SNe.analysis.thornton_helpers import ThorntonParameterStudy, \
energies
In [2]:
data_dir = "../saved_runs/thornton"
thornton_parameter_study = ThorntonParameterStudy(data_dir)
In [3]:
run_summary = RunSummary()
result_widget_parameter_study = interact_manual(parameter_study_wrapper,
data_dir = fixed(data_dir),
log_Z = FloatSlider(min=-3.0, max=+0.5, step=0.5, value=0),
log_n = FloatSlider(min=-3.0, max=+3.0, step=1.0, value=-1),
T = fixed(1e4),
with_cooling = True)
def update_run_summary_parameter_study(widget):
"""Copy the latest result into run_summarya
Don't reuse this function definition; needs to be bound to the correct result_widget"""
run_summary.replace_with(result_widget_parameter_study.widget.result)
result_widget_parameter_study.widget.children[-1].on_click(update_run_summary_parameter_study)
In [4]:
thornton_parameter_study.df.head()
Out[4]:
In [5]:
interactive(thornton_parameter_study.plot_one_number_density,
energy = RadioButtons(options=energies))
In [6]:
interactive(thornton_parameter_study.plot_one_metallicity,
energy = RadioButtons(options=energies))