你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Added some checks for waveform type and frequency.
这个提交包含在:
@@ -20,6 +20,7 @@ import os, argparse
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
from gprMax.exceptions import CmdInputError
|
||||||
from gprMax.waveforms import Waveform
|
from gprMax.waveforms import Waveform
|
||||||
|
|
||||||
|
|
||||||
@@ -35,6 +36,12 @@ parser.add_argument('dt', type=float, help='time step to view waveform')
|
|||||||
parser.add_argument('-fft', action='store_true', default=False, help='plot FFT')
|
parser.add_argument('-fft', action='store_true', default=False, help='plot FFT')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Check waveform parameters
|
||||||
|
if args.type.lower() not in Waveform.waveformtypes:
|
||||||
|
raise CmdInputError('The waveform must have one of the following types {}'.format(','.join(Waveform.waveformtypes)))
|
||||||
|
if args.freq <= 0:
|
||||||
|
raise CmdInputError('The waveform requires an excitation frequency value of greater than zero')
|
||||||
|
|
||||||
w = Waveform()
|
w = Waveform()
|
||||||
w.type = args.type
|
w.type = args.type
|
||||||
w.amp = args.amp
|
w.amp = args.amp
|
||||||
|
在新工单中引用
屏蔽一个用户