Differences between revisions 2 and 3
Revision 2 as of 2007-07-11 19:16:11
Size: 1065
Editor: gtang
Comment:
Revision 3 as of 2008-11-26 04:42:29
Size: 1065
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Question: I have a bunch of MRC convention Euler angles and need to generate projections of a model in EMAN

Answer: Here is a python script that should give you something to start with. Don't forget the help() function in python, ie:

  • import EMAN help(EMAN.EMData) help(EMAN.Euler)

Here's the script:

# This reads a text file with a space separates Euler triplet # and generates projections from EMAN import * infile=open("eulers.txt","r") lines=infile.readlines() infile.close()

# Ok, this next line is not all that transparent, there # are other ways to do this, but it is a useful construct # converts a set of input lines into a list of tuples eulers=map(lambda x:tuple(map(lambda y:float(y)*math.pi/180.0,x.split())),lines) e=Euler()

# read the volume data data=EMData() data.readImage("model.mrc",-1)

for euler in eulers:

  • e.setByType(euler,Euler.MRC) # -4 is the best real-space projection mode out=data.project3d(e.alt(),e.az(),e.phi(),-4) out.writeImage("proj.hed",-1) # file type determined by extension

FAQ_EMAN_USING_29 (last edited 2008-11-26 04:42:29 by localhost)