當前位置: 首頁>>代碼示例>>Python>>正文


Python ExperimentList.extend方法代碼示例

本文整理匯總了Python中dxtbx.model.experiment.experiment_list.ExperimentList.extend方法的典型用法代碼示例。如果您正苦於以下問題:Python ExperimentList.extend方法的具體用法?Python ExperimentList.extend怎麽用?Python ExperimentList.extend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dxtbx.model.experiment.experiment_list.ExperimentList的用法示例。


在下文中一共展示了ExperimentList.extend方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: flatten_experiments

# 需要導入模塊: from dxtbx.model.experiment.experiment_list import ExperimentList [as 別名]
# 或者: from dxtbx.model.experiment.experiment_list.ExperimentList import extend [as 別名]
def flatten_experiments(filename_object_list):
  '''
  Flatten a list of experiment lists

  :param filename_object_list: The parameter item
  :return: The flattened experiment lists

  '''
  from dxtbx.model.experiment.experiment_list import ExperimentList
  result = ExperimentList()
  for i in range(len(filename_object_list)):
    result.extend(filename_object_list[i].data)
  return result
開發者ID:dials,項目名稱:dials,代碼行數:15,代碼來源:options.py

示例2: XDSRefiner

# 需要導入模塊: from dxtbx.model.experiment.experiment_list import ExperimentList [as 別名]
# 或者: from dxtbx.model.experiment.experiment_list.ExperimentList import extend [as 別名]

#.........這裏部分代碼省略.........
        for file in ['XPARM.XDS']:
          xds_data_files[file] = os.path.join(
            self.get_working_directory(), 'xds', file)

        for k, v in xds_data_files.items():
          idxr.set_indexer_payload(k, v)

      # check that the indexer is an XDS indexer - if not then
      # create one...

      elif not idxr.get_indexer_payload('XPARM.XDS'):
        Debug.write('Generating an XDS indexer')

        idxr_old = idxr

        from xia2.Modules.Indexer.XDSIndexer import XDSIndexer
        idxr = XDSIndexer()
        idxr.set_indexer_sweep(idxr_old.get_indexer_sweep())
        self._refinr_indexers[epoch] = idxr
        self.set_refiner_prepare_done(False)

        # note to self for the future - this set will reset the
        # integrater prepare done flag - this means that we will
        # go through this routine all over again. However this
        # is not a problem as all that will happen is that the
        # results will be re-got, no additional processing will
        # be performed...


        # set the indexer up as per the frameprocessor interface...
        # this would usually happen within the IndexerFactory.

        idxr.set_indexer_sweep_name(idxr_old.get_indexer_sweep_name())

        idxr.add_indexer_imageset(idxr_old.get_imageset())
        idxr.set_working_directory(idxr_old.get_working_directory())

        # now copy information from the old indexer to the new
        # one - lattice, cell, distance etc.

        # bug # 2434 - providing the correct target cell
        # may be screwing things up - perhaps it would
        # be best to allow XDS just to index with a free
        # cell but target lattice??
        cell = crystal_model.get_unit_cell().parameters()
        check = PhilIndex.params.xia2.settings.xds_check_cell_deviation

        # FIXME this was changed in #42 but not sure logic is right
        if not check:
          Debug.write(
              'Inputting target cell: %.2f %.2f %.2f %.2f %.2f %.2f' % \
              cell)
          idxr.set_indexer_input_cell(cell)
        input_cell = cell

        from cctbx.sgtbx import bravais_types
        lattice = str(
          bravais_types.bravais_lattice(group=crystal_model.get_space_group()))
        idxr.set_indexer_input_lattice(lattice)

        if user_assigned:
          Debug.write('Assigning the user given lattice: %s' % \
                      lattice)
          idxr.set_indexer_user_input_lattice(True)

        idxr.set_detector(experiment.detector)
        idxr.set_beam(experiment.beam)
        idxr.set_goniometer(experiment.goniometer)

        # re-get the unit cell &c. and check that the indexing
        # worked correctly

        Debug.write('Rerunning indexing with XDS')

        experiments = idxr.get_indexer_experiment_list()
        assert len(experiments) == 1 # currently only handle one lattice/sweep
        experiment = experiments[0]
        crystal_model = experiment.crystal

        # then in here check that the target unit cell corresponds
        # to the unit cell I wanted as input...? now for this I
        # should probably compute the unit cell volume rather
        # than comparing the cell axes as they may have been
        # switched around...

        # FIXME comparison needed



  def _refine(self):
    import copy
    from dxtbx.model.experiment.experiment_list import ExperimentList
    self._refinr_refined_experiment_list = ExperimentList()
    for epoch, idxr in self._refinr_indexers.iteritems():
      self._refinr_payload[epoch] = copy.deepcopy(idxr._indxr_payload)
      self._refinr_refined_experiment_list.extend(
        idxr.get_indexer_experiment_list())

  def _refine_finish(self):
    pass
開發者ID:xia2,項目名稱:xia2,代碼行數:104,代碼來源:XDSRefiner.py


注:本文中的dxtbx.model.experiment.experiment_list.ExperimentList.extend方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。