ascii-phonons
Blender extensions for illustrations of phonons
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 12 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.7%) to scientific vocabulary
Repository
Blender extensions for illustrations of phonons
Basic Info
Statistics
- Stars: 64
- Watchers: 5
- Forks: 23
- Open Issues: 14
- Releases: 6
Metadata Files
README.md
ascii-phonons
Visualisation of crystal vibrations with Blender.
Visualisation is a powerful tool for the study of vibrations in the solid state. "Semi-automatic" animations have been generated for scientific publications, where they provide insight to spectroscopic observations.[1,2] (Images 1, 2.) In order to make this type of imagery more accessible, and add some visual interest to ajjackson's PhD thesis, a more convenient and automatic toolchain is desirable.

A presentation outlining some features and implementation details is available online.
Features
- Ascii-phonons produces PNG and animated GIF files to illustrate phonon modes.
- The output has an attractive "cartoon-like" visual style with flat colours and outlines.
- A single mode may be visualised, or a tiled array of all modes labelled by frequency.
- Arrows may also be used to indicate the atomic movements; this is vital for static images in printed publications.
- Supercells are used to show the phase difference between neighbouring unit cells. A unit cell bounding box is shown and can be freely translated.
- The camera angle is defined as a Miller index.
- Mass-weighting may optionally be added if this was not done in the .ascii file construction.
- The open-source graphics package Blender is used to render the images; it is also possible to open the Blender scenes for further adjustments before rendering. Experience with Blender is not required to use ascii-phonons.
- Ascii-phonons is implemented in Python as a Blender addon and a library for convenient access. A GUI and a command-line interface are provided for easy accessibility and scripting potential. Python programming skills are not required.
- The atomic positions, unit cell and phonon modes are imported from
.asciifiles. These can be generated with Phonopy. The format was originally specified for v_sim, a useful program and one of the only tools available for visualising non-Gamma-point phonons. - User settings can be saved to and loaded from simple config text files. Default parameters including atomic radii, masses and some colours are loaded from editable files in the same format.
Development
Development is in progress and hosted on Github. Please use the issue tracker for feature requests, bug reports and more general questions. For more information about the structure and goals of this project see the relevant section in the official documentation.
Setup
The simplest way to get up and running is
- Install Blender (available in all good package managers).
- Download the code:
- either clone the repository with
git clone git@github.com:ajjackson/ascii-phonons - or download the latest version as a zip file.
- either clone the repository with
Requirements
- Some means of generating .ascii files. We like Phonopy.
- A recent version of Blender; development is currently with Blender 2.76 and later. At least version 2.70 is needed, which provides the wireframe modifier used to draw the bounding box. Note that the versions of Blender available in package managers such as apt-get are often quite dated. Installing the latest version for Linux is easy, however; just download the .tar.gz file, untar it and add the directory to your PATH.
- Imagemagick tools (specifically "convert" and "montage") are used for image conversion and tiling. This is available in most package managers and may even be pre-installed with your Unix-like operating system.
- The GUI uses Tkinter with the python image library. On Linux this is typically packaged as
python-imaging-tk. Mac OSX and Windows Python distributions tend to include Tkinter, but it may be necessary to also install a PIL implementation such as Pillow.
Getting started
For those who would prefer to avoid working through the Python API, a command-line wrapper scripts/ascii-phonons and a graphical user intergace scripts/ascii-phonons-gui are available. Call the script with
ascii-phonons -h
for information about the numerous command-line arguments, or take a look at the online documentation.
If working on Mac OS X, you may need to specify the path to your Blender binary, which is tucked away in a .app package, using the -b flag.
However, the script assumes you have Blender installed in a folder called "Blender" in the root Applications folder, and should find your binary in this case.
A typical call to the wrapper script would be something like:
ascii-phonons /path/to/my/phonons.ascii -m 5 --static --vectors -o pretty
which should write a static image pretty.png, illustrating mode 5 with arrows. To generate an animation, try
ascii-phonons /path/to/my/phonons.ascii -m 1 --gif -o pretty
which will use Imagemagick to generate pretty.gif.
The --montage flag implements the tiled output; try something like
ascii-phonons /path/to/my/phonons.ascii --static --vectors --montage -o pretty
to generate a static image. Note that, while smaller images are rendered, this can take some time if your system has a large number of phonon modes.
When you are comfortable that the code works for you, the GUI (ascii-phonons-gui) offers an easy way to experiment with different settings and features.
The "File" menu of the GUI allows you to save your settings to a .conf file, and to combine your settings with other .conf files including colour schemes.
To use the resulting file with the CLI, use the --config flag.
ascii-phonons /path/to/my/phonons.ascii --config my_amazing.conf
Note that information about input and output files is contained within the .conf file, but that scripts/ascii-phonons always requires a .ascii file to be provided at the command line.
Implementation details
The default atomic radii are the covalent radii from Cordero et al (2008). The eigenvectors may be scaled by the square root of the relative atomic mass; the atomic mass data is from Coursey et al. (2015). (This is usually unnecessary as Phonopy applies this scaling when generating the .ascii file.)
Acknowledgements
Work on this package began while ajjackon was a PhD student funded by EPSRC through the Center for Sustainable Chemical Technologies (grant no. EP/G03768X/1) at the University of Bath. Further work to fix bugs and improve the documentation and useability has taken place as a Research Assistant in the same research group, while funded by the ERC (project 277757).
License
GNU GPL v3
Disclaimer
Use at your own risk. This project is not affiliated with Blender, Phonopy or v_sim.
Owner
- Name: Adam J. Jackson
- Login: ajjackson
- Kind: user
- Location: United Kingdom
- Company: STFC
- Repositories: 46
- Profile: https://github.com/ajjackson
Computational chemistry/physics and software person. Mostly interested in materials and thermodynamics. I like Python, Emacs and SCIENCE
Citation (CITATION.cff)
cff-version: 1.0.3
message: If you use this software, please consider citing it as below.
authors:
- family-names: Jackson
given-names: Adam J.
orcid: https://orcid.org/0000-0001-5272-6530
repository-code: https://github.com/ajjackson/ascii-phonons
title: ascii-phonons
version: 1.0.1
doi: 10.5281/zenodo.1303300
date-released: 2018-07-2
programming-languages:
- python
license: GPL-3.0-or-later
GitHub Events
Total
- Watch event: 4
Last Year
- Watch event: 4
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 33
- Total pull requests: 0
- Average time to close issues: 2 months
- Average time to close pull requests: N/A
- Total issue authors: 8
- Total pull request authors: 0
- Average comments per issue: 1.85
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ajjackson (25)
- Fellow-baka (2)
- utf (1)
- spriti523 (1)
- fcannini (1)
- similt (1)
- lucydot (1)
- woal777 (1)