Made changes to the reformatted code as per the suggestions given.

这个提交包含在:
Sai Suraj
2023-04-18 02:06:25 +05:30
父节点 4015c51bd7
当前提交 72c85b29d6
共有 7 个文件被更改,包括 58 次插入87 次删除

查看文件

@@ -29,20 +29,16 @@ rx = gprMax.Rx(p1=(0.038, 0.114, 0.013))
plate = gprMax.Plate(p1=(0.013, 0.013, 0.013),
p2=(0.038, 0.113, 0.013), material_id='pec')
gv1 = gprMax.GeometryView(
p1=(0, 0, 0),
p2=(x, y, z),
dl=(dl, dl, dl),
filename=Path(*parts[:-1], f'{parts[-1]}_n'),
output_type='n',
)
gv2 = gprMax.GeometryView(
p1=(0, 0, 0),
p2=(x, y, z),
dl=(dl, dl, dl),
filename=Path(*parts[:-1], f'{parts[-1]}_f'),
output_type='f',
)
gv1 = gprMax.GeometryView(p1=(0, 0, 0),
p2=(x, y, z),
dl=(dl, dl, dl),
filename=Path(*parts[:-1], f'{parts[-1]}_n'),
output_type='n',)
gv2 = gprMax.GeometryView(p1=(0, 0, 0),
p2=(x, y, z),
dl=(dl, dl, dl),
filename=Path(*parts[:-1], f'{parts[-1]}_f'),
output_type='f',)
pmls = {'CFS-PML': {'pml': gprMax.PMLProps(formulation='HORIPML', thickness=10),
# Parameters from http://dx.doi.org/10.1109/TAP.2018.2823864

查看文件

@@ -29,20 +29,16 @@ rx = gprMax.Rx(p1=(0.113, 0.189, 0.088))
plate = gprMax.Plate(p1=(0.088, 0.088, 0.088),
p2=(0.113, 0.188, 0.088), material_id='pec')
gv1 = gprMax.GeometryView(
p1=(0, 0, 0),
p2=(x, y, z),
dl=(dl, dl, dl),
filename=Path(*parts[:-1], f'{parts[-1]}_n'),
output_type='n',
)
gv2 = gprMax.GeometryView(
p1=(0, 0, 0),
p2=(x, y, z),
dl=(dl, dl, dl),
filename=Path(*parts[:-1], f'{parts[-1]}_f'),
output_type='f',
)
gv1 = gprMax.GeometryView(p1=(0, 0, 0),
p2=(x, y, z),
dl=(dl, dl, dl),
filename=Path(*parts[:-1], f'{parts[-1]}_n'),
output_type='n',)
gv2 = gprMax.GeometryView(p1=(0, 0, 0),
p2=(x, y, z),
dl=(dl, dl, dl),
filename=Path(*parts[:-1], f'{parts[-1]}_f'),
output_type='f',)
pml = gprMax.PMLProps(formulation='HORIPML', thickness=10)

查看文件

@@ -81,12 +81,10 @@ realmax = np.where(np.abs(real[:, 1]) == 1)[0][0]
difftime = - (timemodel[modelmax] - real[realmax, 0])
# Plot modelled and real data
fig, ax = plt.subplots(
num=f'{modelfile.stem}_vs_{realfile.stem}',
figsize=(20, 10),
facecolor='w',
edgecolor='w',
)
fig, ax = plt.subplots(num=f'{modelfile.stem}_vs_{realfile.stem}',
figsize=(20, 10),
facecolor='w',
edgecolor='w',)
ax.plot(timemodel + difftime, model, 'r', lw=2, label='Model')
ax.plot(real[:, 0], real[:, 1], 'r', ls='--', lw=2, label='Experiment')
ax.set_xlabel('Time [s]')

查看文件

@@ -130,12 +130,9 @@ for i, model in enumerate(testmodels):
# Check that type of float used to store fields matches
if filetest[path + outputstest[0]].dtype != fileref[path + outputsref[0]].dtype:
logger.warning(
(
f'Type of floating point number in test model ({filetest[path + outputstest[0]].dtype}) does not '
+ f'match type in reference solution ({fileref[path + outputsref[0]].dtype})\n'
)
)
logger.warning(f'Type of floating point number in test model ' +
f'({filetest[path + outputstest[0]].dtype}) does not ' +
f'match type in reference solution ({fileref[path + outputsref[0]].dtype})\n')
float_or_doubleref = fileref[path + outputsref[0]].dtype
float_or_doubletest = filetest[path + outputstest[0]].dtype
@@ -176,22 +173,18 @@ for i, model in enumerate(testmodels):
# Replace any NaNs or Infs from zero division
datadiffs[:, i][np.invert(np.isfinite(datadiffs[:, i]))] = 0
# Store maxi difference
# Store max difference
maxdiff = np.amax(np.amax(datadiffs))
testresults[model]['Max diff'] = maxdiff
# Plot datasets
fig1, ((ex1, hx1), (ey1, hy1), (ez1, hz1)) = plt.subplots(
nrows=3,
ncols=2,
sharex=False,
sharey='col',
subplot_kw=dict(xlabel='Time [ns]'),
num=f'{model}.in',
figsize=(20, 10),
facecolor='w',
edgecolor='w',
)
fig1, ((ex1, hx1), (ey1, hy1), (ez1, hz1)) = plt.subplots(nrows=3, ncols=2,
sharex=False, sharey='col',
subplot_kw=dict(xlabel='Time [ns]'),
num=model + '.in',
figsize=(20, 10),
facecolor='w',
edgecolor='w')
ex1.plot(timetest, datatest[:, 0], 'r', lw=2, label=model)
ex1.plot(timeref, dataref[:, 0], 'g', lw=2, ls='--', label=f'{model}(Ref)')
ey1.plot(timetest, datatest[:, 1], 'r', lw=2, label=model)
@@ -214,17 +207,13 @@ for i, model in enumerate(testmodels):
ax.legend()
# Plot diffs
fig2, ((ex2, hx2), (ey2, hy2), (ez2, hz2)) = plt.subplots(
nrows=3,
ncols=2,
sharex=False,
sharey='col',
subplot_kw=dict(xlabel='Time [ns]'),
num=f'Diffs: {model}.in',
figsize=(20, 10),
facecolor='w',
edgecolor='w',
)
fig2, ((ex2, hx2), (ey2, hy2), (ez2, hz2)) = plt.subplots(nrows=3, ncols=2,
sharex=False, sharey='col',
subplot_kw=dict(xlabel='Time [ns]'),
num='Diffs: ' + model + '.in',
figsize=(20, 10),
facecolor='w',
edgecolor='w')
ex2.plot(timeref, datadiffs[:, 0], 'r', lw=2, label='Ex')
ey2.plot(timeref, datadiffs[:, 1], 'r', lw=2, label='Ey')
ez2.plot(timeref, datadiffs[:, 2], 'r', lw=2, label='Ez')