def keep_accessible_residues(naccess_rsa):
    """From the output of naccess we keep only accessible residues
    which have a all_atoms_rel value > 30 (arbitrary threshold)

    Args:
        naccess_rsa: A dictionnary containing the output of naccess's calculations

    Returns:
        dict: Keys are the residue ids and as value their solvant accessible area
    """
    accessible_residues_dict = {}
    for (chain_id, res_id), data_dict in naccess_rsa.items():
        for key, val in data_dict.items():
            if key == "all_atoms_rel" and val >= 30:
                accessible_residues_dict[res_id[1]] = val
    return accessible_residues_dict