diff --git a/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf b/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf index 917a917fad..e53bfa56df 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf @@ -1788,7 +1788,8 @@ End static Function [WAVE fitOffset, WAVE fitSlope] PSQ_DS_EvaluateFrequencyCurrentData(string device, variable numPointsForLineFit, WAVE apfreq, WAVE DAScales) - variable numPoints, numFits, first, last + variable i, numPoints, numFits, first, last + string line string str = "" numPoints = DimSize(apfreq, ROWS) @@ -1802,8 +1803,8 @@ static Function [WAVE fitOffset, WAVE fitSlope] PSQ_DS_EvaluateFrequencyCurrentD first = i last = (i + numPointsForLineFit) - 1 - WAVE freqDataSlice = DuplicateSubRange(freqData, first, last) - sprintf line, "freq%d = [%s]\r", i, RemoveEnding(NumericWaveToList(freqDataSlice, ","), ",") + WAVE apfreqSlice = DuplicateSubRange(apfreq, first, last) + sprintf line, "freq%d = [%s]\r", i, RemoveEnding(NumericWaveToList(apfreqSlice, ","), ",") str += line WAVE DaScalesSlice = DuplicateSubRange(DAScales, first, last) @@ -1831,6 +1832,7 @@ static Function [WAVE fitOffset, WAVE fitSlope] PSQ_DS_EvaluateFrequencyCurrentD endif endfor + // @todo // databrowser = PSQ_ExecuteSweepFormula(device, str) // // WAVE/T textualResultsValues = BSP_GetLogbookWave(databrowser, LBT_RESULTS, LBN_TEXTUAL_VALUES, selectedExpDevice = 1) @@ -1842,6 +1844,10 @@ static Function [WAVE fitOffset, WAVE fitSlope] PSQ_DS_EvaluateFrequencyCurrentD // WAVE DaScale = PSQ_GetSweepFormulaResultWave(textualResultsValues, key, sweepNo) End +static Function PSQ_DS_CheckFitResults(WAVE fitOffset, WAVE fitSlope) + +End + /// @brief Help strings for common parameters /// /// Not every analysis function uses every parameter though. @@ -2248,7 +2254,7 @@ Function PSQ_DAScale(device, s) STRUCT AnalysisFunction_V3 &s variable val, totalOnsetDelay, DAScale, baselineQCPassed, passingSupraSweep - variable i, numberOfSpikes, samplingFrequencyPassed + variable i, numberOfSpikes, samplingFrequencyPassed, numPoints variable index, ret, showPlot, V_AbortCode, V_FitError, err, enoughSweepsPassed variable sweepPassed, setPassed, length, minLength variable minimumSpikeCount, maximumSpikeCount, daScaleModifierParam @@ -2364,14 +2370,14 @@ Function PSQ_DAScale(device, s) endif // re-evaluate all sweeps from passingSupraSweep SCI using `E1` epoch - [WAVE apfreq, WAVE DaScales] = PSQ_DS_GatherFrequencyCurrentData(device, s.headstage, numPointsForLineFit, passingSupraSweep, s.sweepNo) + [WAVE apfreq, WAVE DaScales] = PSQ_DS_GatherFrequencyCurrentData(device, s.headstage, passingSupraSweep, s.sweepNo) numPoints = DimSize(apfreq, ROWS) ASSERT(numPoints == DimSize(DaScales, ROWS), "Non-matching wave sizes") if(numPoints < numPointsForLineFit) printf "Found only %d sweeps from DAScale suprathreshold but we require at least %d\r", numPoints, numPointsForLineFit ControlWindowToFront() - return [$"", $""] + return 1 endif WAVE/T apfreqLBN = LBN_GetTextWave() @@ -2379,10 +2385,10 @@ Function PSQ_DAScale(device, s) key = CreateAnaFuncLBNKey(PSQ_DA_SCALE, PSQ_FMT_LBN_DA_AT_FREQ_DATA) ED_AddEntryToLabnotebook(device, key, apfreqLBN, overrideSweepNo = s.sweepNo) - WAVE/T DAScalesLBN = LBN_GetTextWave() - DAScalesLBN[INDEP_HEADSTAGE] = NumericWaveToList(DAScalesLBN, ",") + WAVE/T DAScalesTextLBN = LBN_GetTextWave() + DAScalesTextLBN[INDEP_HEADSTAGE] = NumericWaveToList(DAScalesTextLBN, ",") key = CreateAnaFuncLBNKey(PSQ_DA_SCALE, PSQ_FMT_LBN_DA_AT_DASCALE_DATA) - ED_AddEntryToLabnotebook(device, key, DAScalesLBN, overrideSweepNo = s.sweepNo) + ED_AddEntryToLabnotebook(device, key, DAScalesTextLBN, overrideSweepNo = s.sweepNo) [WAVE fitOffset, WAVE fitSlope] = PSQ_DS_EvaluateFrequencyCurrentData(device, numPointsForLineFit, apfreq, DAScales) @@ -2392,7 +2398,7 @@ Function PSQ_DAScale(device, s) return 1 endif - WAVE/T maxSlopeLBN = LBN_GetNumericWave() + WAVE maxSlopeLBN = LBN_GetNumericWave() maxSlopeLBN[INDEP_HEADSTAGE] = WaveMax(fitSlope) key = CreateAnaFuncLBNKey(PSQ_DA_SCALE, PSQ_FMT_LBN_DA_AT_MAX_SLOPE) ED_AddEntryToLabnotebook(device, key, maxSlopeLBN, overrideSweepNo = s.sweepNo)