From f3d4e04209545f2922801a9aff4f3d811021542d Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Mon, 27 Mar 2017 18:04:14 +0100 Subject: [PATCH] Improved checking of spatial resolution when importing geometry from HDF5 file. --- gprMax/input_cmds_geometry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gprMax/input_cmds_geometry.py b/gprMax/input_cmds_geometry.py index 7a4efa6e..cfa48b30 100644 --- a/gprMax/input_cmds_geometry.py +++ b/gprMax/input_cmds_geometry.py @@ -92,7 +92,7 @@ def process_geometrycmds(geometry, G): # Open geometry object file and read/check spatial resolution attribute f = h5py.File(geofile, 'r') dx_dy_dz = f.attrs['dx, dy, dz'] - if dx_dy_dz[0] != G.dx or dx_dy_dz[1] != G.dy or dx_dy_dz[2] != G.dz: + if int(dx_dy_dz[0] / G.dx) != 1 or int(dx_dy_dz[1] / G.dy) != 1 or int(dx_dy_dz[2] / G.dz) != 1: raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires the spatial resolution of the geometry objects file to match the spatial resolution of the model') data = f['/data'][:]