pep8:

    temp = (np.sin(d_theta / 2) ** 2)
                 + (np.cos(theta1) * np.cos(theta2) * np.sin(d_phi / 2) ** 2)