[Chimera-users] writing mrc files
goddard at cgl.ucsf.edu
Fri Apr 21 13:50:45 PDT 2006
Oops! My suggested code was wrong. a = a.resize(grid_size) gives an
error because Numeric tries copy values of a into a instead of just
rebinding variable a. The corrected version is below.
def write_mrc(data, zyx_grid_size):
origin = (1.54, 2.45, 3.45) # XYZ coordinates of array index (0,0,0)
step = (.25, .25, .25) # Spacing between grid points
a = Numeric.array(data, Numeric.Float32)
a_3d = a.resize(zyx_grid_size)
arrays = [a_3d]
g = VolumeData.Array_Grid_Data(arrays, origin, step)
path = '/home/eshacham/structures/result.mrc'
from VolumeData.mrc import write_mrc2000_grid_data
More information about the Chimera-users