你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Added filename argument to assist with saving figures from module.
这个提交包含在:
@@ -74,7 +74,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"filename = os.path.join(os.pardir, os.pardir, 'user_models', 'antenna_wire_dipole_fs.out')\n",
|
"filename = os.path.join(os.pardir, os.pardir, 'user_models', 'antenna_wire_dipole_fs.out')\n",
|
||||||
"antennaparams = calculate_antenna_params(filename)\n",
|
"antennaparams = calculate_antenna_params(filename)\n",
|
||||||
"plt = mpl_plot(**antennaparams)"
|
"plt = mpl_plot(filename, **antennaparams)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@@ -210,8 +210,8 @@ def mpl_plot(filename, outputs=Rx.availableoutputs, fft=False):
|
|||||||
ax.grid()
|
ax.grid()
|
||||||
|
|
||||||
# Save a PDF/PNG of the figure
|
# Save a PDF/PNG of the figure
|
||||||
#fig.savefig(os.path.splitext(os.path.abspath(file))[0] + '_rx' + str(rx) + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1)
|
#fig.savefig(os.path.splitext(os.path.abspath(filename))[0] + '_rx' + str(rx) + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1)
|
||||||
#fig.savefig(os.path.splitext(os.path.abspath(file))[0] + '_rx' + str(rx) + '.png', dpi=150, format='png', bbox_inches='tight', pad_inches=0.1)
|
#fig.savefig(os.path.splitext(os.path.abspath(filename))[0] + '_rx' + str(rx) + '.png', dpi=150, format='png', bbox_inches='tight', pad_inches=0.1)
|
||||||
|
|
||||||
return plt
|
return plt
|
||||||
|
|
||||||
|
@@ -130,10 +130,11 @@ def calculate_antenna_params(filename, tltxnumber=1, tlrxnumber=None, rxnumber=N
|
|||||||
return antennaparams
|
return antennaparams
|
||||||
|
|
||||||
|
|
||||||
def mpl_plot(time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref, Irefp, Vtotal, Vtotalp, Itotal, Itotalp, s11, zin, yin, s21=None):
|
def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref, Irefp, Vtotal, Vtotalp, Itotal, Itotalp, s11, zin, yin, s21=None):
|
||||||
"""Plots antenna parameters - incident, reflected and total volatges and currents; s11, (s21) and input impedance.
|
"""Plots antenna parameters - incident, reflected and total volatges and currents; s11, (s21) and input impedance.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
filename (string): Filename (including path) of output file.
|
||||||
time (array): Simulation time.
|
time (array): Simulation time.
|
||||||
freq (array): Frequencies for FFTs.
|
freq (array): Frequencies for FFTs.
|
||||||
Vinc, Vincp, Iinc, Iincp (array): Time and frequency domain representations of incident voltage and current.
|
Vinc, Vincp, Iinc, Iincp (array): Time and frequency domain representations of incident voltage and current.
|
||||||
@@ -401,6 +402,6 @@ if __name__ == "__main__":
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
antennaparams = calculate_antenna_params(args.outputfile, args.tltx_num, args.tlrx_num, args.rx_num, args.rx_component)
|
antennaparams = calculate_antenna_params(args.outputfile, args.tltx_num, args.tlrx_num, args.rx_num, args.rx_component)
|
||||||
plt = mpl_plot(**antennaparams)
|
plt = mpl_plot(args.outputfile, **antennaparams)
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
在新工单中引用
屏蔽一个用户