  Obtaining observational constraints on the role of turbulent effects for the
solar dynamo is a difficult, yet crucial, task. Without such knowledge, the
full picture of the operation mechanism of the solar dynamo cannot be formed.
The magnetic helicity spectrum provides important information about the
$\alpha$ effect. Here we demonstrate a formalism in spherical geometry to infer
magnetic helicity spectra directly from observations of the magnetic field,
taking into account the sign change of magnetic helicity across the Sun's
equator. Using an angular correlation function of the magnetic field, we
develop a method to infer spectra for magnetic energy and helicity. The
retrieval of the latter relies on a fundamental definition of helicity in terms
of linkage of magnetic flux. We apply the two-scale approach, previously used
in Cartesian geometry, to spherical geometry for systems where a sign reversal
of helicity is expected across the equator at both small and large scales. We
test the method by applying it to an analytical model of a fully helical field,
and to magneto-hydrodynamic simulations of a turbulent dynamo. The helicity
spectra computed from the vector potential available in the models are in
excellent agreement to the spectra computed solely from the magnetic field
using our method. In a next test, we use our method to obtain the helicity
spectrum from a synoptic magnetic field map corresponding to a Carrington
rotation. We observe clear signs of a bihelical spectrum of magnetic helicity.
Our formalism makes it possible to infer magnetic helicity in spherical
geometry, without the necessity of computing the magnetic vector potential.
This has the advantage of being gauge invariant. It has many applications in
solar and stellar observations, but can also be used to analyze global
magnetoconvection models of stars and compare them with observations.
