Interactively fit Brown Dwarf Spectra with the gollum
dashboard¶
In this tutorial we will see how the spectra of brown dwarfs vary as a function of their intrinsic properties. We will fit observed spectra of a particular brown dwarf with the gollum dashboard, a dashboard which fits models based on properties including effective temperature, surface gravity, metallicity, rotational broadening, and radial velocity. The fitting for this tutorial will be based on the Sonora-Bobcat 2021 models, which takes into account effective temperature, surface gravity, and metallicity as intrinsic values.
[ ]:
from gollum.sonora import SonoraGrid
from specutils import Spectrum1D
import pandas as pd
import astropy.units as u
[ ]:
from IPython.display import HTML
from IPython.display import Image
First, we will read in an example spectrum of this ultracool dwarf:
We got its data from the Keck Telescope’s NIRSPEC spectrograph. A specific section of this data is displayed below.
[ ]:
df = pd.read_csv('../../data/2mass0559_59.dat',
delim_whitespace=True,
comment='#',
names=['wave', 'flux'])
[ ]:
df.head()
The unit for wavelength here is microns and the unit for flux is “counts”.
[ ]:
bdss_spectrum = Spectrum1D(spectral_axis=df.wave.values*u.micron,
flux=df.flux.values*u.ct)
[ ]:
wl_lo, wl_hi = (bdss_spectrum.wavelength.value.min(),
bdss_spectrum.wavelength.value.max())
Next, we can read in the Sonora-Bobcat grid and show an interactive dashboard.
[ ]:
grid = SonoraGrid(wl_lo=wl_lo, wl_hi=wl_hi)
Awesome! Now you can hand-in a data spectrum to overlay it onto the grid and begin fitting using the interactive sliders.
[ ]:
grid.show_dashboard(data=bdss_spectrum, show_telluric=False)
The dashboard looks great!