1
Fork 0

Subdomain read-only

This commit is contained in:
Edgar P. Burkhart 2022-04-07 15:03:15 +02:00
parent fed9961ef2
commit fd555e413e
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
1 changed files with 5 additions and 0 deletions

View File

@ -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)