Skip to content

Commit

Permalink
SFH_GetRangeFromEpoch: Simplify epoch name handling
Browse files Browse the repository at this point in the history
We already have the epoch shortnames, with fallback to the tag if empty,
so we can just use these.
  • Loading branch information
t-b committed Feb 5, 2024
1 parent 8662561 commit 329c9e1
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Packages/MIES/MIES_SweepFormula_Helpers.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 329c9e1

Please sign in to comment.