本文整理汇总了Python中utilities.disable_bdb_cache函数的典型用法代码示例。如果您正苦于以下问题:Python disable_bdb_cache函数的具体用法?Python disable_bdb_cache怎么用?Python disable_bdb_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了disable_bdb_cache函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: main
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + " volume stack <maskfile> --delta=angular_step --method=S --phiEqpsi=Minus --symmetry=c1 --angles=angles.txt --CTF=ctf.txt --noise=s"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--delta", type="float", default=2, help="angular step ")
parser.add_option("--phiEqpsi", type="string", default="Minus", help="if Minus, psi is set to minus phi (default), if Zero, set to zero ")
parser.add_option("--method", type="string", default="S", help="method of quasi-uniformly distributed Eulerian angles S (default) or P")
parser.add_option("--symmetry", type="string", default="c1", help="symmetry group")
parser.add_option("--angles", type="string", default=None, help="List of angles (phi, theta, psi) or with shifts (phi, theta, psi, tx, ty)")
parser.add_option("--noise", type="float", default=None, help="add Gaussian noise with standard deviation s and zero mean")
parser.add_option("--CTF", type="string", default=None, help="list of CTF parameters")
parser.add_option("--realspace",action="store_true", default=False, help="real space projection")
(options, args) = parser.parse_args()
if(len(args) < 2 or len(args) > 3):
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
else:
if len(args) == 2:
mask = None
else:
mask = args[2]
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
from applications import project3d
global_def.BATCH = True
project3d(args[0], args[1], mask, options.delta, options.method, options.phiEqpsi, options.symmetry, options.angles, listctfs=options.CTF, noise=options.noise, realsp=options.realspace)
global_def.BATCH = False
开发者ID:cpsemmens,项目名称:eman2,代码行数:30,代码来源:sxproject3d.py
示例2: main
def main():
import os
import sys
from optparse import OptionParser
arglist = []
for arg in sys.argv:
arglist.append(arg)
progname = os.path.basename(arglist[0])
usage = progname + " stack1 <stack2> <mask> --ccc --fsc file --inf --rad=r"
parser = OptionParser(usage, version=SPARXVERSION)
parser.add_option("--ccc", action="store_true", default=False, help="print cross corelation coefficient")
parser.add_option("--fsc", type="string", default="", help="calculate resolution curve")
parser.add_option("--inf", action="store_true", default=False, help="print basic infomation of the img")
parser.add_option("--rad", type="int", default=-1, help="radius of operation")
(options, args) = parser.parse_args(arglist[1:])
if len(args) < 1 or len(args) > 3:
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
sys.exit(-1)
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
from applications import imgstat
global_def.BATCH = True
imgstat(args, options.ccc, options.fsc, options.inf, options.rad)
开发者ID:cryoem,项目名称:test,代码行数:33,代码来源:sximgstat.py
示例3: main
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + " stack outdir <maskfile> --K=2 --nb_part=5 --th_nobj=10 --rand_seed=10 --opt_method=SSE --maxit=1000 --normalize --CTF --MPI"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--K", type="int", default=2, help="Number of classes for K-means (default 2)")
parser.add_option("--nb_part", type="int", default=5, help="Number of partitions used to calculate the stability (default 5)")
#parser.add_option("--F", type="float", default=0.0, help="Cooling factor in simulated annealing, <1.0")
#parser.add_option("--T0", type="float", default=0.0, help="Simulated annealing first temperature")
parser.add_option("--th_nobj", type="int", default=1, help="Cleanning threshold, classes with number of images < th_nobj are removed (default 1)")
parser.add_option("--rand_seed", type="int", default=0, help="Random seed")
#parser.add_option("--opt_method", type='string', default='SSE', help="K-means method: SSE (default), cla")
#parser.add_option("--match", type='string', default='bbenum', help='Algorithm to match partitions: pwa, pair-wise agreement (default), or hh, hierarchical Hungarian algorithm, or bbenum')
parser.add_option("--maxit", type="int", default=1e9, help="Maximum number of iterations for k-means")
parser.add_option("--normalize", action="store_true", default=False, help="Normalize images under the mask")
parser.add_option("--CTF", action="store_true", default=False, help="Perform classification using CTF information")
#parser.add_option("--CUDA", action="store_true", default=False, help="CUDA version")
parser.add_option("--MPI", action="store_true", default=False, help="Use MPI version ")
(options, args) = parser.parse_args()
if len(args) < 2 or len(args) > 3:
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
else:
if len(args) == 2: mask = None
else: mask = args[2]
if options.K < 2:
sys.stderr.write('ERROR: K must be > 1 group\n\n')
sys.exit()
if options.nb_part < 2:
sys.stderr.write('ERROR: nb_part must be > 1 partition\n\n')
sys.exit()
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
global_def.BATCH = True
if options.MPI:
from mpi import mpi_init
sys.argv = mpi_init(len(sys.argv), sys.argv)
'''if options.CUDA:
from development import k_means_stab_MPICUDA_stream_YANG
k_means_stab_MPICUDA_stream_YANG(args[0], args[1], mask, options.K, options.nb_part, options.F, options.T0, options.th_nobj, options.rand_seed, options.maxit)
else:'''
from statistics import k_means_stab_MPI_stream
k_means_stab_MPI_stream(args[0], args[1], mask, options.K, options.nb_part, 0.0, 0.0, options.th_nobj, options.rand_seed, "SSE", options.CTF, options.maxit)
else:
'''if options.CUDA:
from development import k_means_stab_CUDA_stream
k_means_stab_CUDA_stream(args[0], args[1], mask, options.K, options.nb_part, options.F, options.T0, options.th_nobj, options.rand_seed, options.maxit)
else:'''
from statistics import k_means_stab_stream
k_means_stab_stream(args[0], args[1], mask, options.K, options.nb_part, 0.0, 0.0, options.th_nobj, options.rand_seed, "SSE", options.CTF, options.maxit)
global_def.BATCH = False
if options.MPI:
from mpi import mpi_finalize
mpi_finalize()
开发者ID:cpsemmens,项目名称:eman2,代码行数:60,代码来源:sxk_means_stable.py
示例4: main
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + " stack dendoname <maskfile> --link=kind_of_link --dist=kind_of_dist --dissimilar"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--link", type='string', default="single", help="Kind of linkage: single, complete, average (default single)")
parser.add_option("--dist", type='string', default="sim_SqEuc", help="Kind of distance: SqEuc, CCC (default SqEuc)")
parser.add_option("--dissimilar", action='store_true', default=False, help="Change the distance to the negative value (default False)")
chk_link = ['single', 'complete', 'average']
chk_dist = ['SqEuc', 'CCC']
(options, args) = parser.parse_args()
if len(args) < 2 or len(args) > 3:
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
elif options.link not in chk_link:
sys.stderr.write('ERROR: Kind of linkage unknown.\n\n')
sys.exit()
elif options.dist not in chk_dist:
sys.stderr.write('ERROR: Kind of distance unknown.\n\n')
sys.exit()
else:
if len(args) == 2: maskname = None
else: maskname = args[2]
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
from applications import HAC_clustering
global_def.BATCH = True
HAC_clustering(args[0], args[1], maskname, options.link, options.dist, options.dissimilar)
global_def.BATCH = False
开发者ID:cpsemmens,项目名称:eman2,代码行数:33,代码来源:sxhac_clustering.py
示例5: main
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + " stack_in stack_out"
parser = OptionParser(usage,version=SPARXVERSION)
(options, args) = parser.parse_args()
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
# check length of arguments list. less than 2 is illegal
if (len(args) < 2):
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
# 2 is file to file copying
elif (2 == len(args)):
#print "file to file"
cpy(args[0], args[1])
# more than 2, this means a wildcard is transformed to a list of filenams
else:
#print "list to file"
#
# XXX: note that wildcards only work for filenames! wildcards in files
# are processed by the shell and read in as a space-delimited list
# of filenames. however, this does NOT work for bdb:image1 type names,
# since these will not be found and processed by the shell, not being
# normal files. globbing of db objects will have to be done here!
#
# make sure we only pass the last entry of args as output file name,
# since [-1:] pass a list containing only the last entry....
#
# application.cpy
cpy(args[:-1], args[-1:][0])
开发者ID:cpsemmens,项目名称:eman2,代码行数:33,代码来源:sxcpy.py
示例6: main
def main():
import sys
import os
arglist = []
for arg in sys.argv:
arglist.append( arg )
progname = os.path.basename(arglist[0])
usage = progname + " prjstack bufprefix --npad --CTF --verbose"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--CTF", action="store_true", default=False, help="use CTF")
parser.add_option("--npad", type="int", default=2, help="times of padding")
parser.add_option("--verbose", type="int", default=0, help="verbose level: 0 no, 1 yes")
(options, args) = parser.parse_args( arglist[1:] )
if( len(args) != 2):
print "usage: " + usage
return None
prjfile = args[0]
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
bufprefix = args[1]
nprj = EMUtil.get_image_count( prjfile )
genbuf( prjfile, bufprefix, 0, nprj, options.CTF, options.npad, options.verbose )
开发者ID:cpsemmens,项目名称:eman2,代码行数:31,代码来源:sxgenbuf.py
示例7: main
def main():
progname = os.path.basename(sys.argv[0])
usage = (
progname
+ """ 2Dprojections plot_output
Read projection angles from 2Dprojections file and write a 2D image file
containing their distribution on a hemisphere."""
)
parser = OptionParser(usage, version=SPARXVERSION)
parser.add_option("--wnx", type="int", default=256, help="plot image size (default = 256)")
(options, args) = parser.parse_args()
if len(args) != 2:
print "usage: " + usage
print "Please run '" + progname + """ -h' for detailed options"""
else:
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
from applications import plot_projs_distrib
global_def.BATCH = True
plot_projs_distrib(args[0], args[1], options.wnx)
global_def.BATCH = False
开发者ID:cryoem,项目名称:test,代码行数:27,代码来源:sxplot_projs_distrib.py
示例8: main
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + " stack outdir <maskfile> --ou=outer_radius --br=brackets --center=center_type --eps=epsilon --maxit=max_iter --CTF --snr=SNR --function=user_function_name"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--ou", type="float", default=-1, help=" outer radius for a 2-D mask within which the alignment is performed")
parser.add_option("--br", type="float", default=1.75, help=" brackets for the search of orientation parameters (each parameter will be checked +/- bracket (set to 1.75)")
parser.add_option("--center", type="float", default=1, help=" 0 - if you do not want the average to be centered, 1 - center the average (default=1)")
parser.add_option("--eps", type="float", default=0.001, help=" stopping criterion, program will terminate when the relative increase of the criterion is less than epsilon ")
parser.add_option("--maxit", type="float", default=10, help=" maximum number of iterations (set to 10) ")
parser.add_option("--CTF", action="store_true", default=False, help=" Consider CTF correction during the alignment ")
parser.add_option("--snr", type="float", default=1.0, help=" Signal-to-Noise Ratio of the data")
parser.add_option("--function", type="string", default="ref_ali2d", help=" name of the reference preparation function")
(options, args) = parser.parse_args()
if len(args) < 2 or len(args) >3:
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
else:
if len(args) == 2:
mask = None
else:
mask = args[2]
from applications import local_ali2d
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
global_def.BATCH = True
local_ali2d(args[0], args[1], mask, options.ou, options.br, options.center, options.eps, options.maxit, options.CTF, options.snr, options.function)
global_def.BATCH = False
开发者ID:cpsemmens,项目名称:eman2,代码行数:31,代码来源:sxlocal_ali2d.py
示例9: main
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + " input_filename output_filename --sym=Symmetry group --phi --theta --psi=The 3 Eulerian angles in degrees --r=Radius of mask --phirange --thetarange --psirange=A search scale for each angle --ftol --xtol = convergence criterion the function and angles values"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--sym", type="string", default="c1", help=" String that specifies the point group symmetry. default = 'c1'")
parser.add_option("--phi", type='float',default=0.0, help=" phi angle, default = 0")
parser.add_option("--theta", type='float',default=0.0, help=" theta angle, default=0")
parser.add_option("--psi", type='float',default=0.0, help=" phi angle, default=0")
parser.add_option("--r", type='float',default=None,help=" Input the radius of the mask. default=None")
parser.add_option("--phirange", type='float',default=20.0,help=" The search scale for phi angle...default=20")
parser.add_option("--thetarange", type='float',default=20.0,help=" The search scale for theta angle...default=20")
parser.add_option("--psirange", type='float',default=20.0,help=" The search scale for psi angle...default=20")
parser.add_option("--ftol", type='float',default=1.e-4,help=" convergence criterion on the function values...default = 1.e-4")
parser.add_option("--xtol", type='float',default=1.e-4,help=" convergence criterion on the variable values...default = 1.e-4")
(options, args) = parser.parse_args()
if len(args) != 2:
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
exit(1)
else:
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
from applications import rot_sym
global_def.BATCH = True
rot_sym(args[0],args[1],options.sym,options.r,options.phi,options.theta,options.psi,options.phirange,options.thetarange,options.psirange,options.ftol,options.xtol)
global_def.BATCH = False
开发者ID:cpsemmens,项目名称:eman2,代码行数:27,代码来源:sxrot_sym.py
示例10: main
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + " input_stack start end output_stack <mask> --rad=mask_radius"
parser = OptionParser(usage, version=SPARXVERSION)
parser.add_option("--rad", type="int", default=-1, help="radius of mask")
parser.add_option("--verbose", type="int", default=0, help="verbose level (0|1)")
(options, args) = parser.parse_args()
if len(args) < 4:
print "usage: " + usage
print "Please run '" + progname + " -h' for details"
else:
from string import atoi
input_stack = args[0]
imgstart = atoi(args[1])
imgend = atoi(args[2]) + 1
output_stack = args[3]
if len(args) == 5:
mask = args[4]
else:
mask = None
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
from applications import varimax
global_def.BATCH = True
varimax(input_stack, range(imgstart, imgend), output_stack, mask, options.rad, options.verbose)
global_def.BATCH = False
开发者ID:cryoem,项目名称:test,代码行数:33,代码来源:sxvarimax.py
示例11: main
def main():
arglist = []
for arg in sys.argv:
arglist.append( arg )
progname = os.path.basename(sys.argv[0])
usage = progname + " stack outdir <maskfile> --ou=outer_radius --delta=angular_bracket --maxit=max_iter --chunk=data_chunk_for_update --center --CTF --snr=SNR --sym=symmetry --function=user_function --MPI"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--ou", type="float", default=-1, help="outer radius of a circular mask that should encompass the particle< int(nx/2)-1 (set to int(nx/2)-1)")
parser.add_option("--delta", type="float", default=2, help="angular bracket (set to 2)")
parser.add_option("--ts", type="float", default=2, help="shift bracket (set to 2)")
parser.add_option("--center", type="float", default=0, help="-1 - average centering method; 0 - no cetnering of template volume (default), 1 - center the volume using center of gravity")
parser.add_option("--maxit", type="int", default=10, help="maximum number of iterations (set to 10)")
parser.add_option("--chunk", type="float", default=1.0, help="chunk of data after which the 3-D structure will be updated 0<chunk<=1.0 (set to 1.0)")
parser.add_option("--CTF", action="store_true", default=False, help="Consider CTF correction during the alignments")
parser.add_option("--snr", type="float", default=1, help="SNR > 0.0 (set to 1.0)")
parser.add_option("--sym", type="string", default="c1", help="symmetry group (set to c1)")
parser.add_option("--function", type="string", default="ref_ali3d", help="name of the user-supplied reference preparation function")
parser.add_option("--npad", type="int", default= 2, help="padding size for 3D reconstruction")
parser.add_option("--debug", action="store_true", default=False, help="Debug printout")
parser.add_option("--MPI", action="store_true", default=False, help="use MPI version")
parser.add_option("--fourvar", action="store_true", default=False, help="compute Fourier variance")
(options, args) = parser.parse_args(arglist[1:])
if(len(args) < 2 or len(args) > 3):
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
else:
if(len(args) == 2):
mask = None
else:
mask = args[2]
if options.MPI:
from mpi import mpi_init
sys.argv = mpi_init(len(sys.argv), sys.argv)
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
global_def.BATCH = True
if options.fourvar:
from development import nlocal_ali3d_MPI
nlocal_ali3d_MPI(args[0], args[1], mask, options.ou, options.delta, options.ts, options.center, options.maxit,
options.CTF, options.snr, options.sym, options.chunk, options.function, options.fourvar,
options.npad, options.debug)
else:
from applications import local_ali3d
local_ali3d(args[0], args[1], mask, options.ou, options.delta, options.ts, options.center, options.maxit,
options.CTF, options.snr, options.sym, options.chunk, options.function, options.fourvar,
options.npad, options.debug, options.MPI)
global_def.BATCH = False
if options.MPI:
from mpi import mpi_finalize
mpi_finalize()
开发者ID:cpsemmens,项目名称:eman2,代码行数:57,代码来源:sxlocal_ali3d.py
示例12: main
def main():
from optparse import OptionParser
progname = os.path.basename(sys.argv[0])
usage = progname + " filelist outdir --fl=filter_low_value --aa=filter_fall_off --radccc=radius_ccc -repair=repairfile --pca --pcamask --pcanvec --MPI"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--fl", type="float", default=0.0, help="cut-off frequency of hyperbolic tangent low-pass Fourier filter")
parser.add_option("--aa", type="float", default=0.0, help="fall-off of hyperbolic tangent low-pass Fourier filter")
parser.add_option("--radccc", type="int", default=-1, help="radius for ccc calculation")
parser.add_option("--MPI", action="store_true", default=False, help="use MPI version" )
parser.add_option("--repair", type="string", default="default", help="repair original bootstrap volumes: None or repair file name")
parser.add_option("--pca", action="store_true", default=False, help="run pca" )
parser.add_option("--pcamask", type="string", default=None, help="mask for pca" )
parser.add_option("--pcanvec", type="int", default=2, help="number of eigvectors computed in PCA")
parser.add_option("--n", action="store_true", default=False, help="new")
parser.add_option("--scratch", type="string", default="./", help="scratch directory")
(options, args) = parser.parse_args(sys.argv[1:])
if len(args)<2 :
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
else:
files = args[0:-1]
outdir = args[-1]
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
if options.MPI:
from mpi import mpi_init
sys.argv = mpi_init( len(sys.argv), sys.argv )
arglist = []
for arg in sys.argv:
arglist.append( arg )
global_def.BATCH = True
if(options.n):
from development import var_mpi_new
var_mpi_new( files[0], outdir, options.scratch, options.fl, options.aa, options.radccc, False, False, options.repair, options.pca, options.pcamask, options.pcanvec)
else:
from applications import var_mpi
var_mpi( files, outdir, options.fl, options.aa, options.radccc, options.repair, options.pca, options.pcamask, options.pcanvec)
global_def.BATCH = False
from mpi import mpi_finalize
mpi_finalize()
else:
global_def.BATCH = True
ERROR("Please use MPI version","sxvar",1)
from applications import defvar
defvar( files, outdir, options.fl, options.aa, options.radccc, options.repair, options.pca, options.pcamask, options.pcanvec)
global_def.BATCH = False
开发者ID:cpsemmens,项目名称:eman2,代码行数:54,代码来源:sxvar.py
示例13: main
def main():
arglist = []
for arg in sys.argv:
arglist.append( arg )
progname = os.path.basename(sys.argv[0])
usage = progname + " data_stack reference_stack outdir <maskfile> --ir=inner_radius --ou=outer_radius --rs=ring_step --xr=x_range --yr=y_range --ts=translation_step --center=center_type --maxit=max_iteration --CTF --snr=SNR --function=user_function_name --rand_seed=random_seed --MPI"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--ir", type="float", default=1, help=" inner radius for rotational correlation > 0 (set to 1)")
parser.add_option("--ou", type="float", default=-1, help=" outer radius for rotational correlation < nx/2-1 (set to the radius of the particle)")
parser.add_option("--rs", type="float", default=1, help=" step between rings in rotational correlation > 0 (set to 1)" )
parser.add_option("--xr", type="float", default=0, help=" range for translation search in x direction, search is +/-xr ")
parser.add_option("--yr", type="float", default=0, help=" range for translation search in y direction, search is +/-yr ")
parser.add_option("--ts", type="float", default=1, help=" step of translation search in both directions")
parser.add_option("--center", type="float", default=1, help=" 0 - if you do not want the average to be centered, 1 - center the average (default=1)")
parser.add_option("--maxit", type="float", default=10, help=" maximum number of iterations (set to 10) ")
parser.add_option("--CTF", action="store_true", default=False, help=" Consider CTF correction during multiple reference alignment")
parser.add_option("--snr", type="float", default= 1.0, help=" signal-to-noise ratio of the data (set to 1.0)")
parser.add_option("--function", type="string", default="ref_ali2d", help=" name of the reference preparation function")
parser.add_option("--rand_seed", type="int", default=1000, help=" random seed of initial (set to 1000)" )
parser.add_option("--MPI", action="store_true", default=False, help=" whether to use MPI version ")
parser.add_option("--EQ", action="store_true", default=False, help=" equal version ")
(options, args) = parser.parse_args(arglist[1:])
if len(args) < 3 or len(args) > 4:
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
else:
if len(args) == 3:
mask = None
else:
mask = args[3]
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
if options.MPI:
from mpi import mpi_init
sys.argv = mpi_init(len(sys.argv), sys.argv)
global_def.BATCH = True
if options.EQ:
from development import mrefeq_ali2df
#print " calling MPI",options.MPI,options.function,options.rand_seed
#print args
mrefeq_ali2df(args[0], args[1], mask, options.ir, options.ou, options.rs, options.xr, options.yr, options.ts, options.center, options.maxit, options.CTF, options.snr, options.function, options.rand_seed, options.MPI)
else:
from applications import mref_ali2d
mref_ali2d(args[0], args[1], args[2], mask, options.ir, options.ou, options.rs, options.xr, options.yr, options.ts, options.center, options.maxit, options.CTF, options.snr, options.function, options.rand_seed, options.MPI)
global_def.BATCH = False
if options.MPI:
from mpi import mpi_finalize
mpi_finalize()
开发者ID:cpsemmens,项目名称:eman2,代码行数:53,代码来源:sxmref_ali2d.py
示例14: main
def main():
import sys
arglist = []
for arg in sys.argv:
arglist.append( arg )
progname = os.path.basename(arglist[0])
usage = progname + " prjstack outdir bufprefix --delta --d --nvol --nbufvol --seedbase --snr --npad --CTF --MPI --verbose"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--nvol", type="int", help="number of resample volumes to be generated")
parser.add_option("--nbufvol", type="int", default=1, help="number of fftvols in the memory")
parser.add_option("--delta", type="float", default=10.0, help="angular step for cones")
parser.add_option("--d", type="float", default=0.1, help="fraction of projections to leave out")
parser.add_option("--CTF", action="store_true", default=False, help="use CTF")
parser.add_option("--snr", type="float", default=1.0, help="Signal-to-Noise Ratio")
parser.add_option("--npad", type="int", default=2, help="times of padding")
parser.add_option("--seedbase", type="int", default=-1, help="random seed base")
parser.add_option("--MPI", action="store_true", default=False, help="use MPI")
parser.add_option("--verbose", type="int", default=0, help="verbose level: 0 no, 1 yes")
(options, args) = parser.parse_args( arglist[1:] )
if( len(args) !=1 and len(args) != 3):
print "usage: " + usage
return None
prjfile = args[0]
if options.MPI:
from mpi import mpi_barrier, mpi_comm_rank, mpi_comm_size, mpi_comm_split, MPI_COMM_WORLD
from mpi import mpi_init
sys.argv = mpi_init( len(sys.argv), sys.argv )
myid = mpi_comm_rank( MPI_COMM_WORLD )
ncpu = mpi_comm_size( MPI_COMM_WORLD )
else:
myid = 0
ncpu = 1
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
outdir = args[1]
bufprefix = args[2]
resample( prjfile, outdir, bufprefix, options.nbufvol, options.nvol, options.seedbase,\
options.delta, options.d, options.snr, options.CTF, options.npad,\
options.MPI, myid, ncpu, options.verbose )
if options.MPI:
from mpi import mpi_finalize
mpi_finalize()
开发者ID:cpsemmens,项目名称:eman2,代码行数:52,代码来源:sxresample.py
示例15: main
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + " stack outdir <maskfile> --ir=inner_radius --ou=outer_radius --rs=ring_step --xr=x_range --yr=y_range --ts=translation_step --dst=delta --center=center --maxit=max_iteration --CTF --snr=SNR --Fourvar=Fourier_variance --Ng=group_number --Function=user_function_name --CUDA --GPUID --MPI"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--ir", type="float", default=1, help="inner radius for rotational correlation > 0 (set to 1)")
parser.add_option("--ou", type="float", default=-1, help="outer radius for rotational correlation < nx/2-1 (set to the radius of the particle)")
parser.add_option("--rs", type="float", default=1, help="step between rings in rotational correlation > 0 (set to 1)" )
parser.add_option("--xr", type="string", default="4 2 1 1", help="range for translation search in x direction, search is +/xr ")
parser.add_option("--yr", type="string", default="-1", help="range for translation search in y direction, search is +/yr ")
parser.add_option("--ts", type="string", default="2 1 0.5 0.25",help="step of translation search in both directions")
parser.add_option("--dst", type="float", default=0.0, help="delta")
parser.add_option("--center", type="float", default=-1, help="-1.average center method; 0.not centered; 1.phase approximation; 2.cc with Gaussian function; 3.cc with donut-shaped image 4.cc with user-defined reference 5.cc with self-rotated average")
parser.add_option("--maxit", type="float", default=0, help="maximum number of iterations (0 means the maximum iterations is 10, but it will automatically stop should the criterion falls")
parser.add_option("--CTF", action="store_true", default=False, help="use CTF correction during alignment ")
parser.add_option("--snr", type="float", default=1.0, help="signal-to-noise ratio of the data (set to 1.0)")
parser.add_option("--Fourvar", action="store_true", default=False, help="compute Fourier variance")
parser.add_option("--Ng", type="int", default=-1, help="number of groups in the new CTF filteration")
parser.add_option("--num_ali", type="int", default=3, help="number of independent alignments to do")
parser.add_option("--function", type="string", default="ref_ali2d", help="name of the reference preparation function (default ref_ali2d)")
parser.add_option("--CUDA", action="store_true", default=False, help="use CUDA program")
parser.add_option("--GPUID", type="string", default="", help="ID of GPUs available")
parser.add_option("--MPI", action="store_true", default=False, help="use MPI version ")
(options, args) = parser.parse_args()
if len(args) < 2 or len(args) > 3:
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
else:
if args[1] == 'None': outdir = None
else: outdir = args[1]
if len(args) == 2: mask = None
else: mask = args[2]
from development import multi_ali2d
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
if options.MPI:
from mpi import mpi_init
sys.argv = mpi_init(len(sys.argv),sys.argv)
global_def.BATCH = True
multi_ali2d(args[0], outdir, mask, options.ir, options.ou, options.rs, options.xr, options.yr, options.ts, options.dst, options.center, \
options.maxit, options.CTF, options.snr, options.Fourvar, options.Ng, options.num_ali, options.function, options.CUDA, options.GPUID, options.MPI)
global_def.BATCH = False
if options.MPI:
from mpi import mpi_finalize
mpi_finalize()
开发者ID:cpsemmens,项目名称:eman2,代码行数:51,代码来源:sxmulti_ali2d.py
示例16: main
def main():
arglist = []
for arg in sys.argv:
arglist.append( arg )
progname = os.path.basename(sys.argv[0])
usage = progname + " stack ref_vol outdir <maskfile> --ou=outer_radius --delta=angular_bracket --ts --nassign --nrefine --MPI --function --fourvar --maxit=max_iter ----termprec=percentage_to_stop --npad --debug --CTF --snr=SNR --sym=symmetry"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--ou", type="float", default=-1, help="radius < int(nx/2)-1 (set to int(nx/2)-1)")
parser.add_option("--delta", type="float", default=2, help="angular bracket (set to 2)")
parser.add_option("--ts", type="float", default=2.0, help="shift bracket (set to 2)")
parser.add_option("--maxit", type="int", default=2, help="maximum number of iterations (set to 10) ")
parser.add_option("--termprec", type="float", default=0.0, help="Minimum percentage of assignment change to stop the program")
parser.add_option("--nassign", type="int", default=4, help="number of assignment steps in one iteration")
parser.add_option("--nrefine", type="int", default=1, help="number of refinement steps in one iteration")
parser.add_option("--CTF", action="store_true", default=False, help="Consider CTF correction during the alignment ")
parser.add_option("--snr", type="float", default=1, help="SNR > 0.0 (set to 1.0)")
parser.add_option("--sym", type="string", default="c1", help="symmetry group (set to c1)")
parser.add_option("--MPI", action="store_true", default=False, help="use MPI version ")
parser.add_option("--function", type="string", default="ref_ali3dm", help="user function")
parser.add_option("--fourvar", action="store_true", default=False, help="use fourier variance.")
parser.add_option("--debug", action="store_true", default=False, help="debug mode ")
parser.add_option("--npad", type="int", default=2, help="npad")
(options, args) = parser.parse_args(arglist[1:])
if(len(args) < 3 or len(args) > 4):
print "usage: " + usage
print "Please run '" + progname + " -h' for detailed options"
else:
if(len(args) == 3):
mask = None
else:
mask = args[3]
if(options.MPI):
from mpi import mpi_init
sys.argv = mpi_init( len(sys.argv), sys.argv )
if global_def.CACHE_DISABLE:
from utilities import disable_bdb_cache
disable_bdb_cache()
from applications import local_ali3dm_MPI
global_def.BATCH = True
if options.MPI:
local_ali3dm_MPI(args[0], args[1], args[2], mask, options.ou, options.delta,options.ts, options.maxit, options.nassign, options.nrefine, options.CTF, options.snr, options.sym,options.function, options.fourvar, options.npad, options.debug, options.termprec)
else:
print 'ali3d_em serial version not implemented'
global_def.BATCH = False
开发者ID:cpsemmens,项目名称:eman2,代码行数:51,代码来源:sxlocal_ali3dm.py
示例17: main
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + " out_averages outdir --ou=outer_radius --xr=x_range --ts=translation_step --maxit=max_iteration --CTF --snr=SNR --function=user_function_name --Fourvar --ali=kind_of_alignment --center=center_type"
parser = OptionParser(usage,version=SPARXVERSION)
parser.add_option("--ou", type="int", default=-1, help="outer radius for rotational correlation < nx/2-1 (set to the radius of the particle)")
parser.add_option("--xr", type="string", default="4 2", help="range for translation search in x direction, search is +/xr ")
parser.add_option("--ts", type="string", default="2 1", help="step of translation search in both directions")
parser.add_option("--maxit", type="float", default=0, help="maximum number of iterations (0 means the maximum iterations is 10, but it will automatically stop should the criterion falls")
parser.add_option("--CTF",
|
请发表评论