def reconstruction_by_make3d(imagefile, mapfile, options, mapfile2e, mapfile2o, fscfile): cmd_prefix = EMAN.pre_mpirun(mpilib = options.mpi, mpi_nodefile = options.mpi_nodefile, single_job_per_node = 1) cmd_3drec = "%s `which make3d` %s hard=90 lowmem sym=%s mode=2 apix=%g pad=%d usecenter iter=1" % \ (cmd_prefix, imagefile, options.endSym, options.apix, options.pad) if options.sffile: cmd_3drec += " wiener3d=%s" % ( options.sffile ) if not options.phasecorrected: cmd_3drec += " flipphase" cmd = "%s out=%s" % (cmd_3drec, mapfile) if options.eotest and mapfile2e and mapfile2o: cmd += "\n%s subset=0/2 out=%s" % (cmd_3drec, mapfile2e) cmd += "\n%s subset=1/2 out=%s" % (cmd_3drec, mapfile2o) print cmd if options.mpi: os.system(cmd) else: runpar_file = "runpar.make3d" runparfp = open(runpar_file,"w") runparfp.write("%s\n" % (cmd)) runparfp.close() cmd = "runpar proc=%d,%d file=%s nofs" % (options.cpus, options.cpus, runpar_file) print cmd os.system(cmd) if not (os.path.exists(mapfile) and os.path.getsize(mapfile)): print "ERROR: 3D map \"%s\" is not generated properly" % (mapfile) sys.exit() if mapfile2e and mapfile2o and os.path.exists(mapfile2e) and os.path.exists(mapfile2o): cmd = "proc3d %s %s fsc=%s" % (mapfile2e,mapfile2o,fscfile) print cmd os.system(cmd) EMAN.post_mpirun(mpilib = options.mpi)