Subdomain read-only
This commit is contained in:
parent
fed9961ef2
commit
fd555e413e
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,7 @@ import argparse
|
|||
import configparser
|
||||
import logging
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
@ -36,6 +37,9 @@ out_root = pathlib.Path(config.get("out", "root"))
|
|||
out_root.mkdir(exist_ok=True)
|
||||
bathy_inp = inp_root.joinpath(config.get("inp", "base"))
|
||||
bathy_out = out_root.joinpath(config.get("out", "sub"))
|
||||
if bathy_out.exists():
|
||||
log.error(f"'{bathy_out}' already exists!")
|
||||
sys.exit(1)
|
||||
log.info(f"Reading bathymetry from '{bathy_inp}'")
|
||||
raw_bathy = np.loadtxt(bathy_inp)
|
||||
log.debug(f"Initial size: {raw_bathy.shape}")
|
||||
|
@ -48,3 +52,4 @@ log.debug(f"Final size: {bathy.shape}")
|
|||
|
||||
log.info(f"Saving subdomain to 'bathy'")
|
||||
np.save(bathy_out, bathy)
|
||||
bathy_out.chmod(0o444)
|
||||
|
|
Loading…
Reference in a new issue