from typing import Dict


def _read_B423_ascii_headers(metadata_bytes: bytes) -> Dict[str, float]:
    """
    Parse the ASCII part of the B423 file

    Parameters
    ----------
    metadata_bytes : bytes
        The bytes string with the metadata

    Returns
    -------
    Dict[str, float]
        Parsed metadata which includes scalings and location information
    """
    metadata_lines = metadata_bytes.decode().split("\r\n")
    metadata_lines = [x.replace("%", "") for x in metadata_lines]
    # scaling information
    metadata = [x.split(" = ") for x in metadata_lines if "=" in x]
    metadata = {x[0].strip(): float(x[1].strip()) for x in metadata}
    # loxcation information
    location = [x for x in metadata_lines if ("Lat" in x or "Lon" in x or "Alt" in x)]
    location_dict = {x[0:3]: x[3:].split(",")[0] for x in location}
    location_dict = {k: float(v.strip()) for k, v in location_dict.items()}
    metadata.update(location_dict)
    return metadata