<jupyter_start><jupyter_text>LCFit band-by-band using python (`pycoco`)--- AimTo fit the band with the best sampling first, then propagate the best fit params forward as a initial guess for the other bands. Should help constrain the peak.<jupyter_code># %matplotlib inline
%matplotlib notebook

try:
    from importlib import reload
except:
    pass

from __future__ import print_function ## Force python3-like printing

from matplotlib import pyplot as plt
from matplotlib import rc
rc('text', usetex=True)

import os
import sys
import numpy as np
from astropy.table import Table

import pycoco as pcc

reload(pcc) ## FOR DEV
reload(pcc.defaults)
reload(pcc.functions)

import pyCoCo as pccsims
# filter_path = "/Users/berto/Code/CoCo/data/filters"
# coco_root_path = "/Users/berto/Code/CoCo"
coco_root_path = os.environ["COCO_ROOT_DIR"]
filter_path = os.path.join(coco_root_path, "data/filters")

coco = pccsims.pyCoCo(pcc.utils.b(filter_path), pcc.utils.b(coco_root_path))<jupyter_output><empty_output><jupyter_text>inputs:* **`snname`*** **`redshift`*** **`absmag offset`*** **`EBV MW`*** **`EBV Host`*** **`Rv`*** **`MJD at Peak`*** **`MJD to simulate`*** **`filters to simulate`**<jupyter_code>sn = pcc.classes.SNClass("SN2006aj")
print(sn.name)
sn.load_phot( path = os.path.join(coco_root_path, 'data/lc/' + sn.name + '.dat'))
sn.load_list(os.path.join(coco_root_path,"lists/" + sn.name + ".list"))
sn.load_spec()
# sn.check_overlaps()
sn.get_lcfit(os.path.join(coco_root_path, "recon/" + sn.name + ".dat"))
sn.plot_lc()<jupyter_output><empty_output><jupyter_text>Find the band with the best data---What metric to use...  - Epochs? - S/N<jupyter_code>verbose=True

for band in sn.phot.data:
    if verbose: print(band)
    length = len(sn.phot.data[band])
    print(length)<jupyter_output>BessellB
36
BessellV
47
BessellR
58
BessellI
34
{'fraction_non_alphanumeric': 0.14650027129679868, 'fraction_numerical': 0.00705371676614216, 'mean_word_length': 5.492957746478873, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '599602', 'license': 'MIT', 'n_tokens_mistral': 720, 'n_tokens_neox': 700, 'n_words': 165, 'path': 'notebooks/CoCo_SN_lcfit_Test_splitting.ipynb', 'repo_name': 'RobFirth/pycoco', 'size': '1843'}