  The spin coherence time of $^{151}$Eu$^{3+}$ which substitutes the yttrium at
site 1 in Y$_2$SiO$_5$ crystal has been extended to 6 hours in a recent work
[\textit{Nature} \textbf{517}, 177 (2015)]. To make this long-lived spin
coherence useful for optical quantum memory applications, we experimentally
characterize the hyperfine interaction of the optically-excited state $^5$D$_0$
using Raman-heterodyne-detected nuclear magnetic resonance. The effective spin
Hamiltonians for excited and ground state are fitted based on the experimental
spectra obtained in 200 magnetic fields with various orientations. To show the
correctness of the fitted parameters and potential application in quantum
memory protocols, we also characterize the ground-state hyperfine interaction
and predict the critical magnetic field which produces the 6-hour-long
coherence time. The complete energy level structure for both the $^7$F$_0$
ground state and $^5$D$_0$ excited state at the critical magnetic field are
obtained. These results enable the design of quantum memory protocols and the
optimization of optical pumping strategy for realization of photonic quantum
memory with hour-long lifetime.
