VMD-L Mailing List
From: Vermaas, Joshua (Joshua.Vermaas_at_nrel.gov)
Date: Fri Feb 10 2017 - 15:52:31 CST
Here is the python code that I use to interpret the volumetric data itself:
data, shape, origin, delta = molecule.get_volumetric(molid, volid)
data = np.array(data) #By default the first output is a tuple. This turns it into a 1-D array that numpy likes
shape = np.array(shape) #Ditto here
data = data.reshape(shape, order='F') #We actually want this to be 3-D. :) Importantly, because of how the data is stored internally by VMD, numpy needs to be told this is in fortran ('F') order, otherwise your data won't make any sense. Why a program written in C (VMD) stores its data in fortran order is beyond me, but this seems to actually be pretty common in VMD internal datastructures.
delta = np.array(delta).reshape(3,3) #This is basically how long each axis is. If you want the stepsize per axis, divide delta by shape-1
Then with some annoying index math, it should be possible to figure out what the distance is for any point in space.
On 02/10/2017 02:36 PM, Karl Decker wrote:
Hello all. My colleagues and I are up against a problem: what is the structure of the data created by the distance map function of VolMap? We have a method for extracting VolMap distance map data, without writing to disk, using the python object mol_get_volumetric. We can then use the data in a plugin of our own devising. However, we don't know how the data is arranged when it is created by VolMap. We are trying to avoid writing the data to disk because it is very slow compared to the timescale of the other aspects of the plugin.
Could the author of VolMap provide some insight into the data structure VolMap uses when creating a distance map?