User Tools

Site Tools


eman1:faq:using_29

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
eman1/faq/using_29.txt · Last modified: by steveludtke