Excitation file path and zero padding updates.

这个提交包含在:
Craig Warren
2020-07-13 13:28:07 +01:00
父节点 7e4ce9ffd4
当前提交 c942c3e0ee

查看文件

@@ -382,6 +382,7 @@ class ExcitationFile(UserObjectSingle):
# See if file exists at specified path and if not try input file directory # See if file exists at specified path and if not try input file directory
excitationfile = Path(excitationfile) excitationfile = Path(excitationfile)
# excitationfile = excitationfile.resolve()
if not excitationfile.exists(): if not excitationfile.exists():
excitationfile = Path(config.sim_config.input_file_path.parent, excitationfile) excitationfile = Path(config.sim_config.input_file_path.parent, excitationfile)
@@ -420,9 +421,9 @@ class ExcitationFile(UserObjectSingle):
singlewaveformvalues = singlewaveformvalues[:len(waveformtime)] singlewaveformvalues = singlewaveformvalues[:len(waveformtime)]
# Zero-pad end of waveform array if it is shorter than time array # Zero-pad end of waveform array if it is shorter than time array
elif len(singlewaveformvalues) < len(waveformtime): elif len(singlewaveformvalues) < len(waveformtime):
singlewaveformvalues = np.lib.pad(singlewaveformvalues, singlewaveformvalues = np.pad(singlewaveformvalues,
(0, len(singlewaveformvalues) - (0, len(waveformtime) -
len(waveformvalues)), len(singlewaveformvalues)),
'constant', constant_values=0) 'constant', constant_values=0)
# Interpolate waveform values # Interpolate waveform values