Monday 26 September 2022

ANIAnimator v0.0.1 tutorial

Two carbon atoms are bonding each other.

Installation

ANIAnimator is packaged as a software library available from the package repository PyPI. As such it can notably be installed with pip or pipenv.

To install ANIAnimator:

$ pip install ANIAnimator

This project is under active development, please make sure you keep it up-to-date to benefit from latest improvements:

# to make sure you have the latest version
$ pip install -U ANIAnimator
# latest available code base
$ pip install -U git+https://github.com/eftalgezer/ANIAnimator.git

First steps

Download the C-merged.ANI from here.

Using in code

Import the package ANIAnimator.

import ANIAnimator

Call the animate function from ANIAnimator.

ANIAnimator.animate(anifile="C-merged.ANI")
ANIAnimator.animate(anifile="graphene.ANI", width=1920, height=1080) # defaults are 1920 × 1080, respectively
ANIAnimator.animate(anifile="graphene.ANI", loop=1) # default is 0; 0 means loop, 1 means no loop
ANIAnimator.animate(bonds_param=1.3) # default is 1.3, sets the bonds between atoms

The output is:

Opening C-merged.ANI
Making directory ANIAnimator_temp
Creating xyz files (34/34)
Creating png files (34/34)
Creating GIF (34/34)
C-merged.gif is created
Deleting directory ANIAnimator_temp
Directory ANIAnimator_temp is deleted

Using in terminal

$ python -m ANIAnimator C-merged.ANI

Or, with advance parameters

$ python -m ANIAnimator <ANI file> <width> <height> <loop> <bonds_param>
$ python -m ANIAnimator graphene.ANI 1920 1080 1 1.3

The output is:

Opening C-merged.ANI
Making directory ANIAnimator_temp
Creating xyz files (34/34)
Creating png files (34/34)
Creating GIF (34/34)
C-merged.gif is created
Deleting directory ANIAnimator_temp
Directory ANIAnimator_temp is deleted

About bonds_param parameter

ANIAnimator uses mogli to create PNG images of the steps in ANI files. The default of mogli package is 1.0. ANIAnimator default is 1.3 since the experience shows that 1.3 is better. For details, see the README.md of mogli package.

Citation

If you are using ANIAnimator, please citate relevant version. You can find relevant citation here.

@software{eftal_gezer_2022_7112025,
author = {Eftal Gezer},
title = {eftalgezer/ANIAnimator: v0.0.1},
month = sep,
year = 2022,
publisher = {Zenodo},
version = {v0.0.1},
doi = {10.5281/zenodo.7112025},
url = {https://doi.org/10.5281/zenodo.7112025}
}

0 comments:

Post a Comment