Optimal power of laser beams propagating from the ground through the atmosphere to space orbits