Пример #1
0
def run(http_server_name=None, html_subdir="asu_gallery"):
    parser = OptionParser(
        usage="usage: python jv_asu.py [options] [numbers...]")
    parser.add_option("-s",
                      "--server",
                      action="store",
                      type="string",
                      help="network name of http server",
                      metavar="NAME")
    parser.add_option("-p", "--plane_group", action="store_true")
    options, args = parser.parse_args()
    if (options.server is not None):
        http_server_name = options.server
    if (not os.path.isdir(html_subdir)):
        os.makedirs(html_subdir)
    jv_index.write_html(open("%s/index.html" % html_subdir, "w"))
    guide_to_notation.write_html(
        open("%s/guide_to_notation.html" % html_subdir, "w"))
    if (len(args) == 0):
        if (options.plane_group):
            args = ["1-17"]
        else:
            args = ["1-230"]
    for arg in args:
        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 xrange(numbers[0], numbers[1] + 1):
            if (options.plane_group):
                print "Plane group number:", group_type_number
                from cctbx.sgtbx.direct_space_asu import plane_group_reference_table
                asu = plane_group_reference_table.get_asu(group_type_number)
                group_type_number *= -1
            else:
                print "Space group number:", group_type_number
                asu = reference_table.get_asu(group_type_number)
            for colored_grid_points in [None, []]:
                asu_as_jvx(group_type_number=group_type_number,
                           asu=asu,
                           colored_grid_points=colored_grid_points,
                           http_server_name=http_server_name,
                           html_subdir=html_subdir)
Пример #2
0
def run(http_server_name=None, html_subdir="asu_gallery"):
    parser = OptionParser(usage="usage: python jv_asu.py [options] [numbers...]")
    parser.add_option(
        "-s", "--server", action="store", type="string", help="network name of http server", metavar="NAME"
    )
    parser.add_option("-p", "--plane_group", action="store_true")
    options, args = parser.parse_args()
    if options.server is not None:
        http_server_name = options.server
    if not os.path.isdir(html_subdir):
        os.makedirs(html_subdir)
    jv_index.write_html(open("%s/index.html" % html_subdir, "w"))
    guide_to_notation.write_html(open("%s/guide_to_notation.html" % html_subdir, "w"))
    if len(args) == 0:
        if options.plane_group:
            args = ["1-17"]
        else:
            args = ["1-230"]
    for arg in args:
        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 xrange(numbers[0], numbers[1] + 1):
            if options.plane_group:
                print "Plane group number:", group_type_number
                from cctbx.sgtbx.direct_space_asu import plane_group_reference_table

                asu = plane_group_reference_table.get_asu(group_type_number)
                group_type_number *= -1
            else:
                print "Space group number:", group_type_number
                asu = reference_table.get_asu(group_type_number)
            for colored_grid_points in [None, []]:
                asu_as_jvx(
                    group_type_number=group_type_number,
                    asu=asu,
                    colored_grid_points=colored_grid_points,
                    http_server_name=http_server_name,
                    html_subdir=html_subdir,
                )
Пример #3
0
             for i in (76, 78, 91, 95, 92, 96, 144, 145, 151, 153, 152, 154,
                       169, 170, 171, 172, 178, 179, 180, 181, 212, 213)
         ])
 if (len(flags.regular_args) > 1):
     for arg in flags.regular_args[1:]:
         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),