Nuclear magnetic resonance refocusing pulses for inhomogeneous magnetic fields