Spherical Harmonics in Atomic Orbitals and Magnetic Fields