code: def optimise_z(z, *args):
      
      x, y, elements, coordinates = args
      window_com = np.array([x, y, z])
      return pore_diameter(elements, coordinates, com=window_com)[0]
docs: Return pore diameter for coordinates optimisation in z direction.