# Define parser parser = argparse.ArgumentParser( description='Run the ORAC main processor given a root filename.') ou.args_common(parser) ou.args_main(parser) parser.add_argument("--batch_settings", type=str, nargs='+', help="Settings to " "pass to the batch processing system. Each setting is " "passed as KEY VALUE, where KEY is any key defined in " "orac_batch.py.", default=()) args = parser.parse_args() # Parse batch processing settings if len(args.batch_settings) % 2 != 0: raise ValueError("--batch must be a list of KEY VALUE pairs.") values = {} for key, val in zip(args.batch_settings[0::2], args.batch_settings[1::2]): values[key] = val try: ou.check_args_main(args) # Run main processor driver = ou.build_main_driver(args) jid = ou.call_exe(args, args.orac_dir+'/src/orac', driver, values) print 'JOBID ',jid except ou.OracError as err: cprint('ERROR) ' + err.message, ou.colouring['error']) except KeyboardInterrupt: cprint('Execution halted by user.', ou.colouring['error'])
# Increment version number (as this is usually run on uncommited code) if not args.revision: cwd = os.getcwd() os.chdir(args.orac_dir + '/pre_processing') args.revision = ou.get_svn_revision() os.chdir(cwd) if not args.benchmark: args.revision += 1 #----------------------------------------------------------------------------- try: for test in args.tests: cprint(test, ou.colouring['header']) # Set filename to be processed and output folder args.target = regress[test][0] args.limit = regress[test][1] args.out_dir = base_out_dir + '/' + test # Run ORAC suite ou.check_args_cc4cl(args) (fileroot, dirs, jid) = ou.cc4cl(args) # Check for regressions if not args.benchmark: if not args.batch: for d in dirs: for f in glob.glob(d + '/' + fileroot + '*nc'):