你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Check for data type of array for #geometry_objects_file.
这个提交包含在:
@@ -80,8 +80,12 @@ def process_geometrycmds(geometry, G):
|
|||||||
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires the spatial resolution of the geometry objects file to match the spatial resolution of the model')
|
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires the spatial resolution of the geometry objects file to match the spatial resolution of the model')
|
||||||
|
|
||||||
data = f['/data'][:]
|
data = f['/data'][:]
|
||||||
data += numexistmaterials
|
|
||||||
build_voxels_from_array(xs, ys, zs, data, G.solid, G.rigidE, G.rigidH, G.ID)
|
# Should be int16 to allow for -1 which indicates background, i.e. don't build anything, but AustinMan/Woman maybe uint16
|
||||||
|
if data.dtype != 'int16':
|
||||||
|
data = data.astype('np.int16')
|
||||||
|
|
||||||
|
build_voxels_from_array(xs, ys, zs, numexistmaterials, data, G.solid, G.rigidE, G.rigidH, G.ID)
|
||||||
|
|
||||||
if G.messages:
|
if G.messages:
|
||||||
print('Geometry objects from file {} inserted at {:g}m, {:g}m, {:g}m, with corresponding materials file {}.'.format(geofile, xs * G.dx, ys * G.dy, zs * G.dz, matfile))
|
print('Geometry objects from file {} inserted at {:g}m, {:g}m, {:g}m, with corresponding materials file {}.'.format(geofile, xs * G.dx, ys * G.dy, zs * G.dz, matfile))
|
||||||
|
在新工单中引用
屏蔽一个用户