  Measuring the angular clustering of galaxies as a function of redshift is a
powerful method for extracting information from the three-dimensional galaxy
distribution. The precision of such measurements will dramatically increase
with ongoing and future wide-field galaxy surveys. However, these are also
increasingly sensitive to observational and astrophysical contaminants. Here,
we study the statistical properties of three methods proposed for controlling
such systematics -- template subtraction, basic mode projection, and extended
mode projection -- all of which make use of externally supplied template maps,
designed to characterise and capture the spatial variations of potential
systematic effects. Based on a detailed mathematical analysis, and in agreement
with simulations, we find that the template subtraction method in its original
formulation returns biased estimates of the galaxy angular clustering. We
derive closed-form expressions that should be used to correct results for this
shortcoming. Turning to the basic mode projection algorithm, we prove it to be
free of any bias, whereas we conclude that results computed with extended mode
projection are biased. Within a simplified setup, we derive analytical
expressions for the bias and discuss the options for correcting it in more
realistic configurations. Common to all three methods is an increased estimator
variance induced by the cleaning process, albeit at different levels. These
results enable unbiased high-precision clustering measurements in the presence
of spatially-varying systematics, an essential step towards realising the full
potential of current and planned galaxy surveys.
