From 4b713dd82909606e12d0057f6bed6943c3423d9a Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Mon, 4 Nov 2024 11:49:02 +0100 Subject: [PATCH 1/7] tests/CheckRangeOfUserLabnotebookKeys: Loosen checks --- Packages/tests/UTF_HardwareHelperFunctions.ipf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/tests/UTF_HardwareHelperFunctions.ipf b/Packages/tests/UTF_HardwareHelperFunctions.ipf index fe40fbc167..bcc7fe9b96 100644 --- a/Packages/tests/UTF_HardwareHelperFunctions.ipf +++ b/Packages/tests/UTF_HardwareHelperFunctions.ipf @@ -786,13 +786,13 @@ static Function CheckRangeOfUserLabnotebookKeys(string device, variable type, va case "A": value = abs(value) CHECK_GT_VAR(value, 0) - CHECK_LE_VAR(value, 200e-12) + CHECK_LE_VAR(value, 4000e-12) break case "Volts": case "Volt": case "V": CHECK_GE_VAR(value, -0.1) - CHECK_LE_VAR(value, 0.1) + CHECK_LE_VAR(value, 1) break case "Ohm": case "Ω": From 0884047182b4518d90d355af57bad9927956bd89 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Mon, 4 Nov 2024 13:58:40 +0100 Subject: [PATCH 2/7] Packages/doc: Update analysis function calls graph We don't have the pre set event anymore since 20b6cccbf (Analysis Functions: Remove PRE_SWEEP_EVENT and repurpose as PRE_SWEEP_CONFIG_EVENT, 2021-06-21). --- ...lysis-functions-calls-during-RA-stages.svg | 65 ++++++++++--------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/Packages/doc/svg/analysis-functions-calls-during-RA-stages.svg b/Packages/doc/svg/analysis-functions-calls-during-RA-stages.svg index aeb9b8e22b..2d6a162f8f 100644 --- a/Packages/doc/svg/analysis-functions-calls-during-RA-stages.svg +++ b/Packages/doc/svg/analysis-functions-calls-during-RA-stages.svg @@ -1,20 +1,19 @@ + width="210mm" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="linearGradient6000" + inkscape:swatch="solid"> + id="base" + inkscape:showpageshadow="2" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" /> @@ -339,12 +341,12 @@ style="fill:none;stroke:#000000;stroke-width:0.902;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-mid:url(#marker1440)" id="path1578" /> + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.74764;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> Presweepsweep + id="tspan1">config From c6ea3f70c839bbca38ec45d903c271ea4ab478e6 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Mon, 4 Nov 2024 14:00:34 +0100 Subject: [PATCH 3/7] MIES_AnalysisFunctions.ipf: Reorder analysis event table The pre set comes before the pre sweep event so let's make that clear in the table as well. --- Packages/MIES/MIES_AnalysisFunctions.ipf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/MIES/MIES_AnalysisFunctions.ipf b/Packages/MIES/MIES_AnalysisFunctions.ipf index db7f74b4b1..05925ebe6d 100644 --- a/Packages/MIES/MIES_AnalysisFunctions.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions.ipf @@ -29,8 +29,8 @@ /// analysis parameters are validated if present. With Indexing ON, /// only the analysis function of the first stimset will receive /// that event. -/// Pre Sweep Config Before the sweep is configured None Write /// Pre Set Before a new set starts None Write +/// Pre Sweep Config Before the sweep is configured None Write /// Mid Sweep Each time when new data is polled Available for background DAQ only. Write /// Will always be called at least once and /// also with the full stimset acquired. From 66b8532875f9ec3a4f31a5b34780434e0757d540 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Mon, 4 Nov 2024 18:33:16 +0100 Subject: [PATCH 4/7] tests: Remove RAC sweep checks for old analysis functions These checks are always true, we don't do these check nowadays and don't loose anything if we get rid of them. --- .../UTF_PatchSeqDAScale_Sub.ipf | 55 ----------- .../UTF_PatchSeqDAScale_Supra.ipf | 30 ------ .../UTF_PatchSeqRamp.ipf | 50 ++-------- .../UTF_PatchSeqRheobase.ipf | 96 +++++-------------- .../UTF_PatchSeqSquarePulse.ipf | 45 --------- 5 files changed, 32 insertions(+), 244 deletions(-) diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Sub.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Sub.ipf index ead6ed2e99..f3e30992cc 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Sub.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Sub.ipf @@ -233,11 +233,6 @@ static Function PS_DS_Sub1_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NULL_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = -30 @@ -432,11 +427,6 @@ static Function PS_DS_Sub2_REENTRY([str]) WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = -30 @@ -607,11 +597,6 @@ static Function PS_DS_Sub3_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NUMERIC_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {-30, -50, -70, -110, -130} @@ -827,11 +812,6 @@ static Function PS_DS_Sub4_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NUMERIC_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {-30, -50, -70, -110, -130} @@ -980,11 +960,6 @@ static Function PS_DS_Sub5_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NULL_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = -30 @@ -1133,11 +1108,6 @@ static Function PS_DS_Sub5a_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NULL_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = -30 @@ -1354,11 +1324,6 @@ static Function PS_DS_Sub6_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NUMERIC_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {-30, -50, -70, -110, -130} @@ -1531,11 +1496,6 @@ static Function PS_DS_Sub7_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NUMERIC_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 7) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {-30, -30, -30, -50, -70, -110, -130} @@ -1721,11 +1681,6 @@ static Function PS_DS_Sub8_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NUMERIC_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 9) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {-30, -50, -50, -50, -70, -70, -70, -110, -130} @@ -1885,11 +1840,6 @@ static Function PS_DS_Sub9_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NULL_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = -30 @@ -2064,11 +2014,6 @@ static Function PS_DS_Sub10_REENTRY([str]) WAVE/Z resistanceErr = GetLBNEntries_IGNORE(str, sweepNo, LBN_RESISTANCE_FIT_ERR) CHECK_WAVE(resistanceErr, NULL_WAVE) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 1) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {-30} diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Supra.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Supra.ipf index 84c72101a9..a0ed36e258 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Supra.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Supra.ipf @@ -168,11 +168,6 @@ static Function PS_DS_Supra1_REENTRY([str]) WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 2) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {PSQ_DS_OFFSETSCALE_FAKE + 20, PSQ_DS_OFFSETSCALE_FAKE + 40} @@ -260,11 +255,6 @@ static Function PS_DS_Supra2_REENTRY([str]) WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 2) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {PSQ_DS_OFFSETSCALE_FAKE * 20, PSQ_DS_OFFSETSCALE_FAKE * 40} @@ -355,11 +345,6 @@ static Function PS_DS_Supra3_REENTRY([str]) WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {PSQ_DS_OFFSETSCALE_FAKE + 20, PSQ_DS_OFFSETSCALE_FAKE + 40, PSQ_DS_OFFSETSCALE_FAKE + 60, PSQ_DS_OFFSETSCALE_FAKE + 80, PSQ_DS_OFFSETSCALE_FAKE + 100} @@ -450,11 +435,6 @@ static Function PS_DS_Supra4_REENTRY([str]) WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) Make/FREE/D/N=(numEntries) stimScaleRef = {PSQ_DS_OFFSETSCALE_FAKE + 20, PSQ_DS_OFFSETSCALE_FAKE + 40, PSQ_DS_OFFSETSCALE_FAKE + 60, PSQ_DS_OFFSETSCALE_FAKE + 80, PSQ_DS_OFFSETSCALE_FAKE + 100} @@ -549,11 +529,6 @@ static Function PS_DS_Supra5_REENTRY([str]) WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) @@ -658,11 +633,6 @@ static Function PS_DS_Supra6_REENTRY([str]) WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - numEntries = DimSize(sweepPassed, ROWS) WAVE/Z stimScale = GetLBNEntries_IGNORE(str, sweepNo, STIMSET_SCALE_FACTOR_KEY) CHECK_EQUAL_WAVES(stimScale, {43, 43, 43, 43, 43}, mode = WAVE_DATA, tol = 1e-14) diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRamp.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRamp.ipf index e7599ba707..8ecff32cb8 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRamp.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRamp.ipf @@ -227,7 +227,8 @@ static Function PS_RA1_REENTRY([str]) variable sweepNo, i, numEntries, DAScale, onsetDelay - sweepNo = 1 + sweepNo = 1 + numEntries = sweepNo + 1 WAVE numericalValues = GetLBNumericalValues(str) @@ -259,11 +260,6 @@ static Function PS_RA1_REENTRY([str]) CHECK_WAVE(foundUserEpochs, NUMERIC_WAVE) CHECK_EQUAL_WAVES(foundUserEpochs, {0, 0}) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 2) - WAVE/Z DAScaleWave = GetStimscaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(DAScaleWave, {PSQ_RA_DASCALE_DEFAULT, PSQ_RA_DASCALE_DEFAULT}, mode = WAVE_DATA) @@ -274,7 +270,7 @@ static Function PS_RA1_REENTRY([str]) Make/FREE/N=(numEntries) sweepLengths for(i = 0; i < numEntries; i += 1) - WAVE sweepT = GetSweepWave(str, sweeps[i]) + WAVE sweepT = GetSweepWave(str, i) WAVE channel = ResolveSweepChannel(sweepT, 0) sweepLengths[i] = DimSize(channel, ROWS) - onsetDelay / DimDelta(channel, ROWS) endfor @@ -346,11 +342,6 @@ static Function PS_RA2_REENTRY([str]) CHECK_WAVE(foundUserEpochs, NUMERIC_WAVE) CHECK_EQUAL_WAVES(foundUserEpochs, {0, 0, 0}) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 3) - WAVE/Z durations = GetPulseDurations_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(durations, {15000, 15000, 15000}, mode = WAVE_DATA, tol = 1) @@ -423,11 +414,6 @@ static Function PS_RA2a_REENTRY([str]) CHECK_WAVE(foundUserEpochs, NUMERIC_WAVE) CHECK_EQUAL_WAVES(foundUserEpochs, {1, 1}) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 2) - WAVE/Z durations = GetPulseDurations_IGNORE(sweepNo, str) if(TestHelperFunctions#DoInstrumentation()) CHECK_WAVE(durations, NUMERIC_WAVE) @@ -515,11 +501,6 @@ static Function PS_RA3_REENTRY([str]) CHECK_WAVE(foundUserEpochs, NUMERIC_WAVE) CHECK_EQUAL_WAVES(foundUserEpochs, {1, 1, 1}) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 3) - WAVE/Z durations = GetPulseDurations_IGNORE(sweepNo, str) if(TestHelperFunctions#DoInstrumentation()) CHECK_WAVE(durations, NUMERIC_WAVE) @@ -602,11 +583,6 @@ static Function PS_RA4_REENTRY([str]) CHECK_WAVE(foundUserEpochs, NUMERIC_WAVE) CHECK_EQUAL_WAVES(foundUserEpochs, {1, 0, 0}) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 3) - WAVE/Z durations = GetPulseDurations_IGNORE(sweepNo, str) if(TestHelperFunctions#DoInstrumentation()) CHECK_WAVE(durations, NUMERIC_WAVE) @@ -685,11 +661,6 @@ static Function PS_RA5_REENTRY([str]) CHECK_WAVE(foundUserEpochs, NUMERIC_WAVE) CHECK_EQUAL_WAVES(foundUserEpochs, {0, 1, 1}) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 3) - WAVE/Z durations = GetPulseDurations_IGNORE(sweepNo, str) if(TestHelperFunctions#DoInstrumentation()) CHECK_WAVE(durations, NUMERIC_WAVE) @@ -782,11 +753,6 @@ static Function PS_RA6_REENTRY([str]) CHECK_WAVE(foundUserEpochs, NUMERIC_WAVE) CHECK_EQUAL_WAVES(foundUserEpochs, {1, 0, 1, 1}) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 4) - WAVE/Z durations = GetPulseDurations_IGNORE(sweepNo, str) if(TestHelperFunctions#DoInstrumentation()) CHECK_WAVE(durations, NUMERIC_WAVE) @@ -839,7 +805,8 @@ static Function PS_RA7_REENTRY([str]) string str variable i, sweepNo, numEntries, onsetDelay, DAScale - sweepNo = 0 + sweepNo = 0 + numEntries = sweepNo + 1 WAVE numericalValues = GetLBNumericalValues(str) @@ -871,11 +838,6 @@ static Function PS_RA7_REENTRY([str]) CHECK_WAVE(foundUserEpochs, NUMERIC_WAVE) CHECK_EQUAL_WAVES(foundUserEpochs, {0}) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 1) - WAVE/Z DAScaleWave = GetStimscaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(DAScaleWave, {PSQ_RA_DASCALE_DEFAULT}, mode = WAVE_DATA) @@ -885,7 +847,7 @@ static Function PS_RA7_REENTRY([str]) WAVE/Z stimSetLengths = GetStimsetLengths_IGNORE(sweepNo, str) Make/FREE/N=(numEntries) sweepLengths for(i = 0; i < numEntries; i += 1) - WAVE sweepT = GetSweepWave(str, sweeps[i]) + WAVE sweepT = GetSweepWave(str, i) WAVE channel = ResolveSweepChannel(sweepT, 0) sweepLengths[i] = DimSize(channel, ROWS) - onsetDelay / DimDelta(channel, ROWS) endfor diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRheobase.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRheobase.ipf index e21f7591eb..5a491dfc69 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRheobase.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRheobase.ipf @@ -161,7 +161,8 @@ static Function PS_RB1_REENTRY([str]) variable stepSize string key - sweepNo = 14 + sweepNo = 14 + numEntries = sweepNo + 1 WAVE numericalValues = GetLBNumericalValues(str) @@ -182,13 +183,8 @@ static Function PS_RB1_REENTRY([str]) WAVE/Z baselineQCWave = GetBaselineQCResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(baselineQCWave, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 15) - key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) - initialDAScale = GetLastSettingIndep(numericalValues, sweeps[0], key, UNKNOWN_MODE) + initialDAScale = GetLastSettingIndep(numericalValues, 0, key, UNKNOWN_MODE) CHECK_EQUAL_VAR(initialDAScale, PSQ_GetFinalDAScaleFake()) WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) @@ -203,7 +199,7 @@ static Function PS_RB1_REENTRY([str]) Make/FREE/N=(numEntries) sweepLengths for(i = 0; i < numEntries; i += 1) - WAVE sweepT = GetSweepWave(str, sweeps[i]) + WAVE sweepT = GetSweepWave(str, i) WAVE channel = ResolveSweepChannel(sweepT, 0) sweepLengths[i] = DimSize(channel, ROWS) - onsetDelay / DimDelta(channel, ROWS) endfor @@ -260,7 +256,8 @@ static Function PS_RB2_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) - sweepNo = 5 + sweepNo = 5 + numEntries = sweepNo + 1 key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) initialDAScale = GetLastSettingIndepRAC(numericalValues, sweepNo, key, UNKNOWN_MODE) @@ -282,11 +279,6 @@ static Function PS_RB2_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 6) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) Make/FREE/D/N=(numEntries) stimScaleRef = (p * PSQ_RB_DASCALE_STEP_LARGE + PSQ_GetFinalDAScaleFake()) * ONE_TO_PICO @@ -343,7 +335,8 @@ static Function PS_RB3_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) - sweepNo = 5 + sweepNo = 5 + numEntries = sweepNo + 1 key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) initialDAScale = GetLastSettingIndepRAC(numericalValues, sweepNo, key, UNKNOWN_MODE) @@ -365,11 +358,6 @@ static Function PS_RB3_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {1, 1, 1, 1, 1, 1}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 6) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) Make/FREE/D/N=(numEntries) stimScaleRef = (PSQ_GetFinalDAScaleFake() - p * PSQ_RB_DASCALE_STEP_LARGE) * ONE_TO_PICO @@ -426,7 +414,8 @@ static Function PS_RB4_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) - sweepNo = 1 + sweepNo = 1 + numEntries = sweepNo + 1 key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) initialDAScale = GetLastSettingIndepRAC(numericalValues, sweepNo, key, UNKNOWN_MODE) @@ -448,11 +437,6 @@ static Function PS_RB4_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {1, 0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 2) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) Make/FREE/D/N=(numEntries) stimScaleRef = (PSQ_GetFinalDAScaleFake() - p * PSQ_RB_DASCALE_STEP_LARGE) * ONE_TO_PICO @@ -522,7 +506,8 @@ static Function PS_RB5_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) - sweepNo = 1 + sweepNo = 1 + numEntries = sweepNo + 1 key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) initialDAScale = GetLastSettingIndepRAC(numericalValues, sweepNo, key, UNKNOWN_MODE) @@ -544,11 +529,6 @@ static Function PS_RB5_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0, 1}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 2) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) Make/FREE/D/N=(numEntries) stimScaleRef = (PSQ_GetFinalDAScaleFake() + p * PSQ_RB_DASCALE_STEP_LARGE) * ONE_TO_PICO @@ -605,7 +585,8 @@ static Function PS_RB6_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) - sweepNo = 2 + sweepNo = 2 + numEntries = sweepNo + 1 key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) initialDAScale = GetLastSettingIndepRAC(numericalValues, sweepNo, key, UNKNOWN_MODE) @@ -627,11 +608,6 @@ static Function PS_RB6_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {NaN, 0, 1}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 3) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) Make/FREE/D/N=(numEntries) stimScaleRef stimScaleRef[0, 1] = PSQ_GetFinalDAScaleFake() * ONE_TO_PICO @@ -691,7 +667,8 @@ static Function PS_RB7_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) - sweepNo = 7 + sweepNo = 7 + numEntries = sweepNo + 1 key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) initialDAScale = GetLastSettingIndepRAC(numericalValues, sweepNo, key, UNKNOWN_MODE) @@ -713,11 +690,6 @@ static Function PS_RB7_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {NaN, NaN, 0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 8) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) Make/FREE/D/N=(numEntries) stimScaleRef stimScaleRef[0, 1] = PSQ_GetFinalDAScaleFake() * ONE_TO_PICO @@ -784,7 +756,8 @@ static Function PS_RB8_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) - sweepNo = 3 + sweepNo = 3 + numEntries = sweepNo + 1 key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) initialDAScale = GetLastSettingIndepRAC(numericalValues, sweepNo, key, UNKNOWN_MODE) @@ -806,11 +779,6 @@ static Function PS_RB8_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {1, 0, 0, 1}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 4) - WAVE/Z stimScale = GetStimscaleFactor_IGNORE(sweepNo, str) Make/FREE/D/N=(numEntries) stimScaleRef @@ -875,7 +843,8 @@ static Function PS_RB9_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) - sweepNo = 2 + sweepNo = 2 + numEntries = sweepNo + 1 key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) initialDAScale = GetLastSettingIndepRAC(numericalValues, sweepNo, key, UNKNOWN_MODE) @@ -897,11 +866,6 @@ static Function PS_RB9_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {1, 0, 1}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 3) - WAVE/Z stimScale = GetStimscaleFactor_IGNORE(sweepNo, str) Make/FREE/D/N=(numEntries) stimScaleRef @@ -965,7 +929,8 @@ static Function PS_RB10_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) - sweepNo = 1 + sweepNo = 1 + numEntries = sweepNo + 1 key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) initialDAScale = GetLastSettingIndepRAC(numericalValues, sweepNo, key, UNKNOWN_MODE) @@ -987,11 +952,6 @@ static Function PS_RB10_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0, 1}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 2) - WAVE/Z stimScale = GetStimscaleFactor_IGNORE(sweepNo, str) Make/FREE/D/N=(numEntries) stimScaleRef @@ -1049,7 +1009,8 @@ static Function PS_RB11_REENTRY([str]) variable stepSize string key - sweepNo = 0 + sweepNo = 0 + numEntries = sweepNo + 1 WAVE numericalValues = GetLBNumericalValues(str) @@ -1070,13 +1031,8 @@ static Function PS_RB11_REENTRY([str]) WAVE/Z baselineQCWave = GetBaselineQCResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(baselineQCWave, {0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 1) - key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_INITIAL_SCALE, query = 1) - initialDAScale = GetLastSettingIndep(numericalValues, sweeps[0], key, UNKNOWN_MODE) + initialDAScale = GetLastSettingIndep(numericalValues, 0, key, UNKNOWN_MODE) CHECK_EQUAL_VAR(initialDAScale, PSQ_GetFinalDAScaleFake()) WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) @@ -1091,7 +1047,7 @@ static Function PS_RB11_REENTRY([str]) Make/FREE/N=(numEntries) sweepLengths for(i = 0; i < numEntries; i += 1) - WAVE sweepT = GetSweepWave(str, sweeps[i]) + WAVE sweepT = GetSweepWave(str, i) WAVE channel = ResolveSweepChannel(sweepT, 0) sweepLengths[i] = DimSize(channel, ROWS) - onsetDelay / DimDelta(channel, ROWS) endfor diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqSquarePulse.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqSquarePulse.ipf index 8870cbb85b..610ce8c795 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqSquarePulse.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqSquarePulse.ipf @@ -133,11 +133,6 @@ static Function PS_SP1_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 20) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(stimScale, {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000}, tol = 1e-14, mode = WAVE_DATA) @@ -204,11 +199,6 @@ static Function PS_SP2_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 20) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(stimScale, {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000}, tol = 1e-14, mode = WAVE_DATA) @@ -276,11 +266,6 @@ static Function PS_SP3_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 20) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(stimScale, {100, 200, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320}, tol = 1e-14, mode = WAVE_DATA) @@ -348,11 +333,6 @@ static Function PS_SP4_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 20) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(stimScale, {100, 200, 150, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260}, tol = 1e-14, mode = WAVE_DATA) @@ -421,11 +401,6 @@ static Function PS_SP5_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0, 1, 0, 1}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 4) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(stimScale, {100, 200, 150, 160}, tol = 1e-14, mode = WAVE_DATA) @@ -495,11 +470,6 @@ static Function PS_SP6_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {1, 1, 1, 0, 1}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(stimScale, {100, 50, 0, 0, 10}, tol = 1e-14, mode = WAVE_DATA) @@ -567,11 +537,6 @@ static Function PS_SP7_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {1, 1, 1, 1, 1}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 5) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(stimScale, {100, 50, 0, 0, 0}, tol = 1e-14, mode = WAVE_DATA) @@ -641,11 +606,6 @@ static Function PS_SP8_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 1) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(stimScale, {100}, tol = 1e-14, mode = WAVE_DATA) @@ -714,11 +674,6 @@ static Function PS_SP9_REENTRY([str]) WAVE/Z spikeDetectionWave = GetSpikeResults_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(spikeDetectionWave, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - CHECK_WAVE(sweeps, NUMERIC_WAVE) - numEntries = DimSize(sweeps, ROWS) - CHECK_EQUAL_VAR(numEntries, 20) - WAVE/Z stimScale = GetStimScaleFactor_IGNORE(sweepNo, str) CHECK_EQUAL_WAVES(stimScale, {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000}, tol = 1e-14, mode = WAVE_DATA) From d95b7db39fb31f3ea07f951c9e112651bc179c66 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 5 Nov 2024 10:35:55 +0100 Subject: [PATCH 5/7] AFH_GetAnalysisParameter: Fix querying non-existent parameter If the expected type is not given we need to allow querying non-existent parameters, otherwise functions like PSQ_CR_FindDependentAnalysisParameter always bug out. Broken since d0961b52d (AFH_GetAnalysisParameter: Skip type assertion, 2019-12-12). Also add some tests. --- .../MIES/MIES_AnalysisFunctionHelpers.ipf | 2 +- .../Basic/UTF_AnalysisFunctionParameters.ipf | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf b/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf index 94db8a747e..b60676e625 100644 --- a/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf +++ b/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf @@ -822,7 +822,7 @@ Function/S AFH_GetAnalysisParameter(name, params, [expectedType]) string type, value if(ParamIsDefault(expectedType)) - type = AFH_GetAnalysisParamType(name, params) + type = AFH_GetAnalysisParamType(name, params, typeCheck = 0) else type = AFH_GetAnalysisParamType(name, params, expectedType = expectedType) endif diff --git a/Packages/tests/Basic/UTF_AnalysisFunctionParameters.ipf b/Packages/tests/Basic/UTF_AnalysisFunctionParameters.ipf index 544eabd5a6..c368da6e85 100644 --- a/Packages/tests/Basic/UTF_AnalysisFunctionParameters.ipf +++ b/Packages/tests/Basic/UTF_AnalysisFunctionParameters.ipf @@ -1023,3 +1023,47 @@ Function GAPasT_Works([WAVE/T wv]) CHECK_EQUAL_STR(result, wv[1]) End /// @} + +/// @name AFH_GetAnalysisParameter +/// @{ +static Function GAP_Works() + + string result + string params = "var:variable=123,str:string=456" + + result = AFH_GetAnalysisParameter("var", params) + CHECK_EQUAL_STR(result, "123") + + result = AFH_GetAnalysisParameter("str", params, expectedType = "string") + CHECK_EQUAL_STR(result, "456") + + // wrong type + try + AFH_GetAnalysisParameter("var1", params, expectedType = "string") + FAIL() + catch + CHECK_NO_RTE() + endtry + + // invalid type + try + AFH_GetAnalysisParameter("var1", params, expectedType = "abcd") + FAIL() + catch + CHECK_NO_RTE() + endtry + + // non-existent parameter but type was given + try + AFH_GetAnalysisParameter("I_DONT_EXIST", params, expectedType = "variable") + FAIL() + catch + CHECK_NO_RTE() + endtry + + // empty return without type + result = AFH_GetAnalysisParameter("I_DONT_EXIST", params) + CHECK_EMPTY_STR(result) +End + +/// @} From 3d2acf3d88947fd75786eee09ed9117b9b29ec6b Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 5 Nov 2024 09:56:17 +0100 Subject: [PATCH 6/7] AFH_GetNextSweepSetCount: Factor it out --- .../MIES/MIES_AnalysisFunctionHelpers.ipf | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf b/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf index b60676e625..8c3f712bf8 100644 --- a/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf +++ b/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf @@ -1268,7 +1268,7 @@ End /// 0 if not and NaN if it is not possible to determine Function AFH_LastSweepInSet(string device, variable sweepNo, variable headstage, variable eventType) - variable DAC, sweepsInSet, setCount, skipCountExisting, sweepOffset + variable DAC, sweepsInSet, nextStimsetColumn, sweepOffset switch(eventType) case PRE_DAQ_EVENT: @@ -1279,17 +1279,30 @@ Function AFH_LastSweepInSet(string device, variable sweepNo, variable headstage, case MID_SWEEP_EVENT: // we need to look at the last acquired sweep sweepNo -= 1 - sweepOffset = 2 + sweepOffset = 1 break default: - sweepOffset = 1 + // do nothing endswitch DAC = AFH_GetDACFromHeadstage(device, headstage) sweepsInSet = IDX_NumberOfSweepsInSet(AFH_GetStimSetName(device, DAC, CHANNEL_TYPE_DAC)) - WAVE numericalValues = GetLBNumericalValues(device) - WAVE/Z sweepSetCount = GetLastSetting(numericalValues, sweepNo, "Set Sweep Count", DATA_ACQUISITION_MODE) + WAVE numericalValues = GetLBNumericalValues(device) + + nextStimsetColumn = AFH_GetNextSweepSetCount(numericalValues, sweepNo, headstage) + + return (nextStimsetColumn + sweepOffset) >= sweepsInSet +End + +/// @brief Return the set count of the next sweep +/// +/// No checking is done on the number of sweeps in the stimulus set +Function AFH_GetNextSweepSetCount(WAVE numericalValues, variable sweepNo, variable headstage) + + variable setCount, skipCountExisting + + WAVE/Z sweepSetCount = GetLastSetting(numericalValues, sweepNo, "Set Sweep Count", DATA_ACQUISITION_MODE) if(!WaveExists(sweepSetCount)) setCount = 0 @@ -1299,5 +1312,5 @@ Function AFH_LastSweepInSet(string device, variable sweepNo, variable headstage, skipCountExisting = GetLastSettingIndep(numericalValues, sweepNo, SKIP_SWEEPS_KEY, UNKNOWN_MODE, defValue = 0) - return (setCount + sweepOffset + skipCountExisting) >= sweepsInSet + return setCount + skipCountExisting + 1 End From 7bd218972e4471439e910b0cd645858b88028ef3 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 22 Oct 2024 19:36:37 +0200 Subject: [PATCH 7/7] PA_SpikePositionsForNonVC: Fix error in execution In 2bc24dac1 (PA_SpikePositionsForNonVC: Add missing /Q, 2024-08-01) we added a plain /Q to FindPeak. But the author did not realize that for this operation the /Q implies not erroring out (other operations do that with /Z). So the function currently always bugs out when it finds a peak. By dropping the RTE error handling we can use it correctly. --- Packages/MIES/MIES_PulseAveraging.ipf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Packages/MIES/MIES_PulseAveraging.ipf b/Packages/MIES/MIES_PulseAveraging.ipf index bfe019d5fb..b866ffaae9 100644 --- a/Packages/MIES/MIES_PulseAveraging.ipf +++ b/Packages/MIES/MIES_PulseAveraging.ipf @@ -2493,7 +2493,7 @@ End threadsafe Function/WAVE PA_SpikePositionsForNonVC(WAVE wv, variable failedPulsesLevel) variable numLevels, maxNumLevels, numSpikes - variable first, last, i, err, idx + variable first, last, i, idx // allow at most 1 pulse per ms, but at least 1 maxNumLevels = max(1, round(DimSize(wv, ROWS) * DimDelta(wv, ROWS)) * 2) @@ -2525,11 +2525,9 @@ threadsafe Function/WAVE PA_SpikePositionsForNonVC(WAVE wv, variable failedPulse continue endif - AssertOnAndClearRTError() - FindPeak/B=(PA_PEAK_BOX_AVERAGE)/M=(failedPulsesLevel)/R=(first, last)/Q wv; err = GetRTError(1) // see developer docu section Preventing Debugger Popup + FindPeak/B=(PA_PEAK_BOX_AVERAGE)/M=(failedPulsesLevel)/R=(first, last)/Q wv - if(!err) - ASSERT_TS(!V_Flag, "Could not find peak but FindLevelWrapper was successfull, this is unexpected.") + if(!V_Flag) spikePositions[idx++] = V_PeakLoc endif endfor