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.

[1]:
from gollum.sonora import SonoraGrid
from specutils import Spectrum1D
import pandas as pd
import astropy.units as u
[2]:
from IPython.display import HTML
from IPython.display import Image

First, we will read in an example spectrum of this ultracool dwarf:

2MASS J05591914-1404488

We got its data from the Keck Telescope’s NIRSPEC spectrograph. A specific section of this data is displayed below.

[3]:
df = pd.read_csv('../../data/2mass0559_59.dat', sep=r'\s+', comment='#', names=['wave', 'flux'])
[4]:
df.head()
[4]:
wave flux
0 1.282854 0.899982
1 1.282873 0.934131
2 1.282891 0.942304
3 1.282910 0.914649
4 1.282928 0.931263

The unit for wavelength here is microns and the unit for flux is “counts”.

[5]:
bdss_spectrum = Spectrum1D(spectral_axis=df.wave.values*u.micron, flux=df.flux.values*u.ct)
[6]:
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.

[7]:
grid = SonoraGrid(wl_lo=wl_lo, wl_hi=wl_hi)
Processing Teff=2400K|logg=5.50|Z=0.5: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 891/891 [01:32<00:00,  9.64it/s]
108 files not found; grid may not cover given parameter ranges fully

Awesome! Now you can hand-in a data spectrum to overlay it onto the grid and begin fitting using the interactive sliders. You should see a good fit with the following parameters: Teff: 1125, log(g): 5, Metallicity: -0.5, Rotational Broadening: 13.5, Radial Velocity: -10.65, Normalization Scalar: 1

[8]:
grid.show_dashboard(data=bdss_spectrum, show_telluric=False)

dashboard demo

The dashboard looks great!