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. |
|
rebased @timjarsky The axisOffset specification is applied at two locations in the calculation. In one of the first steps the apfrequency vs current is determined for all experiments and their selection. This basically results in apfrequency vs current data for each experiment. These offsets are applied to this apfrequency vs current data for each experiment separately. This offsetted data is then used as input for the averaging. Another thing I noticed: The initial apfrequency vs current result from each experiment is not sorted by current. This results in the plots that the line between the markers can go back and forth. The original order follows the order from the selection. Is it important to keep the result order or would it be better for the visualization if the data is sorted by current before being displayed? The current version of ivscc_apfrequency has the "average DA scales at which a negative slope was first observed in the FI data." supported. I added the following: I kept the y-value at the frequency such that the cross is on top of the marker from the apfrequency vs current graph. Alternatively visualization could be to keep the y-value zero and plot it just as vertical lines. A second trace is added that is the averaged pair of apfrequency vs. current from the previous traces. This is only a single point that is the average where the slope changed (inflection) for all experiments. The current version of this PR also has documentation for the new operations in the .rst file. |
| static Function SFO_OperationFit2CalcReducedChiSquareStatistic(WAVE residualOut, WAVE weights, variable degFreedom) | ||
|
|
||
| variable i, size | ||
|
|
||
| size = DimSize(weights, ROWS) | ||
| Make/FREE/D/N=(size, size) weightMatrix | ||
| for(i = 0; i < size; i += 1) | ||
| weightMatrix[i][i] = 1 / weights[i]^2 | ||
| endfor | ||
| MatrixOp/FREE residAdapt = replace(residualOut, NaN, 0) | ||
| MatrixOp/FREE result = residAdapt^t x weightMatrix x residAdapt | ||
|
|
||
| return result[0] / degFreedom | ||
| End |
|
@MichaelHuth The seltag spec we came up with looks good. I've adapted one thing as Diff: (also available in the ... menu on github)
|
|
Note to self: Chat with @MichaelHuth about finding neg slope algorithm. We should only consider neg slope value from a DAScale value which is higher than the maximum firing frequency. |
|
@timjarsky I have added a first version that allows adding tags to experiments in the analysis browser. The tags are stored in a column in the experiment list. On the left there is a new button that open/hides the tag control side panel.
The top input field is for adding single tags to selected experiments. Press enter or the button right of it to execute. The tag list below shows the unique tags present for the selected experiments. If a tag there has a green background then all selected experiments have that tag. You can select one or more tags in that list. For selecting experiments based on tags there are three ways:
Tags are case-insensitive. Tags must be clean names. I also added a small convenience tweak to the experiment list, where you can press CTRL-A now to select all rows. |
|
@MichaelHuth the analysis browser implementation of tags looks nice. Can you help me understand what Are the tags implemented in IVSCC_ApFrequency yet? |
All three options allow to select experiments in the experiment list by tag. Button The tag list input allows you to enter a tag list as comma separated list.
Not yet, the next step is to take them over when loading into the sweepmap, such that the tags are also available in the sweep browser. Then I can access the tags from sweepformula to add seltag as operation. |
|
@MichaelHuth thanks for the helpful response. I'm finding that
|
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.









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