Measuring topology from dynamics by obtaining the Chern number from a linking number