Skip to content

Commit af3fb1e

Browse files
committed
PA_UpdateSweepPlotDeconvolution: Avoid RTE with missing deconvolution traces
Since the update in e3a68bf (PA_UpdateSweepPlotDeconvolution: Make the interface less confusing, 2020-07-17) we don't know if we have deconvolution traces or not. So we need to expect non-existing deconvolution traces. And for clarity we also do that for the average traces.
1 parent d98ac2e commit af3fb1e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Packages/MIES/MIES_PulseAveraging.ipf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -884,11 +884,11 @@ static Function PA_UpdateSweepPlotDeconvolution(win)
884884
graph = StringFromList(i, graphs)
885885

886886
if(deconvolution.enable)
887-
WAVE/T traces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType", "DiagonalElement"}, values = {"Average", "0"})
887+
WAVE/T/Z traces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType", "DiagonalElement"}, values = {"Average", "0"})
888888

889889
traceIndex = TUD_GetTraceCount(graph)
890-
891-
numTraces = DimSize(traces, ROWS)
890+
891+
numTraces = WaveExists(traces) ? DimSize(traces, ROWS) : 0
892892
for(j = 0; j < numTraces; j += 1)
893893
avgTrace = traces[j]
894894

@@ -915,9 +915,9 @@ static Function PA_UpdateSweepPlotDeconvolution(win)
915915
TUD_SetUserData(graph, traceName, "fullPath", GetWavesDataFolder(deconv, 2))
916916
endfor
917917
else // !deconvolution.enable
918-
WAVE/T traces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType"}, values = {"Deconvolution"})
918+
WAVE/T/Z traces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType"}, values = {"Deconvolution"})
919919

920-
numTraces = DimSize(traces, ROWS)
920+
numTraces = WaveExists(traces) ? DimSize(traces, ROWS) : 0
921921
for(j = 0; j < numTraces; j += 1)
922922
traceName = traces[j]
923923

0 commit comments

Comments
 (0)