  Any unambiguous detection of a stochastic gravitational wave background by a
pulsar timing array will rest on the measurement of a characteristic angular
correlation between pulsars. The ability to measure this correlation will
depend on the geometry of the array. However, spatially correlated sources of
noise, such as errors in the planetary ephemeris or clock errors, can produce
false-positive correlations. The severity of this contamination will also
depend on the geometry of the array. This paper quantifies these geometric
effects with a spherical harmonic analysis of the pulsar timing residuals. At
least 9 well-spaced pulsars are needed to simultaneously measure a
gravitational wave background and separate it from ephemeris and clock errors.
Uniform distributions of pulsars can eliminate the contamination for arrays
with large numbers of pulsars, but pulsars following the galactic distribution
of known millisecond pulsars will always be affected. We quantitatively
demonstrate the need for arrays to include many pulsars and for the pulsars to
be distributed as uniformly as possible. Finally, we suggest a technique to
cleanly separate the effect of ephemeris and clock errors from the
gravitational wave signal.
