<jupyter_start><jupyter_text>load data<jupyter_code>df_conf = pd.read_csv('../data/CLS_conf_inf.csv')
df_conf['a2 [fm2]'] = df_conf['a [fm]'].apply(lambda x: x**2)
df_conf['a_inv [GeV]'] = (hbarc / df_conf['a [fm]']).round(3) # add lattice unit
df_conf
# for utility
lat_unit_dic = df_conf.set_index('Label')['a [fm]'].to_dict()
a_inv_dic = df_conf.set_index('Label')['a_inv [GeV]'].to_dict()
L_fm_dic = df_conf.set_index('Label')['L [fm]'].to_dict()
L_dic = df_conf.set_index('Label')['size_L'].to_dict()
pion_mass_dic = df_conf.set_index('Label')['m_pi [MeV]'].to_dict()
baryon_mass_dic = df_conf.set_index('Label')['m_B [GeV]'].to_dict()
label_list = list(df_conf['Label'])

with sns.color_palette('tab10'):
    fig, ax = plt.subplots(figsize=(12, 6))
    for label in label_list:
        if label in ['E5', 'E1']: continue
        a2 = lat_unit_dic.get(label)**2
        L_fm = L_fm_dic.get(label)
        ax.plot(a2, L_fm, 'X', ms=25)
        ax.text(a2, L_fm+0.05, fr'{label} ($L = {L_dic.get(label)}$)')
    ax.set(xlabel=r'$a^2$ [fm$^2$]', ylabel='$L$ [fm]', xlim=(0.0018, 0.0122), ylim=(1.95, 3.25))
#    fig.savefig('../figs/SU3_ensembles.png', bbox_inches='tight')
ld_dic = {}
for fname in glob.glob('../data/pcot_p2/*.json'):
    with open(fname, 'r') as fin:
        tmp = json.load(fin)
        ld_dic[(tmp.get('label'), tmp.get('frame'), tmp.get('level'))] = tmp
color_list = {'P000': 'dimgray', 'P001': 'firebrick', 'P011': 'darkorange', 'P111': 'mediumturquoise', 'P002': 'ghostwhite'}

L_fm_dic.get(label)
clist = list(sns.color_palette('coolwarm_r', 4))

xlim = (-0.8, 1.8)
ylim = (-0.8, 1.0)

for frame in ['P000', 'P001', 'P011', 'P111', 'P002']:
    fig, ax = plt.subplots(figsize=(12, 6))

    for label, ls, c in zip(['N202', 'H101', 'N300', 'H200'], ['-', '--', '-.', ':'], clist):
        for level in [0, 1]:
            try:
                ld = ld_dic[(label, frame, level)]

                if level == 0:
                    lbl = fr'$La = {L_fm_dic.get(label):.1f}$ fm'
                else:
                    lbl = ''
                ax.plot(ld.get('k2mpi2_ref'), ld.get('kcot_mpi_ref'), ls=ls, color=c, lw=3, zorder=3, label=lbl)


            except:
                pass

    xbs = np.concatenate([np.linspace(xlim[0], -0.5e-1), np.linspace(-0.5e-1, -2e-4)])
    ax.plot(xbs, - np.sqrt(-xbs), color='black', ls='-', lw=5)

    ax.legend(loc='upper left', bbox_to_anchor=(1,1))
    ax.axhline(0, color='black')
    ax.axvline(0, color='black')
    ax.set(ylim=ylim, xlim=xlim, xlabel=r'$(p/m_\pi)^2$', ylabel=r'$p\cot\delta/m_\pi$',
          title=rf'{frame}')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22907153729071536, 'fraction_numerical': 0.04452054794520548, 'mean_word_length': 3.3743760399334444, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '253221', 'license': 'MIT', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1145, 'n_words': 187, 'path': 'notebook/FV_condition.ipynb', 'repo_name': 'tkmiriya/weakly_bound_h', 'size': '2628'}