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