Add cli arg for config file
This commit is contained in:
parent
59e33da9a6
commit
fe17378bb0
9 changed files with 18 additions and 13 deletions
|
@ -11,6 +11,7 @@ parser = argparse.ArgumentParser(
|
|||
description="Convert swash output to olaFlow input"
|
||||
)
|
||||
parser.add_argument("-v", "--verbose", action="count", default=0)
|
||||
parser.add_argument("-c", "--config", default="config.ini")
|
||||
args = parser.parse_args()
|
||||
|
||||
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
|
||||
|
@ -18,7 +19,7 @@ log = logging.getLogger("sws_ola")
|
|||
|
||||
log.info("Starting sws -> olaFlow converter")
|
||||
config = configparser.ConfigParser()
|
||||
config.read("config.ini")
|
||||
config.read(args.config)
|
||||
|
||||
bathy = np.loadtxt(config.get("bathy", "bathy"))[::-1]
|
||||
hstru = np.loadtxt(config.get("bathy", "hstru"))[::-1]
|
||||
|
|
Reference in a new issue