python scripts to generate dipole vectors