"""喉に固有の残差を比で見る: (喉の模型÷実測)÷(頭頂の模型÷実測)。1 なら喉に固有のずれは無い。
一律の割合の補正（全寸法×s）ではこの比は（分散が小さければ）ほぼ変わらない。nm の差の指標と並べる。"""
import table2_model as m
from residual_map import EMP
from centroid_peak import both
def cen(L): return both(L)[1]
for lab, f in (('ker そのまま', 1.0), ('ker 0', 0.0)):
    out = []
    for sp in ('branickii', 'hybrid', 'gularis'):
        q = {}
        for patch in ('gorget', 'crown'):
            air, cor, ker, lay, mel, ptt = m.T2[(sp, patch)]
            q[patch] = cen(m.stack(air, cor, max(ker*f, 0.001), lay, mel, ptt)) / EMP[(sp, patch)]
        out.append(f"{q['gorget']/q['crown']:.3f}")
    print(f'{lab:10s} 比の指標 ' + ' / '.join(out), flush=True)
