Make dipole analysis optional, factor out spherical projection routines