-
Notifications
You must be signed in to change notification settings - Fork 1
CTFParamOldNew
Adrian Quintana edited this page Dec 11, 2017
·
1 revision
#!/usr/bin/env python
import glob
#change line bellow to process all the required files
for inFile in glob.glob('Preprocessing/*/down2_*_Periodogramavg.ctfparam'):
f = open(inFile)
outFile = inFile.replace('.ctfparam','_new.ctfparam')
o = open(outFile,"w")
1.
1. write("# XMIPP_STAR_1 * \n")
1. write("# CTF converted from " + inFile +"\n")
1. write("data_ \n")
while 1: line` f.readline() if not line: break # line = line.replace("sampling_rate`","_CTF_Sampling_rate") line` line.replace("voltage`","_CTF_Voltage") line` line.replace("defocusU`","_CTF_Defocus_U") line` line.replace("defocusV`","_CTF_Defocus_V") line` line.replace("azimuthal_angle`","_CTF_Defocus_angle") line` line.replace("spherical_aberration`","_CTF_Spherical_aberration") line` line.replace("Q0`","_CTF_Q0") line` line.replace("K`","_CTF_K")
1.
1.
1. write(line)
1. close() #Change sign command` "xmipp_metadata_utilities -i " + outFile + \ """ --operate modify_values "CTF_Defocus_U`(CTF_Defocus_U * -1)" """ os.system(command) command` "xmipp_metadata_utilities -i " + outFile + \ """ --operate modify_values "CTF_Defocus_V`(CTF_Defocus_V * -1)" """ os.system(command) command` "xmipp_metadata_utilities -i " + outFile + \ """ --operate modify_values "CTF_Q0`(CTF_Q0 * -1)" """ os.system(command)
--Main.RobertoMarabini - 27 Jan 2011