  We assess and develop techniques to remove contaminants when calculating the
3D galaxy power spectrum. We separate the process into three separate stages:
(i) removing the contaminant signal, (ii) estimating the uncontaminated
cosmological power spectrum, (iii) debiasing the resulting estimates. For (i),
we show that removing the best-fit contaminant mode subtraction), and setting
the contaminated components of the covariance to be infinite (mode
deprojection) are mathematically equivalent. For (ii), performing a Quadratic
Maximum Likelihood (QML) estimate after mode deprojection gives an optimal
unbiased solution, although it requires the manipulation of large $N_{\rm
mode}^2$ matrices ($N_{\rm mode}$ being the total number of modes)}, which is
unfeasible for recent 3D galaxy surveys. Measuring a binned average of the
modes for (ii) as proposed by \citet*[FKP]{Feldman} is faster and simpler, but
is sub-optimal and gives rise to a biased solution. We present a method to
debias the resulting FKP measurements that does not require any large matrix
calculations. We argue that the sub-optimality of the FKP estimator compared
with the QML estimator, caused by contaminants is less severe than that
commonly ignored due to the survey window.
