本文整理汇总了Python中dxtbx.model.experiment.experiment_list.ExperimentListFactory.from_xds方法的典型用法代码示例。如果您正苦于以下问题:Python ExperimentListFactory.from_xds方法的具体用法?Python ExperimentListFactory.from_xds怎么用?Python ExperimentListFactory.from_xds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dxtbx.model.experiment.experiment_list.ExperimentListFactory
的用法示例。
在下文中一共展示了ExperimentListFactory.from_xds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from dxtbx.model.experiment.experiment_list import ExperimentListFactory [as 别名]
# 或者: from dxtbx.model.experiment.experiment_list.ExperimentListFactory import from_xds [as 别名]
def __call__(self, params, options):
from dxtbx.model.experiment.experiment_list import ExperimentListFactory
from dxtbx.model.experiment.experiment_list import ExperimentListDumper
import os
# Get the XDS.INP file
xds_inp = os.path.join(self.args[0], 'XDS.INP')
if params.input.xds_file is None:
xds_file = XDSFileImporter.find_best_xds_file(self.args[0])
else:
xds_file = os.path.join(self.args[0], params.input.xds_file)
# Check a file is given
if xds_file is None:
raise RuntimeError('No XDS file found')
# Load the experiment list
unhandled = []
experiments = ExperimentListFactory.from_xds(xds_inp, xds_file)
# Print out any unhandled files
if len(unhandled) > 0:
print '-' * 80
print 'The following command line arguments were not handled:'
for filename in unhandled:
print ' %s' % filename
# Print some general info
print '-' * 80
print 'Read %d experiments from %s' % (len(experiments), xds_file)
# Attempt to create scan-varying crystal model if requested
if params.read_varying_crystal:
integrate_lp = os.path.join(self.args[0], 'INTEGRATE.LP')
if os.path.isfile(integrate_lp):
self.extract_varying_crystal(integrate_lp, experiments)
else:
print "No INTEGRATE.LP to extract varying crystal model. Skipping"
# Loop through the data blocks
for i, exp in enumerate(experiments):
# Print some experiment info
print "-" * 80
print "Experiment %d" % i
print " format: %s" % str(exp.imageset.reader().get_format_class())
print " type: %s" % type(exp.imageset)
print " num images: %d" % len(exp.imageset)
# Print some model info
if options.verbose > 1:
print ""
if exp.beam: print exp.beam
else: print "no beam!"
if exp.detector: print exp.detector
else: print "no detector!"
if exp.goniometer: print exp.goniometer
else: print "no goniometer!"
if exp.scan: print exp.scan
else: print "no scan!"
if exp.crystal: print exp.crystal
else: print "no crystal!"