Note

This tutorial was generated from a Jupyter notebook that can be downloaded here.

Spectrally variable SPOT

In this notebook we’ll instantiate a Doppler map with spectrally variable features and visualize it with the interactive show() method. The plots below are fully interactive: move the mouse and scroll over the maps to control the spectra that are displayed below them.

[4]:
import starry
import numpy as np
[5]:
# Instantiate
map = starry.DopplerMap(15, nt=20, nc=4, inc=60, veq=30000)

# Four images containing each of the letters in "SPOT"
# We'll flip them so that they are bright
image = np.flipud(plt.imread(starry_path / "img" / "spot.png"))
image = np.mean(image[:, :, :3], axis=2)
nlat, nlon = image.shape
images = np.zeros((4, nlat, nlon))
for n in range(4):
    images[n] = np.zeros_like(image)
    idx = slice(n * nlon // 4, (n + 1) * nlon // 4)
    images[n][:, idx] = 1 - image[:, idx]
images += 0.1

# Four corresponding absorption lines
mu = np.array([642.925, 642.975, 643.025, 643.075])
sig = 0.0085
dw = map.wav0.reshape(1, -1) - mu.reshape(-1, 1)
spectra = 1.0 - np.exp(-0.5 * dw ** 2 / sig ** 2)

# Load it all into the map
map.load(maps=images, spectra=spectra, smoothing=0.075)

# Visualize
map.visualize()

Click here to pop out the visualization.