当前位置: 首页>>代码示例>>Python>>正文


Python ExperimentListFactory.from_xds方法代码示例

本文整理汇总了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!"
开发者ID:dials,项目名称:dials,代码行数:63,代码来源:import_xds.py


注:本文中的dxtbx.model.experiment.experiment_list.ExperimentListFactory.from_xds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。