Пример #1
0
def parse_args():
    parser = argparse.ArgumentParser(
        description='Render a movie of traffic found in a delimited text file',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    argument_groups.use_argument_group("delimited_text_point_reader", parser)
    argument_groups.use_argument_group("trajectory_assembly", parser)
    argument_groups.use_argument_group("trajectory_rendering", parser)
    argument_groups.use_argument_group("mapmaker", parser)
    argument_groups.use_argument_group("movie_rendering", parser)

    parser.add_argument(
        '--trail-duration',
        help="How long should each object's trail last? (seconds)",
        type=int,
        default=300)

    parser.add_argument('point_data_file',
                        nargs=1,
                        help='Delimited text file containing point data')

    parser.add_argument('movie_file',
                        nargs=1,
                        help='Filename for trajectory movie')

    args = parser.parse_args()
    if args.resolution is None:
        args.resolution = [800, 600]
    if args.delimiter == 'tab':
        args.delimiter = '\t'

    return args
Пример #2
0
def parse_args():
    parser = argparse.ArgumentParser()
    argument_groups.use_argument_group("delimited_text_point_reader", parser)
    argument_groups.use_argument_group("trajectory_assembly", parser)
    argument_groups.use_argument_group("trajectory_rendering", parser)
    argument_groups.use_argument_group("mapmaker", parser)

    parser.add_argument(
        '--resolution',
        '-r',
        nargs=2,
        type=int,
        help='Resolution of output image.  Defaults to 800 600.')

    parser.add_argument('--dpi',
                        type=int,
                        default=72,
                        help='DPI of output image.')

    parser.add_argument('point_data_file',
                        nargs=1,
                        help='Delimited text file containing point data')

    parser.add_argument('image_file',
                        nargs=1,
                        help='Filename for trajectory image')

    args = parser.parse_args()

    if args.resolution is None:
        args.resolution = [800, 600]
    if args.delimiter == 'tab':
        args.delimiter = '\t'

    return args
Пример #3
0
def parse_args():
    parser = argparse.ArgumentParser()
    argument_groups.use_argument_group("trajectory_rendering", parser)
    argument_groups.use_argument_group("mapmaker", parser)

    parser.add_argument(
        '--resolution',
        '-r',
        nargs=2,
        type=int,
        help='Resolution of output image.  Defaults to 800 600.')

    parser.add_argument('--dpi',
                        type=int,
                        default=72,
                        help='DPI of output image')

    parser.add_argument('trajectory_data_file',
                        nargs=1,
                        help='File containing trajectory data')

    parser.add_argument('image_file',
                        nargs=1,
                        help='Filename for trajectory image')

    args = parser.parse_args()

    if args.resolution is None:
        args.resolution = [800, 600]

    return args
def parse_args():
    parser = argparse.ArgumentParser()
    argument_groups.use_argument_group("mapmaker", parser)
    argument_groups.use_argument_group("delimited_text_point_reader", parser)

    parser.add_argument(
        '--colormap',
        '-c',
        default='gist_heat',
        help=
        'Name of colormap for histogram.  Defaults to "bone".  See matplotlib documentation for a list of possibilities.'
    )

    parser.add_argument(
        '--scale',
        '-s',
        default='linear',
        choices=['linear', 'log', 'logarithmic'],
        help=
        'Mapping from histogram counts to colors.  Defaults to "linear" but can also be "log" or "logarithmic".'
    )

    parser.add_argument(
        '--histogram-bin-size',
        '-b',
        type=float,
        default=1,
        help=
        'Resolution of underlying histogram: each bin is this many degrees on a side.'
    )

    parser.add_argument(
        '--resolution',
        '-r',
        nargs=2,
        type=int,
        help='Resolution of output image.  Defaults to 800 600.')

    parser.add_argument('--dpi',
                        type=int,
                        default=72,
                        help='DPI of output image.')

    parser.add_argument('point_data_file',
                        nargs=1,
                        help='Delimited text file containing point data')
    parser.add_argument('image_file',
                        nargs=1,
                        help='Filename for histogram image')

    args = parser.parse_args()
    if args.resolution is None:
        args.resolution = [800, 600]
    if args.delimiter == 'tab':
        args.delimiter = '\t'

    return args
def parse_args():
    parser = argparse.ArgumentParser()
    argument_groups.use_argument_group("mapmaker", parser)
    argument_groups.use_argument_group("delimited_text_point_reader", parser)
    argument_groups.use_argument_group("image", parser)

    parser.add_argument('--colormap', '-c',
                        default='gist_heat',
                        help=(
                          'Name of colormap for histogram.  Defaults to '
                          '"gist_heat" thermal scale.  See matplotlib '
                          'documentation for a list of possibilities.'))
    parser.add_argument('--scale', '-s',
                        default='linear',
                        choices=['linear', 'log', 'logarithmic'],
                        help=(
                          'Mapping from histogram counts to colors.  Defaults '
                          'to "linear" but can also be "log" or '
                          '"logarithmic".'))
    parser.add_argument('--histogram-bin-size', '-b',
                        type=float,
                        default=1,
                        help=(
                          'Resolution of underlying histogram: each bin is '
                          'this many degrees on a side.'))
    parser.add_argument('--bgcolor', '-bg',
                        default='black',
                        help='Background color for image')
    parser.add_argument('--title',
                        help='Title for figure.  Will be rendered at top.')
    parser.add_argument('point_data_file',
                        nargs=1,
                        help='Delimited text file containing point data')
    parser.add_argument('image_file',
                        nargs=1,
                        help='Filename for histogram image')

    args = parser.parse_args()
    if args.resolution is None:
        args.resolution = [800, 600]
    if args.delimiter == 'tab':
        args.delimiter = '\t'

    return args
def parse_args():
    parser = argparse.ArgumentParser()
    argument_groups.use_argument_group('delimited_text_point_reader', parser)
    argument_groups.use_argument_group('mapmaker', parser)
    argument_groups.use_argument_group('trajectory_assembly', parser)
    argument_groups.use_argument_group('trajectory_rendering', parser)

    parser.add_argument('--trajectory-colormap',
                        default='gist_heat',
                        help='Name of Matplotlib colormap for trajectories')

    parser.add_argument('--trajectory-linewidth',
                        type=int,
                        default=1,
                        help='Width of trajectories on map in points')

    parser.add_argument('--resolution',
                        '-r',
                        nargs=2,
                        type=int,
                        help=('Resolution of output image.  Defaults to '
                              '800 600.'))

    parser.add_argument('--dpi',
                        type=int,
                        default=72,
                        help='DPI of output image.')

    parser.add_argument('point_data_file',
                        nargs=1,
                        help='Delimited text file containing point data')

    parser.add_argument('image_file',
                        nargs=1,
                        help='Filename for trajectory image')

    args = parser.parse_args()

    if args.resolution is None:
        args.resolution = [800, 600]
    if args.delimiter == 'tab':
        args.delimiter = '\t'

    return args
Пример #7
0
def parse_args():
    """Set up an argparse instance for parallel movie rendering.

    This function will appear in just about every non-trivial script
    that uses Tracktable.  The argparse module makes it much easier
    to handle command-line arguments than if we had to parse the
    entire command line ourselves.
    """

    parser = argparse.ArgumentParser(description='Render a movie of traffic found in a delimited text file',
                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    argument_groups.use_argument_group("delimited_text_point_reader", parser)
    argument_groups.use_argument_group("trajectory_assembly", parser)
    argument_groups.use_argument_group("trajectory_rendering", parser)
    argument_groups.use_argument_group("mapmaker", parser)
    argument_groups.use_argument_group("movie_rendering", parser)
    argument_groups.use_argument_group("parallel", parser)


    parser.add_argument('--trail-duration',
                        help="How long should each object's trail last? (seconds)",
                        type=int,
                        default=300)

    parser.add_argument('point_data_file',
                        nargs=1,
                        help='Delimited text file containing point data')

    parser.add_argument('movie_file',
                        nargs=1,
                        help='Filename for trajectory movie')


    args = parser.parse_args()
    if args.resolution is None:
        args.resolution = [ 800, 600 ]
    if args.delimiter == 'tab':
        args.delimiter = '\t'

    return args