dipole_sampleΒΆ

Sample of dipole

#!/usr/bin/env python
''' Sample of dipole
'''
import numpy as np
import matplotlib.pyplot as plt
import irfpy.util.dipole as dipole


def main():

    m = np.array([5, 0, 5.])
    r = np.array([3, 0, 1.])

    fl = dipole.fieldline(r, dipole_vector=m, ndiv=181)

    plt.plot(fl[0, :], fl[2, :])

    ## Transposed dipole (in y-z plane)  Should be the same!

    m = np.array([0, -5, -5.])
    r = np.array([0, 3, 1.])
    
    fl = dipole.fieldline(r, dipole_vector=m, ndiv=181)
    plt.plot(fl[1, :], fl[2, :])

    plt.gca().set_aspect(1)
    


if __name__ == "__main__":
    main()