def main(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store', dest='config_file', required=True, help="config yaml file") parser.add_argument('-v', action='store_true', dest='verbose', help="verobse flag") args = parser.parse_args() config = load_config(args.config_file) validate_config(config) simul_type = config["simulation_type"] print("Simulation type: %s" % simul_type) if simul_type == "adjoint_simulation": fill_adjoint_db(config, verbose=args.verbose) elif simul_type == "forward_simulation": fill_forward_db(config, verbose=args.verbose) elif simul_type == "line_search": fill_line_search_db(config, verbose=args.verbose) else: raise ValueError("Unsupported simulation type(%s)" % simul_type)
def main(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store', dest='config_file', required=True, help="config yaml file") args = parser.parse_args() config = load_config(args.config_file) validate_config(config) specfemdir = config["data_info"]["specfemdir"] targetdir = os.path.join(config["data_info"]["runbase"], "specfem3d_globe") easy_copy_specfem(specfemdir, targetdir)
def main(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store', dest='config_file', required=True, help="config yaml file") args = parser.parse_args() config_file = args.config_file if not os.path.exists(config_file): raise ValueError("Config file(%s) not exists!") config = load_config(config_file) validate_config(config) print("Config file('%s') is valid!" % (config_file))
def main(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store', dest='config_file', required=True, help="config yaml file") parser.add_argument('-v', action='store_true', dest='verbose', help="verobse flag") args = parser.parse_args() config = load_config(args.config_file) stype = config["simulation_type"] db_name = config["db_name"] if stype == "forward_simulation" or "line_search": create_forward_db(db_name, args.verbose) elif stype == "adjoint_simulation": check_db_exists(db_name)
def main(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store', dest='config_file', required=True, help="config yaml file") args = parser.parse_args() config = load_config(args.config_file) simul_type = config["simulation_type"] db_name = config["db_name"] if simul_type == "forward_simulation": check_forward_job(db_name) elif simul_type == "adjoint_simulation": pass elif simul_type == "source_inversion": pass else: raise ValueError("Simulation type(%s) not recognised!" % simul_type)
def main(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store', dest='config_file', required=True, help="config yaml file") args = parser.parse_args() config = load_config(args.config_file) simul_type = config["simulation_type"] if simul_type == "forward_simulation": vd = ForwardValidator(config) vd.run() elif simul_type == "source_inversion": pass elif simul_type == "adjoint_simulation": pass else: raise ValueError("simulation type not recognised!")
def main(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store', dest='config_file', required=True, help="config yaml file") args = parser.parse_args() config = load_config(args.config_file) stype = config["simulation_type"] if stype == "forward_simulation": create_forward_jobs(config) elif stype == "adjoint_simulation": create_adjoint_jobs(config) elif stype == "line_search": create_line_search_jobs(config) else: raise NotImplementedError("Error: %s" % stype)
def main(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store', dest='config_file', required=True, help="config yaml file") args = parser.parse_args() config = load_config(args.config_file) validate_config(config) runbase = config["runbase"] create_runbase(runbase) stype = config["simulation_type"] if stype == "forward_simulation": setup_forward_runbase(config) elif stype == "adjoint_simulation": setup_adjoint_runbase(config) elif stype == "line_search": setup_line_search_runbase(config) else: raise NotImplementedError("Error: %s" % stype)