Load brick: Difference between revisions
Jump to navigation
Jump to search
(created) |
(remove DISPLAYTITLE, add See Also) |
||
Line 1: | Line 1: | ||
[[load_brick]] is an API-only function to load an array of data as a [[map]] into PyMOL. | [[load_brick]] is an API-only function to load an array of data as a [[map]] into PyMOL. | ||
Line 32: | Line 30: | ||
]) | ]) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== See Also == | |||
* [[volume]] | |||
* [[isomesh]] | |||
[[Category:Scripting]] | [[Category:Scripting]] | ||
[[Category:Maps]] | [[Category:Maps]] |
Latest revision as of 07:04, 22 October 2018
load_brick is an API-only function to load an array of data as a map into PyMOL.
Example
from pymol import cmd
from chempy.brick import Brick
import numpy
# grid spacing in Angstrom
yourgridspacing = (0.2, 0.2, 0.2)
# numpy array with some artificial data
yourdata = numpy.zeros((100, 100, 100))
yourdata[20:80, 20:80, 20:80] = 1.0
yourdata[40:60, 40:60, 40:60] = 2.0
# load into PyMOL
brick = Brick.from_numpy(yourdata, yourgridspacing)
cmd.load_brick(brick, 'yourmap')
# visualize
cmd.volume('yourvolume', 'yourmap', [\
0.5, 'blue', 0.4, \
0.6, 'blue', 0.0, \
1.4, 'red', 0.0, \
1.5, 'red', 0.9, \
])