Beispiel #1
0
def _get_argument_parser():
    '''Create an argument parser with all of the correct arguments.'''
    parser = ArgParse()
    parser.add_arguments(['paths', 'separate_datasets', 'write_sectored_datafile', 'write_registered_datafile', 
                            'sectorlist', 'productlist', 'product_outpath', 'next', 'loglevel',
                          'forcereprocess', 'all', 'allstatic', 'alldynamic', 'tc', 'volcano', 'sectorfiles',
                          'templatefiles', 'no_multiproc', 'mp_max_cpus', 'queue', 'printmemusg'])
    return parser
Beispiel #2
0
def _get_argument_parser():
    '''Create an argument parser with all of the correct arguments.'''
    parser = ArgParse(formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('data_type',nargs='?',default=None,
            help='Uses the following data_type / host_type pairs:\n'+print_hostpairs()
                       )
    parser.add_argument('host_type',nargs='?',default=None,
                        help='See data_type / host_type combinations under data_type help.\n\n'
                       )
    parser.add_arguments(['noprocess',
            'nodownload',
            'channels',
            'sectorfiles',
            'templatefiles',
            'sectorlist',
            'productlist',
            'all',
            'allstatic',
            'alldynamic',
            'tc',
            'volcano',
            'data_outpath',
            'product_outpath',
            'start_datetime',
            'end_datetime',
            'num_hours_back_to_start',
            'num_hours_to_check',
            'loglevel',
            'queue',
            'max_total_jobs',
            'max_wait_seconds',
            ])

    parser.add_argument('--max_connections', default=None,
            help='Specify the maximum number of download jobs that can be in the queue for the current host. Defaults to:\n'+\
                    '\n'.join(['    '+site.host_type+' '+str(site.max_connections) for site in open_sites()])+'\n\n')
    parser.add_argument('--list', action='store_true',help='Only open and list possible sites:\n')

    return parser
Beispiel #3
0
def _get_argument_parser():
    '''Create an argument parser with all of the correct arguments.'''
    parser = ArgParse(formatter_class=argparse.RawTextHelpFormatter,
                      description='Get latency stats for various sensors\n')
    parser.add_argument(
        'sensor',
        nargs='?',
        default=None,
        help=
        'Call with no sensor to print summary for ALL sensors\nSingle sensor name\n  '
        + '\n  '.join(all_available_sensors()))
    parser.add_argument('-d',
                        '--data_files',
                        action='store_true',
                        help='Compute latency for data files')
    parser.add_argument('-p',
                        '--products',
                        action='store_true',
                        help='Compute latency for products')
    parser.add_argument(
        '-o',
        '--overall',
        action='store_true',
        help=
        'Only output overall latency for data provider / sensor, not individual files'
    )
    parser.add_arguments([
        'start_datetime', 'end_datetime', 'verbose', 'loglevel',
        'num_hours_back_to_start', 'num_hours_to_check'
    ])
    return parser
Beispiel #4
0
def _get_argument_parser():
    '''Create an argument parser with all of the correct arguments.'''
    # Need RawTextHelpFormatter for \n to work.
    parser = ArgParse(formatter_class=argparse.RawTextHelpFormatter,description=
        'Wrapper for processing an entire overpass based on date/time.\n'+\
        'satellite, sensor, product, sector, date, and time are required.\n')
    from geoips.utils.satellite_info import all_available_satellites, all_sensors_for_sat
    values = []
    allsensors = productfile.get_sensornames()
    # Getting list of sat/sensors
    for sat in all_available_satellites():
        for sensor in all_sensors_for_sat(sat):
            if sensor in allsensors:
                values.append(sat + ' ' + sensor)
    parser.add_argument('satellite', help='Single satellite name')
    parser.add_argument('sensor', help='Single sensor name. Uses the following possible satellite/sensor pairs:\n'+\
                                '\n'.join(['SATSENSORPAIR '+val for val in values])+'\n\n')
    parser.add_argument(
        'datelist', help="'YYYYMMDD YYYYMMDD YYYYMMDD' or YYYYMMDD-YYYYMMDD")
    parser.add_argument('-H',
                        '--hourlist',
                        nargs='?',
                        default=None,
                        help="'HH HH HH' or 'HH-HH'")
    parser.add_arguments([
        'productlist',
        'sectorlist',
        'sectorfiles',
        'all',
        'allstatic',
        'alldynamic',
        'volcano',
        'tc',
        'list',
        'extra_dirs',
        'queue',
        'mp_max_cpus',
        'clean',
        'forceclean',
        'download',
    ])
    parser.add_argument(
        '-l',
        '--loglevel',
        default='INTERACTIVE',
        help='Specify log level: error, warning, info, interactive, debug.\n\n'
    )
    return parser