Exemple #1
0
def test_stills_indexer_methods_i04_weak_data(i04_weak_data, indexing_method,
                                              space_group, unit_cell):
    reflections = slice_reflections(i04_weak_data["reflections"], [(1, 2)])
    experiments = slice_experiments(i04_weak_data["experiments"], [(1, 2)])
    for experiment in experiments:
        experiment.imageset = ImageSet(experiment.imageset.data(),
                                       experiment.imageset.indices())
        experiment.imageset.set_scan(None)
        experiment.imageset.set_goniometer(None)
        experiment.scan = None
        experiment.goniometer = None
    params = phil_scope.fetch().extract()
    params.indexing.method = indexing_method
    params.indexing.basis_vector_combinations.max_refine = 5
    if unit_cell is not None:
        params.indexing.known_symmetry.unit_cell = uctbx.unit_cell(unit_cell)
    if space_group is not None:
        params.indexing.known_symmetry.space_group = sgtbx.space_group_info(
            space_group)
    try:
        idxr = stills_indexer.StillsIndexerBasisVectorSearch(
            reflections, experiments, params)
    except RuntimeError:
        idxr = stills_indexer.StillsIndexerLatticeSearch(
            reflections, experiments, params)
    idxr.index()

    indexed_experiments = idxr.refined_experiments
    assert len(indexed_experiments) == 1
    assert indexed_experiments[0].crystal.get_unit_cell().parameters(
    ) == pytest.approx((57.752, 57.776, 150.013, 90.0101, 89.976, 90.008),
                       rel=1e-2)
Exemple #2
0
def test_BasisVectorSearch_i04_weak_data(i04_weak_data, indexing_method,
                                         space_group, unit_cell):
    reflections = i04_weak_data["reflections"]
    experiments = i04_weak_data["experiments"]
    params = phil_scope.fetch().extract()
    params.indexing.refinement_protocol.n_macro_cycles = 2
    params.indexing.basis_vector_combinations.max_refine = 5
    params.indexing.method = indexing_method
    if unit_cell is not None:
        params.indexing.known_symmetry.unit_cell = uctbx.unit_cell(unit_cell)
    if space_group is not None:
        params.indexing.known_symmetry.space_group = sgtbx.space_group_info(
            space_group)
    idxr = lattice_search.BasisVectorSearch(reflections, experiments, params)
    idxr.index()

    indexed_experiments = idxr.refined_experiments
    assert len(indexed_experiments) == 1
    assert indexed_experiments[0].crystal.get_unit_cell().parameters(
    ) == pytest.approx((57.752, 57.776, 150.013, 90.0101, 89.976, 90.008),
                       rel=1e-3)
Exemple #3
0
  experiments_filename = None
  indexed_filename = None
  refined_experiments_filename = None
  integrated_experiments_filename = None
  integrated_filename = None
  profile_filename = None
  integration_pickle = None
}
indexing {
  refinement_protocol {
    d_min_start = 2.0
  }
}
"""
idx_work_phil = ip.parse(custom_idx_string)
idx_phil = idx_scope.fetch(source=idx_work_phil)

custom_brv_sting = """
crystal_id = 0
output {
  directory = "."
  log = None
  prefix = None
  }
"""

brv_work_phil = ip.parse(custom_brv_sting)
brv_phil = brv_scope.fetch(source=brv_work_phil)

custom_int_string = """
output {