vmd.molecule.get_volumetric¶
-
vmd.molecule.
get_volumetric
()¶ Obtain a volumetric dataset loaded into a molecule
Parameters: - molid (int) – Molecule ID to query
- dataindex (int) – Volumetric dataset index to obtain
Returns: (4-list) –
- Dataset, consisting of 4 lists:
1.) A 1-D list of the values at each point 2.) 3-tuple of int describing the x, y, z lengths. 3.) 3-tuple of float describing the position of the origin. 4.) 9-tuple of float describing the deltas for the x, y, and z axes).
- Example usage for export to numpy:
>>> data, shape, origin, delta = molecule.get_volumetric(0,0) >>> data = np.array(data) >>> shape = np.array(shape) >>> data = data.reshape(shape, order='F') >>> delta = np.array(delta).reshape(3,3) >>> delta /= shape-1