Deviation refers to the response of the compass to local magnetic fields caused by the presence of iron and electric currents; one can partly compensate for these by careful location of the compass and the placement of compensating magnets under the compass itself.