Study: Herd animals detect Earth's magnetic field