Add ivscc_apfrequency operation - #2599
Conversation
75c4b24 to
bd0beed
Compare
|
@timjarsky This is a first version to play around. There are still a few things I have to add, that I discuss farther below.
xaxisOffset and yaxisOffset are strings that can be General Plotting BehaviorThe operation itself returns internally a full plotting specification that is inserted by the formula plotter at the location where the operation appears in the notebook code. The operation creates only traces that are separated by
Thus, the plotter applies the 10% for x and y-axis when used like this, where the formula setting the plot properties is last in the chain: but not for this: because Operation ArgumentsCurrently:
with The (later) final arguments should also expose arguments from The default for On the basis of the experiment avgMethodTesting2.pxp the generated code is: I added a
for
for I need to add a Therefore, the An additional task from the issue is to add a variable that contains the names of the experiments. I can create this variable in the operation and add it to the variable storage of the formula notebook. It would be available then after the operation ran. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
bd0beed to
d228f41
Compare
d228f41 to
5e60339
Compare
This comment was marked as outdated.
This comment was marked as outdated.
0b71dcf to
dc98aba
Compare
|
Thanks for handling the metadata management for mismatched sweep numbers across experiments. A few points for discussion:
|
dc98aba to
79f149a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
79f149a to
95732dc
Compare
|
@timjarsky I have added support for the apfrequency argument block after the first four argument for ivscc_apfrequency. The arguments are now: The last four arguments are "forwarded" to apfrequency. |
|
@MichaelHuth, Are failing sweeps included or filtered out? If included, please update to use only passing sweeps. |
|
@MichaelHuth I'm currently uploading test data to the FTP, folder |
|
@timjarsky New version, with support for seltag. In AB add tags, then load sweeps in SB. The first agument seltag select exactly that tags give: When seltag argument is omitted, then it looks through all experiments and creates a group for all different tags lists. So if you have "tag1", "tag2", "tag1,tag2", "" then four groups of experiments are created. To omit seltag you start the arguments for ivscc_apfrequency with showSingleExp, e.g. If a resulting group has only one experiment, then no average trace and no fit from the average is created. Slight adaptation in the calculation:
The new concatenated data zig-zags between the result points from the single experiment., which is to be expected. I sorted these f-I pairs as well. Here are five experiments loaded, where the first two are tagged with "tag1" and the other 3 with "tag2", the formula is
The dashed line are the concatenated points. THe output variable names have changes, as there is now a set for each group. The variables have now the tag list of the group suffixed. So for a group with tags "a,b" the variables are: The |
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
|
Hi @MichaelHuth , I'm having difficulty getting the latest version to work. Can you share an example formula? It looks like I'm making a basic syntax mistake:
|
The seltag opertion takes a single argument, so it is either The second argument (ShowSingleExp) is not an operation, but either "on" or "off" as simple text argument. I think you want something like this: |
|
|
||
| if(isSelected) | ||
| expBrowserSel[i][0] = expBrowserSel[i][0] | LISTBOX_SELECT_OR_SHIFT_SELECTION | ||
| endif | ||
| endfor |
| static Function AB_ExperimentListSelectAllRows() | ||
|
|
||
| WAVE expBrowserSel = GetExperimentBrowserGUISel() | ||
| expBrowserSel[][0] = expBrowserSel[p][0] | LISTBOX_SELECT_OR_SHIFT_SELECTION | ||
|
|
||
| AB_UpdateTagList() | ||
| End |
| argOffset += 1 | ||
| endif | ||
|
|
||
| args.showSingleExp = SFH_GetArgumentAsText(exd, opShort, argOffset + 0, defValue = SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_ON, allowedValues = {SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_ON, SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_OFF}) |
| args.showSingleExp = SFH_GetArgumentAsText(exd, opShort, argOffset + 0, defValue = SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_ON, allowedValues = {SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_ON, SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_OFF}) | ||
| args.xaxisOffset = SFH_GetArgumentAsText(exd, opShort, argOffset + 1, defValue = SF_OP_IVSCCAPFREQUENCY_MIN, allowedValues = {SF_OP_IVSCCAPFREQUENCY_FIRST, SF_OP_IVSCCAPFREQUENCY_MIN, SF_OP_IVSCCAPFREQUENCY_MAX, SF_OP_IVSCCAPFREQUENCY_NONE}) | ||
| args.yaxisOffset = SFH_GetArgumentAsText(exd, opShort, argOffset + 2, defValue = SF_OP_IVSCCAPFREQUENCY_MIN, allowedValues = {SF_OP_IVSCCAPFREQUENCY_FIRST, SF_OP_IVSCCAPFREQUENCY_MIN, SF_OP_IVSCCAPFREQUENCY_MAX, SF_OP_IVSCCAPFREQUENCY_NONE}) | ||
| args.xAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, argOffset + 3, defValue = 100, checkFunc = BetweenZeroAndOneHoundred) | ||
| args.yAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, argOffset + 4, defValue = 100, checkFunc = BetweenZeroAndOneHoundred) |
| # averaging mode: bins | ||
| ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage, prepareFitSpec, avgMode, binRange, binWidth, method, level, timeFreq, normalize, xAxisType]) | ||
| # averaging mode: bins2 | ||
| ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage, prepareFitSpec, avgMode, method, level, timeFreq, normalize, xAxisType]) |
| Implicitly created variables: | ||
| The operation `ivscc_apfrequency` creates variables in the sweepformula variable storage. These variables are available after the `ivscc_apfrequency` call. | ||
| If a variable with that name existed previously it is overwritten. | ||
|
|
||
| +----------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | ||
| | variable | description | | ||
| +========================================+========================================================================================================================+ | ||
| | `ivscc_apfrequency_explist` | A string array containing the experiment list `ivscc_apfrequency` worked on | | ||
| +----------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | ||
| | `ivscc_apfrequency_fit` | The result of the fit. The result can be used e.g. with `getmeta` to retrieve more information from the fit. | | ||
| | | See also operation `fit2`. Note: Even if no fit is displayed as trace that can happen if the fit resulted in an error, | | ||
| | | meta information can still be retrieved. | | ||
| +----------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | ||
| | `ivscc_apfrequency_inflection_current` | Current from each experiment in pA, where the slope of the frequency changes from positive to negative | | ||
| +----------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | ||
| | `ivscc_apfrequency_inflection_freq` | Frequency from each experiment, where the slope of the frequency changes from positive to negative | | ||
| +----------------------------------------+------------------------------------------------------------------------------------------------------------------------+ |
This utility function averages points from X, Y pairs with the same X, such afterwards X, Y pairs are present for each unique X.
The sweep formula executor did not support arrays of datasets directly
until now. This functionality was always indirectly through permanent
text waves which had some severe disadvantages:
- SF wave note data like data type got lost
- the consumer had to special handle the case where it needed to
distinguish between a text wave with data and a text wave that
possibly refers to datasets
- the consumer had to resolve that wave
- the resulting data structure was very unintuitive
We already had one case where a "hacky" workaround was used for datasets
in arrays. For select were two data types introduced:
SF_DATATYPE_SELECT and SF_DATATYPE_SELECTCOMP, where the first tagged
the dataset wave and the second the data wave. The first data type got lost
when select was used in arrays (a feature of select).
This commit introduces explicit handling for wave reference waves in the
executor. The wave type logic was extended to handle that additional to
out and outT (numeric / text).
One key difference is, that array dimensions do not get increased
on outer arrays for wave reference waves and wave reference waves are
always 1d.
The change in this commit supports no mixed type arrays. This is added
for datasets + another type in a following commit.
The new much cleaner and non-ambiguous data structure on an example:
Formula:
[dataset(1, \"abcd\"), dataset(2, \"cdef\")]
outer array -> size 1 wave ref wave
-> array elements -> size 2 wave ref wave - two dataset statements
-> array element 0 -> size 2 wave ref wave - from first dataset statement
-> element 0 -> size 1 DP wave value 1
-> element 1 -> size 1 TEXT wave value abcd
-> array element 1 -> size 2 wave ref wave - from second dataset statement
-> element 0 -> size 1 DP wave value 2
-> element 1 -> size 1 TEXT wave value cdef
Because the datasets gets directly assigned, no SF meta information
gets lost.
When mixed arrays are encountered like [text, dataset(...)] then this was only supported before the previous commit if the other elements are text type because datasets were stored indirectly through a textual reference (which is type compatible). The previous commit added direct support for wave reference waves in the executor. This commit adds now promotion of text and numeric types to single element dataset, when encountered in an array where another element is a dataset type. This allows arrays where datasets are paired with text/numeric elements. The logic is added as a precheck and promotion if necessary. As explicit dataset resolution by consumers is not required anymore these were removed in the following locations: - Test TestOperationOrVariableInArray where datasets in arrays are checked - SFH_MoveDatasetHigherIfCompatible - SFH_GetArgumentSelect - SFH_GetDatasetArrayAsResolvedWaverefs
This change is necessary because ivscc_apfrequency should accept arrays of seltag specifications. If seltag returns directly a text wave the SF executor applies array expansion to return a single text wave including all seltag specification (possibly dimension expanded). To distinguish each seltag specification in the array the array expansion must be mitigated. The solution for this is to wrap the seltag results in single datasets. An array of datasets is always 1d and never gets expanded. Adapted also seltag test and evaluation of seltag result in select operation.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (6)
Packages/MIES/MIES_SweepFormula_Operations.ipf:3104
- ivscc_apfrequency argument parsing currently always treats the first non-seltag argument as
showSingleExp(allowed: on/off). That makes calls likeivscc_apfrequency(none, none, 100, ...)fail becausenoneis parsed as showSingleExp instead of xaxisOffset. The tests/docs in this PR usenoneas the first argument, so this needs disambiguation (e.g., only consumeshowSingleExpif the next token is on/off; otherwise default to on and treat the token as xaxisOffset).
args.showSingleExp = SFH_GetArgumentAsText(exd, opShort, argOffset + 0, defValue = SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_ON, allowedValues = {SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_ON, SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_OFF})
args.xaxisOffset = SFH_GetArgumentAsText(exd, opShort, argOffset + 1, defValue = SF_OP_IVSCCAPFREQUENCY_MIN, allowedValues = {SF_OP_IVSCCAPFREQUENCY_FIRST, SF_OP_IVSCCAPFREQUENCY_MIN, SF_OP_IVSCCAPFREQUENCY_MAX, SF_OP_IVSCCAPFREQUENCY_NONE})
args.yaxisOffset = SFH_GetArgumentAsText(exd, opShort, argOffset + 2, defValue = SF_OP_IVSCCAPFREQUENCY_MIN, allowedValues = {SF_OP_IVSCCAPFREQUENCY_FIRST, SF_OP_IVSCCAPFREQUENCY_MIN, SF_OP_IVSCCAPFREQUENCY_MAX, SF_OP_IVSCCAPFREQUENCY_NONE})
args.xAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, argOffset + 3, defValue = 100, checkFunc = BetweenZeroAndOneHoundred)
args.yAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, argOffset + 4, defValue = 100, checkFunc = BetweenZeroAndOneHoundred)
Packages/MIES/MIES_SweepFormula_Operations.ipf:3309
- In bins2 mode,
xaxisOffset=firstcurrently does not apply an offset (it setsivsccavg_norm_xto the unmodified$ivsccavg_xvalues) even though the docs describefirstas subtracting the first x-value. This makesfirstbehave likenonefor the averaged x-values.
if(!CmpStr(args.xaxisOffset, SF_OP_IVSCCAPFREQUENCY_FIRST))
// TODO what should we do here, the obvious thing below does not make sense
// expr = "ivsccavg_norm_x = merge($ivscccurrentavg - extract($ivscccurrentavg, 0, 0))"
expr = "ivsccavg_norm_x = $ivsccavg_xvalues"
Packages/tests/HistoricData/UTF_HistoricSweepFormula.ipf:261
- Same tolerance issue here: use DEFAULT_TOL instead of a hardcoded 1E-12 so comparisons stay consistent across the test suite.
CHECK_EQUAL_WAVES(fitData, refData[%fitdata], mode = WAVE_DATA, tol = 1E-12)
WAVE xFitData = XWaveRefFromTrace(wName2, traceList2[5])
CHECK_EQUAL_WAVES(xFitData, refData[%fitxdata], mode = WAVE_DATA, tol = 1E-12)
Packages/doc/SweepFormula.rst:2549
- The documentation says the global inflection-point average is plotted as a "red filled caro". Besides the typo, the code sets the marker (18) and uses the standard average trace color, not explicitly red. Consider describing this trace in a way that matches the actual styling (or update the styling to match the docs).
The over all experiments averages current/frequency pair where the slope of the frequency changes from positive to negative are plotted as red filled caro.
Packages/doc/SweepFormula.rst:2569
- Docs for
ivscc_apfrequencydon’t mention the optionalseltag(...)/ tag grouping behavior or theshowSingleExpon/off flag, and the documented “implicitly created variables” (ivscc_apfrequency_explist,ivscc_apfrequency_fit,ivscc_apfrequency_inflection_*) don’t match what the implementation currently persists (it restores the var storage and only adds suffixed..._explist_<tagSuffix>/..._fit_<tagSuffix>, and doesn’t store inflection arrays). Please align the docs with the actual API/variable naming, or adjust the implementation to match the documented variables.
# averaging mode: bins
ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage, prepareFitSpec, avgMode, binRange, binWidth, method, level, timeFreq, normalize, xAxisType])
# averaging mode: bins2
ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage, prepareFitSpec, avgMode, method, level, timeFreq, normalize, xAxisType])
The argument `xaxisOffset` sets an offset for the x-values (current) from the apfrequency analysis that is applied to
the result from each selected experiment as well as to the averaged data. Default is `min`.
+-------------------+--------------------------------------------------------+
| xaxisOffset | description |
+===================+========================================================+
| `first` | The subtracted offset is the first x-value (current) |
+-------------------+--------------------------------------------------------+
| `min` | The subtracted offset is the minimum x-value (current) |
+-------------------+--------------------------------------------------------+
| `max` | The subtracted offset is the maximum x-value (current) |
+-------------------+--------------------------------------------------------+
| `none` | The x-values (current) are kept as is |
+-------------------+--------------------------------------------------------+
The argument `yaxisOffset` sets an offset for the y-values (apfrequency result) from the apfrequency analysis that is applied to
the result from each selected experiment as well as to the averaged data. Default is `min`.
+-------------------+-------------------------------------------------------------------+
| yaxisOffset | description |
+===================+===================================================================+
| `first` | The subtracted offset is the first y-value (apfrequency result) |
+-------------------+-------------------------------------------------------------------+
| `min` | The subtracted offset is the minimum y-value (apfrequency result) |
+-------------------+-------------------------------------------------------------------+
| `max` | The subtracted offset is the maximum y-value (apfrequency result) |
+-------------------+-------------------------------------------------------------------+
| `none` | The y-values (apfrequency result) are kept as is |
+-------------------+-------------------------------------------------------------------+
The argument `xAxisPercentage` sets which percentage in x-direction of the full plot area is used by the plot. Default is `100`.
The argument `yAxisPercentage` sets which percentage in y-direction of the full plot area is used by the plot. Default is `100`.
The argument `prepareFitSpec` is a fitting specification that has to be created through the `preparefit` operation. It defines how the
results from the averaging are fitted. The default is `preparefit()`, that disables the fit.
The argument `avgMode` specifies the averaging mode that is applied to average the apfrequency results from the sweeps of the input experiments.
The modes `bins` and `bins2` are allowed. Default is `bins`. See documentation for the operation `avg` for the specifics of these modes.
When `avgMode` is `bins` the following two arguments set the bin range with the `binRange` argument and the bin width with the `binWidth` argument.
These two arguments are not optional. The argument `binRange` must be a two element array in the form `[start, end]`. The number of bins results
automatically from the given range and width of the bins.
The following arguments specify the settings for the apfrequency analysis and are the same as for the operation `apfrequency`.
The arguments are `method`, `level`, `timeFreq`, `normalize` and `xAxisType`. The defaults are the same as for the `apfrequency` operation.
Details of the `ivscc_apfrequency` analysis:
First the user has to have one or more experiments with data loaded in the sweep browser.
For each experiment the sweeps with the following properties are selected:
* the stimset name contains `LP_Rheo` or `supra`
* the sweep passed the sweepqc check
For each experiment apfrequency analysis is run on all selected sweeps on epoch `E1` with the apfrequency settings specified.
The result is paired with an x-value that is the maximum current (pA) output in the same epoch (`E1`).
Per experiment the apfrequency and current results yield multiple datasets depending on the number of sweeps in the selection.
All x-values (current) are offsetted by the specified `xaxisOffset`.
In average mode `bins`:
The apfrequency results are averaged over each experiment with the given `binRange` and `binWidth` setting. The offsetted current is used for the binning.
The currents are averaged over each experiment with the given `binRange` and `binWidth` setting. The offsetted current is used for the binning.
This results in multiple datasets (one for each experiment) with a single result value each.
The averaged currents are offsetted by the `xaxisOffset` specification and merged into a single dataset with number of points equal to the number of bins.
In average mode `bins2`:
The apfrequency results are averaged over each experiment. The offsetted current is used for the binning.
The attached x-values (current) are extracted and merged to an own dataset with number of points equal to the number of bins.
The averaged currents are offsetted by the `xaxisOffset` specification.
The averaged apfrequency results are offsetted by the `yaxisOffset` specification and merged to a single dataset with points equal to the number of bins.
For each experiment the merged and offsetted currents and frequencies value pairs are sorted by current.
If an experiment has multiple results where frequencies were calculated from the same current (e.g. from different sweeps) the frequencies are averaged.
Then the current is determined where the slope changes from positive to negative for the first time. If no such inflection point exists then NaN is returned for that experiment.
This results in current/frequency pairs from each experiment where the slope changed.
Additionally these get averaged for a global current/frequency pair from all experiments.
The following traces are output:
For each experiment the apfrequency result offsetted by `yaxisOffset` specification vs. the current offsetted by the `xaxisOffset` specification.
These traces are colored according to the headstage at 20% opacity and use lines and filled circles as markers.
The current/frequency pairs where the slope of the frequency changes from positive to negative are plotted as red markers with diagonal cross.
The over all experiments averages current/frequency pair where the slope of the frequency changes from positive to negative are plotted as red filled caro.
The offsetted averaged apfrequency results are plotted vs. the offsetted averaged currents.
When a valid fitting specification was given through `prepareFitSpec` then the offsetted averaged apfrequency results are fitted (with the offsetted averaged currents as x-values).
The x- and y-errors from the averaging (standard deviation) are used in the fit as weights.
Thus, with x-errors orthogonal distance regression is applied in the fit. The fit result is plotted as trace.
Implicitly created variables:
The operation `ivscc_apfrequency` creates variables in the sweepformula variable storage. These variables are available after the `ivscc_apfrequency` call.
If a variable with that name existed previously it is overwritten.
+----------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| variable | description |
+========================================+========================================================================================================================+
| `ivscc_apfrequency_explist` | A string array containing the experiment list `ivscc_apfrequency` worked on |
+----------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| `ivscc_apfrequency_fit` | The result of the fit. The result can be used e.g. with `getmeta` to retrieve more information from the fit. |
| | See also operation `fit2`. Note: Even if no fit is displayed as trace that can happen if the fit resulted in an error, |
| | meta information can still be retrieved. |
+----------------------------------------+------------------------------------------------------------------------------------------------------------------------+
Packages/tests/HistoricData/UTF_HistoricSweepFormula.ipf:171
- Avoid hardcoding numeric tolerances in tests; the codebase uses DEFAULT_TOL as the shared absolute tolerance for comparisons. Using a single constant keeps tolerances consistent and makes it easier to adjust globally if needed.
This issue also appears on line 259 of the same file.
CHECK_EQUAL_WAVES(avgData, refData[%avgbinsdata], mode = WAVE_DATA, tol = 1E-12)
CHECK_EQUAL_WAVES(xAvgData, refData[%xavgbinsdata], mode = WAVE_DATA, tol = 1E-12)
WAVE fitData = TraceNameToWaveRef(wName, traceList[5])
CHECK_EQUAL_WAVES(fitData, refData[%fitbinsdata], mode = WAVE_DATA, tol = 1E-12)
WAVE xFitData = XWaveRefFromTrace(wName, traceList[5])
CHECK_EQUAL_WAVES(xFitData, refData[%xavgbinsdata], mode = WAVE_DATA, tol = 1E-12)
|
@MichaelHuth What is the status here? Can Tim already playaround some more? |
|
Yes, he can still play around. I just rebased, such that the new tag control dialog is there and the few fixed for seltag are in. |
As operation can now execute other operations "internally" the single level storage for assert data was insufficient. This storage is changed to use a LIFO through a wave reference wave. It also stores the "local" error message in the assert data frame. When an SFH_ASSERT happens the LIFO gets walked down to create a full error message. If the formula should be executed in a new frame can be set with the optional argument newFrame from SFE_ExecuteFormula and SFE_ExecuteVariableAssignments. - added tests
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
Packages/MIES/MIES_SweepFormula_Operations.ipf:3104
ivscc_apfrequencycurrently parsesshowSingleExpas the first non-seltag argument (allowed: on/off). However, the new documentation and tests call the operation withxaxisOffsetas the first argument (e.g.ivscc_apfrequency(none, none, 100, 100, ...)), which would make this implementation reject valid calls ("none" is not on/off). Please align the argument parsing with the intended public syntax (either moveshowSingleExpto a trailing optional argument, or implement a disambiguation: if the first arg is on/off treat it asshowSingleExp, otherwise treat it asxaxisOffsetand shift the remaining arguments).
args.showSingleExp = SFH_GetArgumentAsText(exd, opShort, argOffset + 0, defValue = SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_ON, allowedValues = {SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_ON, SF_OP_IVSCCAPFREQUENCY_SHOWSINGLE_OFF})
args.xaxisOffset = SFH_GetArgumentAsText(exd, opShort, argOffset + 1, defValue = SF_OP_IVSCCAPFREQUENCY_MIN, allowedValues = {SF_OP_IVSCCAPFREQUENCY_FIRST, SF_OP_IVSCCAPFREQUENCY_MIN, SF_OP_IVSCCAPFREQUENCY_MAX, SF_OP_IVSCCAPFREQUENCY_NONE})
args.yaxisOffset = SFH_GetArgumentAsText(exd, opShort, argOffset + 2, defValue = SF_OP_IVSCCAPFREQUENCY_MIN, allowedValues = {SF_OP_IVSCCAPFREQUENCY_FIRST, SF_OP_IVSCCAPFREQUENCY_MIN, SF_OP_IVSCCAPFREQUENCY_MAX, SF_OP_IVSCCAPFREQUENCY_NONE})
args.xAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, argOffset + 3, defValue = 100, checkFunc = BetweenZeroAndOneHoundred)
args.yAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, argOffset + 4, defValue = 100, checkFunc = BetweenZeroAndOneHoundred)
Packages/doc/SweepFormula.rst:2463
- The
ivscc_apfrequencydocumentation lists the call signature starting withxaxisOffset/yaxisOffset, but the implementation also supports a leading optionalseltagargument and ashowSingleExpon/off switch, and its current parsing order differs. Please update this section to reflect the actual supported syntax (includingseltagandshowSingleExp, their defaults, and their position) so users can call the operation correctly.
# averaging mode: bins
ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage, prepareFitSpec, avgMode, binRange, binWidth, method, level, timeFreq, normalize, xAxisType])
# averaging mode: bins2
ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage, prepareFitSpec, avgMode, method, level, timeFreq, normalize, xAxisType])
Packages/MIES/MIES_SweepFormula_Operations.ipf:3310
- In
bins2mode, thexaxisOffset=firstbranch currently does not apply any offset (it behaves likenone) and leaves a TODO. This makesfirstinconsistent with the documented semantics and with thebinsimplementation. You can implementfirstforbins2by subtracting the first xvalue fromivsccavg_xvalues.
if(!CmpStr(args.xaxisOffset, SF_OP_IVSCCAPFREQUENCY_FIRST))
// TODO what should we do here, the obvious thing below does not make sense
// expr = "ivsccavg_norm_x = merge($ivscccurrentavg - extract($ivscccurrentavg, 0, 0))"
expr = "ivsccavg_norm_x = $ivsccavg_xvalues"
elseif(!CmpStr(args.xaxisOffset, SF_OP_IVSCCAPFREQUENCY_MIN))
|
@timjarsky Ready to playaround, the merge conflicts are harmless. |
|
@MichaelHuth I uploaded a BIG file (Dravet _sst_07-29-2026.pxp) onto the FTP that has the following error: This error is associated with failing to plot 1 of the 3 FI curves the formula calls for. A few other nitpicks:
|








