# Download the required test grid from zenodo (using quiet option for no output)
!wget https://zenodo.org/record/2557923/files/phoenix_t4000_10000_w3000_9000_r3000.h5?download=1 -O test_grid.h5 -q
# Disable all warnings & logging statements from displaying in output
import warnings, logging
warnings.simplefilter('ignore')
logging.disable(logging.CRITICAL)
from starkit.gridkit import load_grid
from bqplot import pyplot as plt
from ipywidgets import interactive, IntSlider, FloatSlider
grid = load_grid('test_grid.h5')
# Prepare sliders with their min, max from extent values
teff_extent, logg_extent, mh_extent = grid.get_grid_extent()
teff_slider = IntSlider(min=teff_extent[0], max=teff_extent[1], step=1, description='Teff', continuous_update=False)
logg_slider = FloatSlider(min=logg_extent[0], max=logg_extent[1], step=0.1, description='log g', continuous_update=False)
mh_slider = FloatSlider(min=mh_extent[0], max=mh_extent[1], step=0.1, description='[M/H]', continuous_update=False)
# Function to plot spectrum
def plot_spectrum(teff, logg, mh):
grid.teff = teff
grid.logg = logg
grid.mh = mh
wave, flux = grid()
plt.figure(title='Spectrum')
plt.plot(wave,flux)
plt.xlabel('Wavelength (Ang)')
plt.ylabel('Flux')
plt.show()
# Interactively plot by binding sliders with function arguments
interactive_plot = interactive(plot_spectrum, teff=teff_slider, logg=logg_slider, mh=mh_slider)
# Fix height to prevent output from flickering
output = interactive_plot.children[-1]
output.layout.height = '600px'
interactive_plot
interactive(children=(IntSlider(value=4000, continuous_update=False, description='Teff', max=10000, min=4000),…