/doc/ase/gui/basics.rst

https://gitlab.com/vote539/ase · ReStructuredText · 190 lines · 135 code · 55 blank · 0 comment · 0 complexity · cfd0d3e02369531ffadfa59c601dd370 MD5 · raw file

  1. .. module:: basics
  2. =======================================
  3. ase-gui basics and command line options
  4. =======================================
  5. General use
  6. -----------
  7. Visualizing a system with ase-gui is straight-forward using a regular
  8. mouse. The scroll function allows to change the magnification, the
  9. left mouse button selects atoms, the right mouse button allows to
  10. rotate, and the middle button allows to translate the system on the
  11. screen.
  12. Depending on the number of selected atoms, ase-gui automatically measures
  13. different quantities:
  14. ================================= ======================================
  15. Selection measurement
  16. ================================= ======================================
  17. single atom xyz position and atomic symbol
  18. two atoms interatomic distance and symbols
  19. three atoms all three internal angles and
  20. symbols
  21. four atoms, selected sequentially Measures the dihedral angle,
  22. e.g. the angle between bonds 12 and 34
  23. more than four atoms chemical composition of selection.
  24. ================================= ======================================
  25. ase-gui can save the following file formats:
  26. =========== =================================
  27. File format Comment
  28. =========== =================================
  29. xyz XYZ file
  30. traj ASE trajectory
  31. pdb PDB file
  32. cube Gaussian cube file
  33. py Python script
  34. vnl VNL file
  35. png Portable Network Graphics
  36. pov Persistance of Vision
  37. eps Encapsulated PostScript
  38. in FHI-aims geometry input
  39. POSCAR VASP geometry input
  40. bundle ASE bundle trajectory
  41. cif Crystallographic Information File
  42. =========== =================================
  43. Files
  44. -----
  45. The :ref:`ase-gui` program can read all the file formats the ASE's
  46. :func:`~ase.io.read` function can understand.
  47. ::
  48. $ ase-gui N2Fe110-path.traj
  49. Selecting part of a trajectory
  50. ------------------------------
  51. A Python-like syntax for selecting a subset of configurations can be
  52. used. Instead of the Python syntax ``list[start:stop:step]``, you use
  53. :file:`filaname@start:stop:step`::
  54. $ ase-gui x.traj@0:10:1 # first 10 images
  55. $ ase-gui x.traj@0:10 # first 10 images
  56. $ ase-gui x.traj@:10 # first 10 images
  57. $ ase-gui x.traj@-10: # last 10 images
  58. $ ase-gui x.traj@0 # first image
  59. $ ase-gui x.traj@-1 # last image
  60. $ ase-gui x.traj@::2 # every second image
  61. If you want to select the same range from many files, the you can use
  62. the :option:`-n` or :option:`--image-number` option::
  63. $ ase-gui -n -1 *.traj # last image from all files
  64. $ ase-gui -n 0 *.traj # first image from all files
  65. .. tip::
  66. Type :command:`ase-gui -h` for a description of all command line options.
  67. Writing files
  68. -------------
  69. ::
  70. $ ase-gui -n -1 a*.traj -o new.traj
  71. Possible formats are: ``traj``, ``xyz``, ``cube``, ``pdb``, ``eps``,
  72. ``png``, and ``pov``. For details, see the :mod:`~ase.io` module
  73. documentation.
  74. Interactive use
  75. ---------------
  76. The :ref:`ase-gui` program can also be launched directly from a Python
  77. script or interactive session:
  78. >>> from ase import *
  79. >>> atoms = ...
  80. >>> view(atoms)
  81. or
  82. >>> view(atoms, repeat=(3, 3, 2))
  83. or, to keep changes to your atoms:
  84. >>> atoms.edit()
  85. NEB calculations
  86. ----------------
  87. Use :menuselection:`Tools --> NEB` to plot energy barrier.
  88. ::
  89. $ ase-gui --interpolate 3 initial.xyz final.xyz -o interpolated_path.traj
  90. Plotting data from the command line
  91. -----------------------------------
  92. Plot the energy relative to the energy of the first image as a
  93. function of the distance between atom 0 and 5::
  94. $ ase-gui -g "d(0,5),e-E[0]" x.traj
  95. $ ase-gui -t -g "d(0,5),e-E[0]" x.traj > x.dat # No GUI, write data to stdout
  96. The symbols are the same as used in the plotting data function.
  97. Defaults for ase-gui
  98. --------------------
  99. Using a file ``~/.ase/gui.py``, certain defaults can be set. If it exists,
  100. this file is executed after initializing the variables and colours
  101. normally used in ase-gui. One can change the default graphs that are
  102. plotted, and the default radii for displaying specific atoms. This
  103. example will display the energy evolution and the maximal force in a
  104. graph and also display Cu atoms (Z=29) with a radius of 1.6 Angstrom.
  105. ::
  106. gui_default_settings['gui_graphs_string'] = "i, e - min(E), fmax"
  107. gui_default_settings['covalent_radii'] = [[29,1.6]]
  108. .. _high contrast:
  109. High contrast settings for ase-gui
  110. ----------------------------------
  111. In revision 2600 or later, it is possible to change the foreground and
  112. background colors used to draw the atoms, for instance to draw white
  113. graphics on a black background. This can be done in ``~/.ase/gui.py``.
  114. ::
  115. gui_default_settings['gui_foreground_color'] = '#ffffff' #white
  116. gui_default_settings['gui_background_color'] = '#000000' #black
  117. To change the color scheme of graphs it is necessary to change the
  118. default behaviour of Matplotlib in a similar way by using a file
  119. ``~/.matplotlib/matplotlibrc``.
  120. ::
  121. patch.edgecolor : white
  122. text.color : white
  123. axes.facecolor : black
  124. axes.edgecolor : white
  125. axes.labelcolor : white
  126. axes.color_cycle : b, g, r, c, m, y, w
  127. xtick.color : white
  128. ytick.color : white
  129. grid.color : white
  130. figure.facecolor : 0.1
  131. figure.edgecolor : black
  132. Finally, the color scheme of the windows themselves (i.e. menus, buttons
  133. and text etc.) can be changed by choosing a different desktop theme. In
  134. Ubuntu it is possible to get white on a dark background by selecting the
  135. theme HighContrastInverse under Appearances in the system settings dialog.