A uniform magnetic field can be made by making a relatively long cylindrical coil. Once current is flowing through the coil a uniform magnetic field will exist all along the inside of the coil. This is not true at the very ends of the coil. Helmholtz coils can be bought for the very reason of supplying a uniform magnetic field. In either case, the uniform magnetic fields allow for calibration.