Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fevangelista/vmd_cube

A Python script for rendering cube files generated by Psi4
https://github.com/fevangelista/vmd_cube

Last synced: 3 months ago
JSON representation

A Python script for rendering cube files generated by Psi4

Awesome Lists containing this project

README

        

# vmd_cube
A Python script for rendering cube files generated by Psi4

## Adaptive isocontour values
If the cube files are generated with Psi4, vmd_cube will automatically use the adaptive isocontour values
reported in the comment section:
```
Psi4 Gaussian Cube File.
Property: Psi_a_1_1-Ag. Isocontour range for 85% of the density: (0.0535039,0)
```
These isocountour values capture 85% of the probability density using the least amount of grid points.

Alternatively, the isocontour range can be set with the `--iso` option. For example, `--iso 0.03 -0.03`.
If vmd_cube is not provided isocountour values, it will use the default ([0.05,-0.05]).

## Color schemes
The vmd_cube color scheme is customizable using the `--color1/--color2` options.
Alternatively the user can request one of the following color schemes (Emory is the default one).

![vmd_cube color schemes](/vmd_cube_color_schemes.png?raw=true "Color Schemes")

## Specifying arbitrary isosurface values/colors
vmd_cube can plot an arbitrary number of isosrufaces. This can be specified with the options `--isovalue` and `--isocolor`.
For example, to draw three surfaces with values [0.03,0.04,0.05] call vmd_cube with the following argument `--isovalue 0.03 0.04 0.05 --isocolor 3 23 12`.
Note that the number of arguments passed to `--isovalue` and `--isocolor` must be the same.

The following is an example of a plot containing three isosurfaces
```
vmd_cube.py --isovalue -0.03 -0.06 -0.12 --isocolor 3 3 3 --opacity=0.3 --rx=0 --ry=90 --rz=0
```

![vmd_cube color schemes](/vmd_cube_multiple_surfaces.png?raw=true "Color Schemes")

## vmd_cube options
```
>>> ./vmd_cube.py --help
usage: vmd_cube.py [-h] [--isovalue [ [ ...]]]
[--isocolor [ [ ...]]] [--rx []]
[--ry []] [--rz []] [--tx []]
[--ty []] [--tz []] [--opacity []]
[--scale []] [--no-montage] [--no-labels]
[--imagew []] [--imageh []]
[--fontsize []] [--interactive] [--gzip]
[--national_scheme] [--silver_scheme] [--bright_scheme]
[--electron_scheme]
[]

vmd_cube is a script to render cube files with vmd. To generate cube files
with Psi4 add the command cubeprop() at the end of your input file.

positional arguments:
The directory containing the cube files.

optional arguments:
-h, --help show this help message and exit
--isovalue [ [ ...]]
a list of isosurface values (a list of floats, default
= [0.05,-0.05])
--isocolor [ [ ...]]
a list of isosurface color IDs (a list of integers,
default = [3,23])
--rx [] the x-axis rotation angle (float, default = 30.0)
--ry [] the y-axis rotation angle (float, default = 40.0)
--rz [] the z-axis rotation angle (float, default = 15.0)
--tx [] the x-axis translation (float, default = 0.0)
--ty [] the y-axis translation (float, default = 0.0)
--tz [] the z-axis translation (float, default = 0.0)
--opacity []
opacity of the isosurface (float, default = 1.0)
--scale [] the scaling factor (float, default = 1.0)
--no-montage call montage to combine images. (string, default =
false)
--no-labels do not add labels to images. (string, default = false)
--imagew [] the width of images (integer, default = 250)
--imageh [] the height of images (integer, default = 250)
--fontsize []
the font size (integer, default = 20)
--interactive run in interactive mode (default = false)
--gzip gzip cube files (default = false)
--national_scheme use a red/blue color scheme. (string, default = false)
--silver_scheme use a gray/white color scheme. (string, default =
false)
--bright_scheme use a soft yellow/blue color scheme. (string, default
= false)
--electron_scheme use a purple/green color scheme. (string, default =
false)
```