你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-06 12:36:51 +08:00
Formatting cleanups.
这个提交包含在:
@@ -1,4 +1,6 @@
|
||||
import argparse, os
|
||||
import argparse
|
||||
import os
|
||||
|
||||
import h5py
|
||||
|
||||
# Parse command line arguments
|
||||
@@ -6,18 +8,18 @@ parser = argparse.ArgumentParser(description='Writes a HDF5 file of AustinMan or
|
||||
parser.add_argument('filename', help='name and path to (HDF5) file containing AustinMan or AustinWoman model')
|
||||
args = parser.parse_args()
|
||||
|
||||
# Read full body HDF5 file
|
||||
# Read full body HDF5 file
|
||||
f = h5py.File(args.filename, 'r')
|
||||
dx_dy_dz = f.attrs['dx, dy, dz']
|
||||
data = f['/data'][:,:,:]
|
||||
data = f['/data'][:, :, :]
|
||||
|
||||
# Define head as last 1/8 of total body height
|
||||
nzhead = 7 * int(data.shape[2] / 8)
|
||||
|
||||
print('Dimensions of head model: {:g} x {:g} x {:g} cells'.format(data.shape[0], data.shape[1], data.shape[2] - nzhead))
|
||||
|
||||
|
||||
# Write HDF5 file
|
||||
headfile = os.path.splitext(args.filename)[0] + '_head.h5'
|
||||
f = h5py.File(headfile, 'w')
|
||||
f.attrs['dx, dy, dz'] = dx_dy_dz
|
||||
f['/data'] = data[:,:,nzhead:data.shape[2]]
|
||||
f['/data'] = data[:, :, nzhead:data.shape[2]]
|
||||
|
在新工单中引用
屏蔽一个用户