@@ -4727,23 +4727,15 @@ Function/WAVE PSX_OperationKernel(variable jsonId, string jsonPath, string graph
47274727 variable riseTau, decayTau, amp, dt, numPoints, numCombos, i , offset, idx
47284728 string parameterPath, key
47294729
4730- WAVE /WAVE selectDataCompArray = SFH_GetArgumentSelect ( jsonID, jsonPath, graph, SF_OP_PSX_KERNEL, 0 )
4730+ WAVE /Z/ WAVE selectDataCompArray = SFH_GetArgumentSelect ( jsonID, jsonPath, graph, SF_OP_PSX_KERNEL, 0 )
4731+ SFH_ASSERT ( WaveExists ( selectDataCompArray) , "Could not gather sweep data from select statement" )
47314732
47324733 riseTau = SFH_GetArgumentAsNumeric ( jsonID, jsonPath, graph, SF_OP_PSX_KERNEL, 1, defValue = 1, checkFunc = IsStrictlyPositiveAndFinite)
47334734 decayTau = SFH_GetArgumentAsNumeric ( jsonID, jsonPath, graph, SF_OP_PSX_KERNEL, 2, defValue = 15, checkFunc = IsStrictlyPositiveAndFinite)
47344735 amp = SFH_GetArgumentAsNumeric ( jsonID, jsonPath, graph, SF_OP_PSX_KERNEL, 3, defValue = -5, checkFunc = IsFinite)
47354736
47364737 SFH_ASSERT ( decayTau > riseTau, "decay tau must be strictly larger than the rise tau" )
47374738
4738- SFH_ASSERT ( DimSize ( selectDataCompArray, ROWS) == 1, "Only supports a single selection at the moment" )
4739-
4740- WAVE /WAVE selectDataComp = selectDataCompArray[ 0 ]
4741-
4742- WAVE /Z selectData = selectDataComp[ % SELECTION]
4743- WAVE /WAVE range = selectDataComp[ % RANGE]
4744-
4745- SFH_ASSERT ( WaveExists ( selectData) , "Could not gather sweep data from select statement" )
4746-
47474739 WAVE /WAVE sweepDataRef = SFH_GetSweepsForFormula ( graph, selectDataCompArray, SF_OP_PSX_KERNEL)
47484740
47494741 numCombos = DimSize ( sweepDataRef, ROWS)
@@ -4754,8 +4746,21 @@ Function/WAVE PSX_OperationKernel(variable jsonId, string jsonPath, string graph
47544746 Make / FREE/ T rawLabels = { "psxKernel" , "psxKernelFFT" , "sweepData" }
47554747 ASSERT ( DimSize ( rawLabels, ROWS) == PSX_KERNEL_OUTPUTWAVES_PER_ENTRY, "Mismatched rawLabels wave" )
47564748
4749+ Make / FREE/ N= ( 0 ) allResolvedRanges
4750+ Make / FREE/ N= ( 0 ) / T allSelectHashes
4751+
47574752 for ( i = 0; i < numCombos; i += 1 )
4758- WAVE sweepData = sweepDataRef[ i ]
4753+ WAVE /Z sweepData = sweepDataRef[ i ]
4754+ ASSERT ( WaveExists ( sweepData) , "Can't handle invalid sweepData waves" )
4755+
4756+ [ WAVE singleSelectData, WAVE range] = SFH_ParseToSelectDataWaveAndRange ( sweepData)
4757+
4758+ [ WAVE resolvedRanges, WAVE /T epochRangeNames] = SFH_GetNumericRangeFromEpochFromSingleSelect ( graph, singleSelectData, range)
4759+
4760+ if ( ! WaveExists ( resolvedRanges))
4761+ continue
4762+ endif
4763+
47594764 numPoints = DimSize ( sweepData, ROWS)
47604765 dt = DimDelta ( sweepData, ROWS)
47614766
@@ -4770,6 +4775,8 @@ Function/WAVE PSX_OperationKernel(variable jsonId, string jsonPath, string graph
47704775 continue
47714776 endif
47724777
4778+ PSX_CollectResolvedRanges ( graph, resolvedRanges, singleSelectData, allResolvedRanges, allSelectHashes)
4779+
47734780 Duplicate / FREE/ T rawLabels, labels
47744781 labels[] = PSX_GenerateKey ( rawLabels[ p] , idx)
47754782 SetDimensionLabels ( output, TextWaveToList ( labels, ";" ) , ROWS, startPos = idx * PSX_KERNEL_OUTPUTWAVES_PER_ENTRY)
@@ -4788,14 +4795,13 @@ Function/WAVE PSX_OperationKernel(variable jsonId, string jsonPath, string graph
47884795
47894796 SFH_ASSERT ( numCombos > 0, "Could not create psxKernel" )
47904797
4798+ PSX_CheckResolvedRangesWithSelectHashes ( allResolvedRanges, allSelectHashes)
4799+
47914800 Redimension / N= ( PSX_KERNEL_OUTPUTWAVES_PER_ENTRY * numCombos) output
47924801
47934802 parameterPath = SF_META_USER_GROUP + PSX_JWN_PARAMETERS + "/" + SF_OP_PSX_KERNEL
47944803
4795- WAVE rangeClean = ZapNullRefs ( range)
4796-
47974804 JWN_CreatePath ( output, parameterPath)
4798- JWN_SetWaveInWaveNote ( output, parameterPath + "/range" , rangeClean) // not the same as SF_META_RANGE
47994805 JWN_SetNumberInWaveNote ( output, parameterPath + "/riseTau" , riseTau)
48004806 JWN_SetNumberInWaveNote ( output, parameterPath + "/decayTau" , decayTau)
48014807 JWN_SetNumberInWaveNote ( output, parameterPath + "/amp" , amp)
0 commit comments