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

    basename = filename.split("/")[-1]
    teff = float(basename.split("t")[1].split("g")[0])
    logg = float(basename.split("g")[1].split("k")[0])/10.
    feh = float(basename[1:4].replace("p", "").replace("m", "-"))/10.
    alpha = [0, 0.4][basename[4] == "a"]
    parameters = [teff, logg, feh, alpha]

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