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 if __name__ == '__main__': # Parse commandline arguments parser = _get_argument_parser() args = vars(parser.parse_args()) args = parser.cleanup_args(args) # Set up logger root_logger, file_hndlr, email_hndlr = root_log_setup(loglevel=args['loglevel'], subject=EMAIL_SUBJECT) # Store the start time for generating statistics DATETIMES['start'] = datetime.utcnow() log.info('Starting main: {0}'.format(DATETIMES['start'])) # Get the data path and check to be sure it exists runpaths = args['paths'] for runpath in runpaths: if os.path.exists(runpath): log.interactive('Input path: {0}'.format(runpath)) else: raise IOError('No such file or directory: {0}'.format(runpath)) # Set up data file instance and read the metadata print_mem_usage('Before reading metadata')
email_hndlr = None root_logger = None combined_sf = None args = {'data_type': None,'host_type': None,'sectorfiles':[],'productlist':None,'sectorlist':None} try: parser = _get_argument_parser() args = vars(parser.parse_args()) #Set up the logger emailsubject = 'downloader %s %s %s %s' % (args['data_type'], args['host_type'], str(args['start_datetime']), str(args['end_datetime']) ) root_logger,file_hndlr,email_hndlr = root_log_setup(loglevel=args['loglevel'],subject=emailsubject) args=parser.cleanup_args(args) if args['list'] == True or not args['data_type'] or not args['host_type']: log.info('Available sites:\n'+print_hostpairs()) sys.exit() # MLS 20160108 Make sure start time is 9h prior, so we get appropriate sectorfiles. [args['start_datetime'], args['end_datetime']] = time_range_defaults(args['start_datetime'], args['end_datetime'], args['num_hours_back_to_start'], args['num_hours_to_check'], ) if args['queue'] and args['queue'].lower() == 'none': args['queue'] = None #Should fix this so that either we use dynamic_templates here
try: import wingdbstub except: print( 'Could not find wingdbstub from driver.py. I hope you\'re not trying to dubug remotely...' ) # Installed Libraries from IPython import embed as shell # GeoIPS Libraries from geoips.sectorfile.xml_scrubber import XMLFile from geoips.utils.log_setup import interactive_log_setup, root_log_setup from geoips.utils.plugin_paths import paths as gpaths root_logger, file_hndlr, email_hndlr = root_log_setup(loglevel='info', subject='none') log = interactive_log_setup(logging.getLogger(__name__)) if len(sys.argv) < 2: log.info('Available colorbars:') for filename in glob(gpaths['GEOIPS'] + '/geoips/geoimg/xml_palettes/*.xml'): elt_names = XMLFile(filename).element_names() log.info('File: ' + filename) for cbname in elt_names: log.info(' Colorbar: ' + cbname) else: cbname = sys.argv[1] log.info('Creating colorbar ' + cbname)