Added error message when using #geometry_objects_read & a data value is greater than index of specified materials.

这个提交包含在:
Craig Warren
2019-04-18 10:43:49 +01:00
父节点 09da7794cd
当前提交 2a3a7831ea

查看文件

@@ -121,6 +121,10 @@ def process_geometrycmds(geometry, G):
if data.dtype != 'int16':
data = data.astype('int16')
# Check that there are no values in the data greater than the maximum index for the specified materials
if np.amax(data) > len(materials) - 1:
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' found data value(s) ({}) in the geometry objects file greater than the maximum index for the specified materials ({})'.format(np.amax(data), len(materials) - 1))
# Look to see if rigid and ID arrays are present (these should be
# present if the original geometry objects were written from gprMax)
try: