displayDipoles_170409 > v0.1 > display dipole coordinates in 3D

환경
GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 14.04 LTS desktop amd64
TensorFlow v0.11
cuDNN v5.1 for Linux
CUDA v8.0
Python 2.7.6
IPython 5.1.0 -- An enhanced Interactive Python.
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
GNU bash, version 4.3.8(1)-release (x86_64-pc-linux-gnu)

This article is related to ADDA (light scattering simulator based on the discrete dipole approximation) .

Required


  • UtilReadCoordinate.py
  • ぃ tp // 이 m / 7, f9 / ms / 309d288, 2, 246d, 42, 83

  • Coordinate file: coord.0
  • produced with modified iterative.c
  • ぃ tp // m / 7, f9 / ms / 183d1d9, 2b5, b0944689


  • coord.0 was produced with the following:
    $ ./adda -grid 25 -chp_type normal -chpoint 1s > log
    

    코드 v0.1



    Jupyter code

    displayDipoles_170409.ipynb
    from mpl_toolkits.mplot3d import Axes3D
    import matplotlib.pyplot as plt
    import numpy as np
    import sys
    
    from UtilReadCoordinate import read_coordinate_file
    
    '''
    v0.1 display dipoles in 3D
    '''
    
    res = read_coordinate_file('coord.0')
    local_nvoid_Ndip, coord = res
    
    print(local_nvoid_Ndip)
    
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    
    xs = coord[::3]
    ys = coord[1::3]
    zs = coord[2::3]
    
    print(xs[1],ys[1],zs[1])
    
    #sys.exit()
    
    for c, m, zlow, zhigh in [('r', 'o', -10, 10)]:
        ax.scatter(xs, ys, zs, c=c, marker=m)
    
    ax.set_xlabel('X Label')
    ax.set_ylabel('Y Label')
    ax.set_zlabel('Z label')
    
    plt.tight_layout()
    plt.show()
    



    Acknowledgement: @shiracamus in this

    좋은 웹페이지 즐겨찾기