close #2581
TBs new todos:
else // SF_OP_IVSCCAPFREQUENCY_NONEbranches and add fatal error- Tags are simple strings (igor object names) separated by e.g. comma: Add input functionality to tag experiments in AB. Tags are not saved to disk (except experiment is saved), but only there while the window is open.
- Show them in an analysis browser column
- We expect 10 or more experiments per tag, so convenient GUI is important
- Add
selectvariant to select data by one of multiple tags: This new select filter should work with select itself and as additional optional argument for ivscc_apfrequency.seltag([tag1, tag2, ...])For ivscc_apfrequency we support that the seltag is given as array[seltag([tag1, tag2, ...]), seltag([tag1, tag2, ...]), ...]. ivscc_apfrequency should create one group for every seltag in the array.- If no seltag is given then ivscc_apfrequency should default to create one group for every list of tags present in the experiments, create one group for experiments without tags.
- Mention list of tags in the legend.
- When used with ivscc_apfrequency the following special analysis is applied:
- Support
seltag inivscc_apfrequency` so that each group of experiments from the same seltag generates:- single experiment f-I plot (same as now)
- one additional f-I plot where all f-I pairs from the single experiments are concatenated (and sorted?)
- average as before (just including data for this seltag)
- fit as before
(Original text :one f-I plot in addition to the single experiment plots. Generate one average for each group and no global (over all data across groups) average anymore. Allow to turn off the single experiment plots.)
close #2628