def parse_filename(filename, full_output=False):
    """
    Return the basic stellar parameters from the filename.
    """

    basename = filename.split("/")[-1]
    teff = basename[1:5]
    logg = basename.split("_")[1][1:]
    feh = basename.split("_")[5][1:]
    parameters = map(float, [teff, logg, feh, int(basename[0].lower() == "s")])

    if full_output:
        names = ("effective_temperature", "surface_gravity", "metallicity",
            "is_spherical?")
        return (parameters, names)
    return parameters