<jupyter_start><jupyter_text>SNe Ia TemplatesPlot the SN Ia templates as a function wavelength. There should be 104 templates in v3.0 between 1000 and 25000 &Aring;, corresponding to 104 epochs between -18 and +85 days from peak luminosity.<jupyter_code>import os
import numpy as np
import matplotlib.pyplot as plt

import matplotlib
import seaborn as sns

sns.set(style='white', font_scale=1.8, font='sans-serif')
colors = sns.color_palette('Set2', n_colors=8, desat=0.75)
from desisim.io import read_basis_templates
flux, wave, meta = read_basis_templates('SNE')
print(meta['EPOCH'][0], meta['EPOCH'][-1])
# Find the location 
peak_idx = np.where(meta['EPOCH'].data == 0.)[0]

Nsne = len(flux)
idx = np.arange(2, Nsne, 4)
ncol = 3
nrow = int(len(idx) / ncol)
fig, axes = plt.subplots(nrow, ncol, figsize=(4*ncol, 3*nrow), sharex=True, sharey=True)
for i, ax in zip(idx, axes.flatten()):
    ax.plot(wave, flux[i], color=colors[0])
    
    if peak_idx.size > 0:
        j = peak_idx[0]
        ax.plot(wave, flux[j], 'k:', alpha=0.5)
    
    epoch = 'epoch: {:g} days'.format(meta['EPOCH'][i])
    ax.text(0.93, 0.93, epoch, ha='right', va='top',
            transform=ax.transAxes, fontsize=14)
    
    ax.set(xlim=(wave[0], 10000))
    ax.xaxis.set_major_locator(plt.MaxNLocator(3))
    ax.yaxis.set_ticks([])
    ax.margins(0.2)
    
    
fig.subplots_adjust(wspace=0.05, hspace=0.05, top=0.93)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15793151642208245, 'fraction_numerical': 0.047519217330538085, 'mean_word_length': 4.264705882352941, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '451136', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 621, 'n_tokens_neox': 571, 'n_words': 129, 'path': 'doc/nb/sne-templates.ipynb', 'repo_name': 'HiramHerrera/desisim', 'size': '1431'}