Commit f11dabbf authored by Adrian Nievergelt's avatar Adrian Nievergelt

fix silencing

parent be0adc78
......@@ -103,13 +103,19 @@ stackFileName = os.path.join(mdocDir, inBaseName + ".stackFiles")
tiltFileName = os.path.join(mdocDir, inBaseName + ".rawTlt")
with open(stackFileName, "w+") as stackFile:
stackFile.write("%i\n" % ( len(stackParams) ))
for imageParams in stackParams:
stackFile.write("%s\n" % (os.path.join(alignedDir, imageParams['filename']) ))
stackFile.write("%s\n0\n" % (os.path.join(alignedDir, imageParams['filename']) ))
with open(tiltFileName, "w+") as tiltFile:
for imageParams in stackParams:
tiltFile.write("%f\n" % (imageParams['tiltangle']) )
if args.verbose:
verboseString = ""
else:
verboseString = " &>/dev/null"
with open(os.path.join(mdocDir, inBaseName + "_alignFramesMC2.sh"), "w+") as scriptFile:
scriptFile.write("#!/bin/bash\n\n")
scriptFile.write("# Script file for motioncor2 alignment of tilt series created by mc2FromMDOC.py on %s by %s\n\n" % (datetime.today().strftime('%Y-%m-%d %H:%M'), getpass.getuser()) )
......@@ -122,16 +128,12 @@ with open(os.path.join(mdocDir, inBaseName + "_alignFramesMC2.sh"), "w+") as scr
doseWeightParams = " -Kv 300 -FmDose %f -InitDose %f" % (imageParams['frameDose'], imageParams['priorrecorddose'])
else:
doseWeightParams = ""
if args.verbose:
verboseString = ""
else:
verboseString = " &>/dev/null"
scriptFile.write("echo Aligning frame stack %s \n" % (os.path.join(subframesDir, imageParams['filename']) ))
scriptFile.write("MotionCor2-cuda%i -InMrc %s -OutMrc %s -Patch %i %i -InFmMotion 1 -Iter 30 -Tilt %f -FtBin %i -PixSize %f%s%s\n\n" %(args.cudaVer, os.path.join(subframesDir, imageParams['filename']), os.path.join(alignedDir, imageParams['filename']), args.patchSize, args.patchSize, imageParams['tiltangle'], args.binning, imageParams['pixelspacing'], doseWeightParams, verboseString) )
scriptFile.write("echo Creating combined tilt series stack %s\n" % (inBaseName + "_mc2.mrc"))
scriptFile.write("imodenv")
scriptFile.write("newstack -fileinlist %s -output %s -tilt %s\n\n" % ( os.path.basename(stackFileName), inBaseName + "_mc2.mrc", os.path.basename(tiltFileName) ))
scriptFile.write("imodenv\n")
scriptFile.write("newstack -fileinlist %s -output %s -tilt %s%s\n\n" % ( os.path.basename(stackFileName), inBaseName + "_mc2.mrc", os.path.basename(tiltFileName), verboseString ))
if not args.keepFrames:
scriptFile.write("echo Removing temporary aligned files.\n")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment