Calculating the phase-error map