--
--
----------------------------------------------------------------------------------------------
You received this message because you are subscribed to the Google
Groups "EMAN2" group.
To post to this group, send email to em...@googlegroups.com
To unsubscribe from this group, send email to eman2+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eman2
---
You received this message because you are subscribed to the Google Groups "EMAN2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eman2+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/eman2/ff9ba8f3-acb9-4c63-8e9d-26c4ea60f430n%40googlegroups.com.
# This program will extract the 3-D particles corresponding to a subset of 2-D particles in SPT
# it will also generate a new 2-D file with renumbered 3-D references
# usage program.py <2d substack lst> <3d stack lst> <new 2d out> <new 3d out>
from EMAN3 import *
import sys,os
try: os.unlink(sys.argv[3])
except: pass
try: os.unlink(sys.argv[4])
except: pass
in2d=LSXFile(sys.argv[1])
in3d=LSXFile(sys.argv[2])
out2d=LSXFile(sys.argv[3])
out3d=LSXFile(sys.argv[4])
pt3did={int(x[2]["ptcl3d_id"]) for x in in2d}
pt3dlst=sorted(list(pt3did))
map=dict()
for i,j in enumerate(pt3dlst):
out3d[i]=in3d[j]
map[j]=i
for num,fsp,meta in in2d:
meta["ptcl3d_id"]=map[meta["ptcl3d_id"]]
out2d[-1]=num,fsp,meta
To view this discussion visit https://groups.google.com/d/msgid/eman2/f0646a2e-966d-4e56-bd93-963a70f3caafn%40googlegroups.com.