Exemplo n.º 1
0
def check_asu(group_type_number, asu, n, is_stripped_asu, soft_mode):
    sg_info = sgtbx.space_group(asu.hall_symbol).info()
    sg_info.show_summary()
    if (group_type_number > 0):
        assert sg_info.type().number() == group_type_number
    print("Gridding:", n)
    ops = sg_info.group()
    check_compatibility_with_sampling_grid(asu=asu)
    sys.stdout.flush()
    u_grid, r_grid, colored_grid_points, sampling_n_redundancies = sample_asu(
        asu, n, is_stripped_asu=is_stripped_asu)
    n_redundancies = 0
    redundancies = {}
    for i in range(n[0]):
        for j in range(n[1]):
            for k in range(n[2]):
                n_redundancies += grid_asu(
                    ops=ops,
                    n=n,
                    u_grid=u_grid,
                    r_grid=r_grid,
                    i=i,
                    j=j,
                    k=k,
                    sampling_n_redundancies=sampling_n_redundancies,
                    redundancies=redundancies,
                    soft_mode=soft_mode)
    print("number of redundancies: %d+%d," %
          (sampling_n_redundancies, n_redundancies),
          end=' ')
    sg_info.show_summary()
    sys.stdout.flush()
    redundancies = sort_redundancies(redundancies)
    recolor_grid_points(n, colored_grid_points, redundancies,
                        not is_stripped_asu)
    jv_asu.asu_as_jvx(group_type_number,
                      asu,
                      colored_grid_points=colored_grid_points)
    if (not is_stripped_asu):
        analyze_redundancies(asu, n, redundancies)
        if (not soft_mode):
            assert sampling_n_redundancies == 0
            assert n_redundancies == 0
    sys.stdout.flush()
Exemplo n.º 2
0
            numbers = [int(n) for n in arg.split('-')]
            assert len(numbers) in (1, 2)
            if (len(numbers) == 1): numbers *= 2
            for group_type_number in range(numbers[0], numbers[1] + 1):
                if (not flags.plane_group):
                    asu_original = reference_table.get_asu(group_type_number)
                    assert sgtbx.space_group(asu_original.hall_symbol) \
                        == sgtbx.space_group_info(number=group_type_number).group()
                else:
                    from cctbx.sgtbx.direct_space_asu import plane_group_reference_table
                    asu_original = plane_group_reference_table.get_asu(
                        point_group_number=group_type_number)
                    print("Plane group number:", group_type_number)
                    group_type_number *= -1
                asu = asu_original
                if (flags.strip or flags.strip_polygons):
                    asu = asu_original.shape_only()
                print("Writing asu_gallery files")
                jv_asu.asu_as_jvx(group_type_number, asu)
                if (flags.strip_grid):
                    asu = asu_original.shape_only()
                if (flags.show_asu):
                    asu.show_comprehensive_summary()
                check_asu(group_type_number=group_type_number,
                          asu=asu,
                          n=gridding,
                          is_stripped_asu=(flags.strip or flags.strip_grid),
                          soft_mode=flags.soft)
                if (flags.multiplicities):
                    check_multiplicities(asu=asu_original, n=gridding)