本文整理汇总了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
示例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