def main(param_path='<STR_LIT>'):
<EOL>if not os.path.isfile(param_path):<EOL><INDENT>raise IOError("<STR_LIT>" % param_path)<EOL><DEDENT>params, base_options = _get_params_base_options(param_path)<EOL>log_path = os.path.join(base_options['<STR_LIT>'], '<STR_LIT>')<EOL>if os.path.isfile(log_path):<EOL><INDENT>os.remove(log_path)<EOL><DEDENT>logging.basicConfig(level=logging.INFO, format='<STR_LIT>')<EOL>fileh = logging.FileHandler(log_path)<EOL>fileh.setLevel(logging.DEBUG)<EOL>filefmt = logging.Formatter(<EOL>time.strftime("<STR_LIT>", time.localtime()) + <EOL>'<STR_LIT>')<EOL>fileh.setFormatter(filefmt)<EOL>logging.getLogger('<STR_LIT>').addHandler(fileh)<EOL>def log_uncaught(type1, value1, traceback1):<EOL><INDENT>tb_list = traceback.format_exception(type1, value1, traceback1)<EOL>tb_str = '<STR_LIT>'.join(tb_list)<EOL>logging.critical('<STR_LIT>'+tb_str)<EOL><DEDENT>sys.excepthook = log_uncaught<EOL>logging.info('<STR_LIT>') <EOL>logging.info('<STR_LIT>' % os.path.abspath(param_path))<EOL>bad_params = misc.check_parameter_file(param_path)<EOL>if len(bad_params[<NUM_LIT:0>]) > <NUM_LIT:0>:<EOL><INDENT>logging.warning("<STR_LIT>" +<EOL>"<STR_LIT>"<EOL>% (param_path, bad_params[<NUM_LIT:0>], bad_params[<NUM_LIT:1>]))<EOL><DEDENT>logging.info('<STR_LIT>')<EOL>for run_name in base_options['<STR_LIT>']:<EOL><INDENT>logging.info('<STR_LIT>' % run_name)<EOL>options = dict(params[run_name])  <EOL>options.update(base_options)  <EOL>options['<STR_LIT>'] = os.path.join(base_options['<STR_LIT>'],run_name)<EOL>if '<STR_LIT>' in options['<STR_LIT>']:<EOL><INDENT>_do_format(options)<EOL><DEDENT>else:<EOL><INDENT>_do_analysis(options)<EOL><DEDENT>logging.info('<STR_LIT>' % run_name)<EOL><DEDENT>logging.info('<STR_LIT>')<EOL>logging.info('<STR_LIT>' % options['<STR_LIT>'])<EOL>logging.shutdown()<EOL>
Entry point function for analysis based on parameter files.

Parameters
----------
param_path : str
    Path to user-generated parameter file