From 329c9e1c3762436ad51807aa783a853e13327b54 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Mon, 5 Feb 2024 21:38:28 +0100 Subject: [PATCH] SFH_GetRangeFromEpoch: Simplify epoch name handling We already have the epoch shortnames, with fallback to the tag if empty, so we can just use these. --- Packages/MIES/MIES_SweepFormula_Helpers.ipf | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Packages/MIES/MIES_SweepFormula_Helpers.ipf b/Packages/MIES/MIES_SweepFormula_Helpers.ipf index c33fa468d7..ba7d4442ee 100644 --- a/Packages/MIES/MIES_SweepFormula_Helpers.ipf +++ b/Packages/MIES/MIES_SweepFormula_Helpers.ipf @@ -1368,24 +1368,14 @@ Function [WAVE adaptedRange, WAVE/T epochRangeNames] SFH_GetNumericRangeFromEpoc numEpochs = DimSize(epIndices, ROWS) WAVE adaptedRange = SFH_GetEmptyRange() - Make/FREE/T/N=(numEpochs) epochRangeNames - Redimension/N=(-1, numEpochs) adaptedRange for(j = 0; j < numEpochs; j += 1) epIndex = epIndices[j] adaptedRange[0][j] = str2num(epochInfo[epIndex][EPOCH_COL_STARTTIME]) * ONE_TO_MILLI adaptedRange[1][j] = str2num(epochInfo[epIndex][EPOCH_COL_ENDTIME]) * ONE_TO_MILLI - - epochTag = epochInfo[epIndex][EPOCH_COL_TAGS] - - epochShortName = EP_GetShortName(epochTag) - - if(IsEmpty(epochShortName)) - epochRangeNames[j] = epochTag - else - epochRangeNames[j] = epochShortName - endif endfor + Make/FREE/T/N=(numEpochs) epochRangeNames = allEpNames[epIndices[p]] + return [adaptedRange, epochRangeNames] End