Commit 8e0e0910 authored by Adrian Nievergelt's avatar Adrian Nievergelt

changed motioncor2 scripts to be executable by default

parent 561c2019
......@@ -13,6 +13,8 @@ import re
import argparse
from datetime import datetime
import getpass
import stat
from pathlib import Path
# clusterBaseDir = '/projects/project-nieverge/'
procDir = 'tomoProc'
......@@ -137,7 +139,9 @@ elif args.noLog:
else:
verboseString = ">> %s 2>&1" % (inBaseName + "_alignment.log")
with open(os.path.join(mdocDir, inBaseName + "_alignFramesMC2.sh"), "w+") as scriptFile:
scriptFilePath = Path(os.path.join(mdocDir, inBaseName + "_alignFramesMC2.sh"))
with open(scriptFilePath, "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()) )
......@@ -162,3 +166,5 @@ with open(os.path.join(mdocDir, inBaseName + "_alignFramesMC2.sh"), "w+") as scr
for imageParams in stackParams:
scriptFile.write("rm %s\n" % (os.path.join(alignedDir, imageParams['filename'])))
scriptFile.write("rmdir %s\n" % (alignedDir))
scriptFilePath.chmod(scriptFilePath.stat().st_mode | stat.S_IEXEC | stat.S_IXGRP )
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