Measurements of the interplanetary magnetic field in relation to the modulation of cosmic rays