本文整理匯總了Python中xia2.Handlers.Flags.Flags.get_reversephi方法的典型用法代碼示例。如果您正苦於以下問題:Python Flags.get_reversephi方法的具體用法?Python Flags.get_reversephi怎麽用?Python Flags.get_reversephi使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類xia2.Handlers.Flags.Flags
的用法示例。
在下文中一共展示了Flags.get_reversephi方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: update
# 需要導入模塊: from xia2.Handlers.Flags import Flags [as 別名]
# 或者: from xia2.Handlers.Flags.Flags import get_reversephi [as 別名]
def update(self):
'''Check to see if any more frames have appeared - if they
have update myself and reset.'''
images = find_matching_images(self._template,
self._directory)
if len(images) > len(self._images):
self._images = images
from xia2.Schema import load_imagesets
imagesets = load_imagesets(
self._template, self._directory, id_image=self._id_image,
use_cache=False, reversephi=Flags.get_reversephi())
max_images = 0
best_sweep = None
for imageset in imagesets:
scan = imageset.get_scan()
if scan is None: continue
if imageset.get_scan().get_num_images() > max_images:
best_sweep = imageset
self._imageset = best_sweep
return
示例2: SweepFactory
# 需要導入模塊: from xia2.Handlers.Flags import Flags [as 別名]
# 或者: from xia2.Handlers.Flags.Flags import get_reversephi [as 別名]
def SweepFactory(template, directory, beam = None):
'''A factory which will return a list of sweep objects which match
the input template and directory.'''
sweeps = []
from xia2.Schema import load_imagesets
imagesets = load_imagesets(
template, directory, reversephi=Flags.get_reversephi())
for imageset in imagesets:
scan = imageset.get_scan()
if scan is not None:
sweeps.append(
Sweep(template, directory,
imageset=imageset,
id_image=scan.get_image_range()[0],
beam=beam))
return sweeps
示例3: __init__
# 需要導入模塊: from xia2.Handlers.Flags import Flags [as 別名]
# 或者: from xia2.Handlers.Flags.Flags import get_reversephi [as 別名]
def __init__(self, name,
wavelength,
sample,
directory = None,
image = None,
beam = None,
reversephi = False,
distance = None,
gain = 0.0,
dmin = 0.0,
dmax = 0.0,
polarization = 0.0,
frames_to_process = None,
user_lattice = None,
user_cell = None,
epoch = 0,
ice = False,
excluded_regions = []):
'''Create a new sweep named name, belonging to XWavelength object
wavelength, representing the images in directory starting with image,
with beam centre optionally defined.'''
# + check the wavelength is an XWavelength object
# raise an exception if not... or not...
if not wavelength.__class__.__name__ == 'XWavelength':
pass
# FIXME bug 2221 if DIRECTORY starts with ~/ or ~graeme (say) need to
# interpret this properly - e.g. map it to a full PATH.
directory = expand_path(directory)
# bug # 2274 - maybe migrate the data to a local disk (this
# will depend if the user has added -migrate_data to the cl)
directory = FileHandler.migrate(directory)
self._name = name
self._wavelength = wavelength
self._sample = sample
self._directory = directory
self._image = image
self._reversephi = reversephi
self._epoch = epoch
self._user_lattice = user_lattice
self._user_cell = user_cell
self._header = { }
self._resolution_high = dmin
self._resolution_low = dmax
self._ice = ice
self._excluded_regions = excluded_regions
self._imageset = None
# FIXME in here also need to be able to accumulate the total
# dose from all experimental measurements (complex) and provide
# a _epoch_to_dose dictionary or some such... may be fiddly as
# this will need to parse across multiple templates. c/f Bug # 2798
self._epoch_to_image = { }
self._image_to_epoch = { }
# to allow first, last image for processing to be
# set... c/f integrater interface
self._frames_to_process = frames_to_process
# + derive template, list of images
if directory and image:
self._template, self._directory = \
image2template_directory(os.path.join(directory,
image))
from xia2.Schema import load_imagesets
imagesets = load_imagesets(
self._template, self._directory, image_range=self._frames_to_process,
reversephi=(Flags.get_reversephi() or self._reversephi))
assert len(imagesets) == 1, "one imageset expected, %d found" % \
len(imagesets)
self._imageset = copy.deepcopy(imagesets[0])
start, end = self._imageset.get_array_range()
self._images = list(range(start+1, end+1))
# FIXME in here check that (1) the list of images is continuous
# and (2) that all of the images are readable. This should also
# take into account frames_to_process if set.
if self._frames_to_process is None:
self._frames_to_process = min(self._images), max(self._images)
start, end = self._frames_to_process
error = False
from xia2.Handlers.Phil import PhilIndex
params = PhilIndex.get_python_object()
if params.general.check_image_files_readable:
for j in range(start, end + 1):
if not j in self._images:
#.........這裏部分代碼省略.........