def read_microscope_metadata(fname: str) -> dict:
    """Reads the Microscope metadata of the Elettra LEEM file format

    Parameters
    ----------
    fname : str
        Filename of microcope file

    Returns
    -------
    dict
        Dictionary containing metadata
    """

    idict = {}
    with open(fname, "r", encoding="latin-1") as f:

        for line in f:
            key, val = line.strip("\n ").split(", ")
            if key == "disabled" or key == "invalid":
                continue
            if key == "Operation Mode":
                key = "fov"
            elif key == "Emission":
                key = "Emission Cur."

            if key != "fov":
                val = float(val)

            idict[key] = val

    return idict