More updates to logging and handling exceptions.

这个提交包含在:
craig-warren
2020-04-09 14:23:50 +01:00
父节点 aba5e749c5
当前提交 1e64d493a2
共有 27 个文件被更改,包括 334 次插入177 次删除

查看文件

@@ -17,15 +17,17 @@
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
import argparse
import logging
from pathlib import Path
import h5py
import matplotlib.pyplot as plt
import numpy as np
from gprMax.exceptions import CmdInputError
from .outputfiles_merge import get_output_data
logger = logging.getLogger(__name__)
def mpl_plot(filename, outputdata, dt, rxnumber, rxcomponent):
"""Creates a plot (with matplotlib) of the B-scan.
@@ -89,7 +91,8 @@ if __name__ == "__main__":
# Check there are any receivers
if nrx == 0:
raise CmdInputError(f'No receivers found in {args.outputfile}')
logger.exception(f'No receivers found in {args.outputfile}')
raise ValueError
for rx in range(1, nrx + 1):
outputdata, dt = get_output_data(args.outputfile, rx, args.rx_component)