Calculate a bolometric correction constant for a J band magnitude based on
    a spectral type, using the fit of Wilking+ (1999AJ....117..469W).

    spt - Numerical spectral type. M0=0, M9=9, L0=10, ...

    Returns: the correction `bcj` such that `m_bol = j_abs + bcj`, or NaN if
    `spt` is out of range.

    Valid values of `spt` are between 0 and 10.

def bcj_from_spt (spt):
    """Calculate a bolometric correction constant for a J band magnitude based on
    a spectral type, using the fit of Wilking+ (1999AJ....117..469W).

    spt - Numerical spectral type. M0=0, M9=9, L0=10, ...

    Returns: the correction `bcj` such that `m_bol = j_abs + bcj`, or NaN if
    `spt` is out of range.

    Valid values of `spt` are between 0 and 10.

    """
    return np.where ((spt >= 0) & (spt <= 10),
                     1.53 + 0.148 * spt - 0.0105 * spt**2,
                     np.nan)