  We demonstrate how to measure in situ for heading errors of optically pumped
magnetometers (OPMs) in the challenging parameter regime of compact vapor cells
with imperfect optical pumping and high buffer gas pressure. For this, we
utilize microwave-driven Ramsey and Rabi frequency spectroscopy (FS) to
independently characterize scalar heading errors in free induction decay (FID)
signals. Both of these approaches suppress 5-nT inaccuracies in geomagnetic
fields caused by nonlinear Zeeman (NLZ) shifts in FID measurements to below 0.6
nT. For Ramsey FS, we implement short periods of microwave interrogation within
a $\pi/2-t_R-3\pi/2$ Ramsey interferometry sequence, effectively circumventing
systematic errors from off-resonant driving. Conversely, Rabi FS leverages an
atom-microwave Hamiltonian for accurate modeling of Rabi oscillation
frequencies, achieving a measurement precision down to 80 pT$/
\sqrt{\text{Hz}}$ that is limited primarily by technical microwave noise. We
show that the fundamental sensitivity of Rabi FS is 30 pT/$\sqrt{\text{Hz}}$
with our vapor cell parameters through a Cram\'er-Rao lower bound (CRLB)
analysis. This work paves the way for future investigations into the accuracy
of hyperfine structure (HFS) magnetometry and contributes to the broader
applicability of OPMs in fields ranging from navigation and geophysics to space
exploration and unexploded ordinance detection, where heading error mitigation
is essential.
