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. |
|
@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. |
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: |
This utility function averages points from X, Y pairs with the same X, such afterwards X, Y pairs are present for each unique X.
A subwindow was added that has a GUI to add tags to experiments. Tags for selected experiments are shown. Based on the tags experiments can be selected.
- sweepMap has a new column that stores the tag list (comma separated)
seltag is an operation that prepares tag information that can later be used with select to filter sweeps from experiments by tag.
…iple inputs The function takes a 1d wave reference wave as argument. Null wave elements are ignored.
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.
| static Function AB_ClearExpBrowserSelection() | ||
|
|
||
| WAVE expBrowserSel = GetExperimentBrowserGUISel() | ||
| expBrowserSel[][0] = expBrowserSel[p][0] & ~LISTBOX_SELECT_OR_SHIFT_SELECTION | ||
| End |
|
|
||
| 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}) |
| Make/FREE/T/N=(DimSize(indizes, ROWS)) experiments = sweepMap[indizes[p]][%FileName] | ||
| WAVE/T unqiueExperiments = GetUniqueEntries(experiments) | ||
|
|
||
| return unqiueExperiments |
| 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 | | ||
| +----------------------------------------+------------------------------------------------------------------------------------------------------------------------+ |






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