for matkey in st_json.keys(): tmp_st = st_json[matkey] st = Structure.from_dict(tmp_st['st_after']) bulkkey = ext_bulk_soap(matkey, bulkkeys) st_bulk = Structure.from_dict(st_bulk_json[bulkkey]) slab = Slab(lattice=st.lattice, species=st.species, coords=st.frac_coords, miller_index=[1, 1, 1], oriented_unit_cell=st_bulk, shift=0, scale_factor=1, reorient_lattice=False) print(slab.is_symmetric(), slab.have_equivalent_surfaces()) surface_sites = [] surface_sites_prop = [] for tol in [0.0, 0.25, 0.5]: tmp_surface_sites = get_surface_sites(slab, tol=tol) surface_sites_prop.append(slab.site_properties['is_surf_site']) surface_sites_prop = np.asarray(surface_sites_prop) surface_sites_prop = np.any(surface_sites_prop, axis=0) surface_sites = np.arange(0, slab.num_sites, 1)[surface_sites_prop] surface_sites = [ i for i in surface_sites if slab[i].frac_coords[2] > slab.center_of_mass[2] ] # top only surface_sites_top = np.zeros(slab.num_sites, dtype=bool) surface_sites_top[surface_sites] = True