-
Notifications
You must be signed in to change notification settings - Fork 9
Add ivscc_apfrequency operation #2599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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. |
|
@MichaelHuth attempting to use ivscc_apfrequency() on the linked data , resulted in the following assertions: |
|
I had to fill a request form from Google for the data. |
bd0beed to
d228f41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new ivscc_apfrequency operation to the sweep formula system, along with supporting infrastructure changes including a flatten operation and refactored plotting code.
Key Changes
- Adds
ivscc_apfrequencyoperation for analyzing action potential frequency in IV sweep current clamp experiments - Introduces
flattenhelper operation to convert datasets of single values into 1D arrays - Refactors plotting infrastructure by introducing
SF_PlotterGraphStructto encapsulate plotting state - Adds axis offset and percentage control capabilities to the plotting metadata system
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| Packages/MIES/MIES_Constants.ipf | Adds new metadata constants for plot customization and operation names (contains merge conflict) |
| Packages/MIES/MIES_SweepFormula_Operations.ipf | Implements flatten and ivscc_apfrequency operations |
| Packages/MIES/MIES_SweepFormula_Executor.ipf | Registers new operations in the executor switch statement |
| Packages/MIES/MIES_SweepFormula.ipf | Major refactoring of plotting code to use structure-based state management |
| Packages/MIES/MIES_SweepFormula_Helpers.ipf | Adds helper functions for internal formula execution and variable storage |
| Packages/MIES/MIES_WaveDataFolderGetters.ipf | Expands plot metadata wave to include axis offset/percentage properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d228f41 to
5e60339
Compare
|
@timjarsky I fixed the assertion that came up. The reason was that with the three experiments the selections result in 20 sweeps from the first experiment, 24 from the second and 16 from the third. The avg operation was transferring the wave notes and meta data always from the first group to the averaged result. And this failed because the averaged result always has the highest number of datasets (24 in this case) and I can not transfer from 20 datasets to 24 datasets as for the last 4 there would be not wave notes and meta data to transfer. For this data this also means that for the first 16 sweeps in the groups the average is over 3 sweeps, 16 - 19 over 2 sweeps and 20 - 23 over 1 sweep. In the most recent version of this PR also the And the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 14 comments.
Comments suppressed due to low confidence (1)
Packages/MIES/MIES_SweepFormula.ipf:1630
- Missing return statement: The function SF_AddPlotTraceStyle declares a return value of type SF_PlotterGraphStruct but has no explicit return statement. This will cause a compilation error or undefined behavior. Add 'return [pg]' at the end of the function.
static Function [STRUCT SF_PlotterGraphStruct pg] SF_AddPlotTraceStyle(variable formulasAreDifferent)
variable i, j, numTraces, markerCode, lineCode, isCategoryAxis, tagCounter, lineStyle, overrideMarker, traceToFront
string trace, info, tagText, name, wvName
for(i = 0; i < pg.formulaCounter; i += 1)
WAVE/WAVE plotFormData = pg.collPlotFormData[i]
WAVE/T tracesInGraph = plotFormData[0]
WAVE/WAVE dataInGraph = plotFormData[1]
numTraces = DimSize(tracesInGraph, ROWS)
markerCode = formulasAreDifferent ? i : 0
markerCode = SFH_GetPlotMarkerCodeSelection(markerCode)
lineCode = formulasAreDifferent ? i : 0
lineCode = SFH_GetPlotLineCodeSelection(lineCode)
for(j = 0; j < numTraces; j += 1)
WAVE/Z wvX = dataInGraph[j][%WAVEX]
WAVE wvY = dataInGraph[j][%WAVEY]
trace = tracesInGraph[j]
info = AxisInfo(pg.win, "left")
isCategoryAxis = (NumberByKey("ISCAT", info) == 1)
if(isCategoryAxis)
WAVE traceColorHolder = wvX
else
WAVE traceColorHolder = wvY
endif
WAVE/Z traceColor = JWN_GetNumericWaveFromWaveNote(traceColorHolder, SF_META_TRACECOLOR)
if(WaveExists(traceColor))
switch(DimSize(traceColor, ROWS))
case 3:
ModifyGraph/W=$pg.win rgb($trace)=(traceColor[0], traceColor[1], traceColor[2])
break
case 4:
ModifyGraph/W=$pg.win rgb($trace)=(traceColor[0], traceColor[1], traceColor[2], traceColor[3])
break
default:
FATAL_ERROR("Invalid size of trace color wave")
endswitch
endif
tagText = JWN_GetStringFromWaveNote(wvY, SF_META_TAG_TEXT)
if(!IsEmpty(tagText))
name = "tag" + num2str(tagCounter++)
Tag/C/N=$name/W=$pg.win/F=0/L=0/X=0.00/Y=0.00 $trace, 0, tagText
endif
ModifyGraph/W=$pg.win mode($trace)=SF_DeriveTraceDisplayMode(wvX, wvY)
lineStyle = JWN_GetNumberFromWaveNote(wvY, SF_META_LINESTYLE)
if(IsValidTraceLineStyle(lineStyle))
ModifyGraph/W=$pg.win lStyle($trace)=lineStyle
elseif(formulasAreDifferent)
ModifyGraph/W=$pg.win lStyle($trace)=lineCode
endif
WAVE/Z customMarkerAsFree = JWN_GetNumericWaveFromWaveNote(wvY, SF_META_MOD_MARKER)
if(WaveExists(customMarkerAsFree))
DFREF dfrWork = SFH_GetWorkingDF(pg.graph)
wvName = "customMarker_" + NameOfWave(wvY)
WAVE customMarker = MoveFreeWaveToPermanent(customMarkerAsFree, dfrWork, wvName)
ASSERT(DimSize(wvY, ROWS) == DimSize(customMarker, ROWS), "Marker size mismatch")
ModifyGraph/W=$pg.win zmrkNum($trace)={customMarker}
else
overrideMarker = JWN_GetNumberFromWaveNote(wvY, SF_META_MOD_MARKER)
if(!IsNaN(overrideMarker))
markerCode = overrideMarker
endif
ModifyGraph/W=$pg.win marker($trace)=markerCode
endif
traceToFront = JWN_GetNumberFromWaveNote(wvY, SF_META_TRACETOFRONT)
traceToFront = IsNaN(traceToFront) ? 0 : !!traceToFront
if(traceToFront)
ReorderTraces/W=$pg.win _front_, {$trace}
endif
endfor
endfor
End
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
…n function This will allow to parse the same argument block as part of another operation later
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Comments suppressed due to low confidence (1)
Packages/MIES/MIES_SweepFormula.ipf:1658
- The function signature declares it returns a structure
[STRUCT SF_PlotterGraphStruct pg], but there is no return statement at the end of the function (line 1658). While the structure is passed by value in Igor Pro and modifications inside the function don't affect the caller unless explicitly returned, the function signature promises to return the structure but doesn't. This could lead to the caller receiving an uninitialized or default-valued structure instead of the modified one.
static Function [STRUCT SF_PlotterGraphStruct pg] SF_AddPlotTraceStyle(variable formulasAreDifferent)
variable i, j, numTraces, markerCode, lineCode, isCategoryAxis, tagCounter, lineStyle, overrideMarker, traceToFront
string trace, info, tagText, name, wvName
for(i = 0; i < pg.formulaCounter; i += 1)
WAVE/WAVE plotFormData = pg.collPlotFormData[i]
WAVE/T tracesInGraph = plotFormData[0]
WAVE/WAVE dataInGraph = plotFormData[1]
numTraces = DimSize(tracesInGraph, ROWS)
markerCode = formulasAreDifferent ? i : 0
markerCode = SFH_GetPlotMarkerCodeSelection(markerCode)
lineCode = formulasAreDifferent ? i : 0
lineCode = SFH_GetPlotLineCodeSelection(lineCode)
for(j = 0; j < numTraces; j += 1)
WAVE/Z wvX = dataInGraph[j][%WAVEX]
WAVE wvY = dataInGraph[j][%WAVEY]
trace = tracesInGraph[j]
info = AxisInfo(pg.win, "left")
isCategoryAxis = (NumberByKey("ISCAT", info) == 1)
if(isCategoryAxis)
WAVE traceColorHolder = wvX
else
WAVE traceColorHolder = wvY
endif
WAVE/Z traceColor = JWN_GetNumericWaveFromWaveNote(traceColorHolder, SF_META_TRACECOLOR)
if(WaveExists(traceColor))
switch(DimSize(traceColor, ROWS))
case 3:
ModifyGraph/W=$pg.win rgb($trace)=(traceColor[0], traceColor[1], traceColor[2])
break
case 4:
ModifyGraph/W=$pg.win rgb($trace)=(traceColor[0], traceColor[1], traceColor[2], traceColor[3])
break
default:
FATAL_ERROR("Invalid size of trace color wave")
endswitch
endif
tagText = JWN_GetStringFromWaveNote(wvY, SF_META_TAG_TEXT)
if(!IsEmpty(tagText))
name = "tag" + num2str(tagCounter++)
Tag/C/N=$name/W=$pg.win/F=0/L=0/X=0.00/Y=0.00 $trace, 0, tagText
endif
ModifyGraph/W=$pg.win mode($trace)=SF_DeriveTraceDisplayMode(wvX, wvY)
lineStyle = JWN_GetNumberFromWaveNote(wvY, SF_META_LINESTYLE)
if(IsValidTraceLineStyle(lineStyle))
ModifyGraph/W=$pg.win lStyle($trace)=lineStyle
elseif(formulasAreDifferent)
ModifyGraph/W=$pg.win lStyle($trace)=lineCode
endif
WAVE/Z customMarkerAsFree = JWN_GetNumericWaveFromWaveNote(wvY, SF_META_MOD_MARKER)
if(WaveExists(customMarkerAsFree))
DFREF dfrWork = SFH_GetWorkingDF(pg.graph)
wvName = "customMarker_" + NameOfWave(wvY)
WAVE customMarker = MoveFreeWaveToPermanent(customMarkerAsFree, dfrWork, wvName)
ASSERT(DimSize(wvY, ROWS) == DimSize(customMarker, ROWS), "Marker size mismatch")
ModifyGraph/W=$pg.win zmrkNum($trace)={customMarker}
else
overrideMarker = JWN_GetNumberFromWaveNote(wvY, SF_META_MOD_MARKER)
if(!IsNaN(overrideMarker))
markerCode = overrideMarker
endif
ModifyGraph/W=$pg.win marker($trace)=markerCode
endif
traceToFront = JWN_GetNumberFromWaveNote(wvY, SF_META_TRACETOFRONT)
traceToFront = IsNaN(traceToFront) ? 0 : !!traceToFront
if(traceToFront)
ReorderTraces/W=$pg.win _front_, {$trace}
endif
endfor
endfor
End
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return dataFromEachGroup | ||
| End | ||
|
|
||
| /// @brief Copy plot meta data JSON properties from a source to a target wave |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function documentation at line 2177 states "Copy plot meta data JSON properties from a source to a target wave" but the implementation only copies three specific properties (TRACECOLOR, TRACETOFRONT, LINESTYLE) rather than all plot metadata. The documentation should accurately describe what is copied, e.g., "Copy specific plot meta data properties (trace color, trace-to-front flag, and line style) from a source to a target wave".
| /// @brief Copy plot meta data JSON properties from a source to a target wave | |
| /// @brief Copy specific plot meta data properties (trace color, trace-to-front flag, and line style) from a source to a target wave |
| Make/FREE/D/N=(numDatasets) array | ||
| for(i = 0; i < numDatasets; i += 1) | ||
| WAVE data = input[i] | ||
| SFH_ASSERT(IsNumericWave(data) && DimSize(data, ROWS) == 1 && numpnts(data) == 1, "Expected numeric wave with a single number at dataset " + num2istr(i)) |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message at line 2498 has a grammatical issue. "Expected numeric wave with a single number at dataset" should be "Expected a numeric wave with a single number at dataset" for proper grammar.
| SFH_ASSERT(IsNumericWave(data) && DimSize(data, ROWS) == 1 && numpnts(data) == 1, "Expected numeric wave with a single number at dataset " + num2istr(i)) | |
| SFH_ASSERT(IsNumericWave(data) && DimSize(data, ROWS) == 1 && numpnts(data) == 1, "Expected a numeric wave with a single number at dataset " + num2istr(i)) |
| plotWITH[i][%FORMULAY] = wvY | ||
| SFO_OperationIVSCCApFrequencySetPlotProperties(plotWITH[i][%FORMULAY], xAxisPercentage, yAxisPercentage) |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable 'i' is being reused outside of the loop scope where it was defined. At line 2645, 'i' is used to index into plotWITH after the for loop at lines 2612-2632 has completed. This relies on 'i' retaining the value 'numExp' after the loop ends. While this works in Igor Pro, it's a maintainability issue as the code depends on implicit loop behavior. It would be clearer to either use a new variable or explicitly set it to 'numExp' to make the intent obvious.
| if(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_MIN)) | ||
| sprintf expr, "currentNorm%d = $current%d - extract($current%d, 0)", i, i, i | ||
| elseif(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_MAX)) | ||
| sprintf expr, "currentNorm%d = $current%d - max(flatten($current%d))", i, i, i | ||
| elseif(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_NONE)) | ||
| sprintf expr, "currentNorm%d = $current%d", i, i | ||
| else | ||
| FATAL_ERROR("Unknown xaxisOffset specification") | ||
| endif | ||
| formula = SF_AddExpressionToFormula(formula, expr) | ||
| endfor | ||
|
|
||
| elems[] = "$freq" + num2istr(p) | ||
| expr = "ivsccavg = avg([" + TextWaveToList(elems, ",", trailSep = 0) + "], group)" | ||
| formula = SF_AddExpressionToFormula(formula, expr) | ||
|
|
||
| elems[] = "$currentNorm" + num2istr(p) | ||
| expr = "ivscccurrentavg = avg([" + TextWaveToList(elems, ",", trailSep = 0) + "], group)" | ||
| formula = SF_AddExpressionToFormula(formula, expr) | ||
|
|
||
| elems[] = "\"" + uniqueFiles[p] + "\"" | ||
| expr = "ivscc_apfrequency_explist = [" + TextWaveToList(elems, ",", trailSep = 0) + "]" | ||
| formula = SF_AddExpressionToFormula(formula, expr) | ||
|
|
||
| WAVE/WAVE varStorage = GetSFVarStorage(exd.graph) | ||
| Duplicate/FREE varStorage, varBackup | ||
| SFE_ExecuteVariableAssignments(exd.graph, formula) | ||
|
|
||
| WAVE/WAVE varStorageOp = GetSFVarStorage(exd.graph) | ||
| WAVE wvResult = varStorageOp[%ivscc_apfrequency_explist] | ||
|
|
||
| WAVE/WAVE plotAND = SFH_CreateSFRefWave(exd.graph, opShort, 1) | ||
| Make/FREE/WAVE/N=(numExp + 1, 2) plotWITH | ||
| SetDimlabel COLS, 0, FORMULAX, plotWITH | ||
| SetDimlabel COLS, 1, FORMULAY, plotWITH | ||
| plotAND[0] = plotWITH | ||
|
|
||
| for(i = 0; i < numExp; i += 1) | ||
| if(!CmpStr(yaxisOffset, SF_OP_IVSCCAPFREQUENCY_MIN)) | ||
| sprintf formula, "flatten($freq%d - extract($freq%d, 0))", i, i | ||
| elseif(!CmpStr(yaxisOffset, SF_OP_IVSCCAPFREQUENCY_MAX)) | ||
| sprintf formula, "flatten($freq%d - max(flatten($freq%d)))", i, i | ||
| elseif(!CmpStr(yaxisOffset, SF_OP_IVSCCAPFREQUENCY_NONE)) | ||
| sprintf formula, "flatten($freq%d)", i | ||
| else | ||
| FATAL_ERROR("Unknown yaxisOffset specification") | ||
| endif | ||
| WAVE/WAVE wvY = SFH_ExecuteFormulaInternal(exd.graph, formula) | ||
| [s] = GetTraceColor(i) | ||
| Make/FREE/W/U traceColor = {s.red, s.green, s.blue} | ||
| JWN_SetWaveInWaveNote(wvY[0], SF_META_TRACECOLOR, traceColor) | ||
| JWN_SetNumberInWaveNote(wvY[0], SF_META_MOD_MARKER, 17) | ||
| JWN_SetStringInWaveNote(wvY[0], SF_META_LEGEND_LINE_PREFIX, uniqueFiles[i]) | ||
| plotWITH[i][%FORMULAY] = wvY | ||
| SFO_OperationIVSCCApFrequencySetPlotProperties(plotWITH[i][%FORMULAY], xAxisPercentage, yAxisPercentage) | ||
| sprintf formula, "flatten($currentNorm%d)", i | ||
| plotWITH[i][%FORMULAX] = SFH_ExecuteFormulaInternal(exd.graph, formula) | ||
| endfor | ||
|
|
||
| if(!CmpStr(yaxisOffset, SF_OP_IVSCCAPFREQUENCY_MIN)) | ||
| formula = "flatten($ivsccavg - extract($ivsccavg, 0))" | ||
| elseif(!CmpStr(yaxisOffset, SF_OP_IVSCCAPFREQUENCY_MAX)) | ||
| formula = "flatten($ivsccavg - max(flatten($ivsccavg)))" | ||
| elseif(!CmpStr(yaxisOffset, SF_OP_IVSCCAPFREQUENCY_NONE)) | ||
| formula = "flatten($ivsccavg)" | ||
| else | ||
| FATAL_ERROR("Unknown yaxisOffset specification") | ||
| endif | ||
| WAVE/WAVE wvY = SFH_ExecuteFormulaInternal(exd.graph, formula) | ||
| JWN_SetStringInWaveNote(wvY[0], SF_META_LEGEND_LINE_PREFIX, "ivscc_apfrequency average") | ||
| plotWITH[i][%FORMULAY] = wvY | ||
| SFO_OperationIVSCCApFrequencySetPlotProperties(plotWITH[i][%FORMULAY], xAxisPercentage, yAxisPercentage) | ||
|
|
||
| if(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_MIN)) | ||
| formula = "flatten($ivscccurrentavg - extract($ivscccurrentavg, 0))" | ||
| elseif(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_MAX)) | ||
| formula = "flatten($ivscccurrentavg - max(flatten($ivscccurrentavg)))" | ||
| elseif(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_NONE)) | ||
| formula = "flatten($ivscccurrentavg)" | ||
| else | ||
| FATAL_ERROR("Unknown xaxisOffset specification") | ||
| endif | ||
| plotWITH[i][%FORMULAX] = SFH_ExecuteFormulaInternal(exd.graph, formula) |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's duplicated logic for handling xaxisOffset and yaxisOffset. Lines 2575-2584 and 2648-2657 contain nearly identical if-elseif-else chains for xaxisOffset handling, while lines 2613-2621 and 2634-2642 duplicate the yaxisOffset handling. This violates DRY principles and makes maintenance harder. Consider extracting this logic into a helper function that takes the offset type, variable name, and returns the appropriate formula string.
| xAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, 2, defValue = 100, checkFunc = BetweenZeroAndOneHoundred) | ||
| yAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, 3, defValue = 100, checkFunc = BetweenZeroAndOneHoundred) |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function has inconsistent parameter naming. The parameters use 'xaxisOffset' and 'yaxisOffset' (lowercase 'axis'), but the percentage parameters use 'xAxisPercentage' and 'yAxisPercentage' (camelCase 'Axis'). For consistency, either all should use lowercase ('xaxis', 'yaxis') or all should use camelCase ('xAxis', 'yAxis').
| xAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, 2, defValue = 100, checkFunc = BetweenZeroAndOneHoundred) | |
| yAxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, 3, defValue = 100, checkFunc = BetweenZeroAndOneHoundred) | |
| xaxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, 2, defValue = 100, checkFunc = BetweenZeroAndOneHoundred) | |
| yaxisPercentage = SFH_GetArgumentAsNumeric(exd, opShort, 3, defValue = 100, checkFunc = BetweenZeroAndOneHoundred) |
- the plotting loop was adapted to allow the insertion of plots returned from operations - the plotting functions arguments were wrapped in the SF_PlotterGraphStruct structure and the functions adapted
|
@timjarsky Regarding the So maybe |
Hi @MichaelHuth, is the first point in $data the first sweep acquired, or is it something else? Normalizing to the minimum would be helpful. |
The result from select that is relevant for the order is sorted by sweepNumber -> channelType -> channelNumber (in that priority). So e.g. I will change that option to: |
d2818b0 to
bc28176
Compare
|
@MichaelHuth , can you confirm that |
|
The min offset is determined for each experiment. Here are the internal formulas for a three experiment example with I have grouped the variables by adding a empty lines (need to be removed when pasted in a notebook). |
|
@MichaelHuth
|
- Add plot property support for axisOffsets and axisPercent An operation can set these through SF_META_XAXISOFFSET, SF_META_YAXISOFFSET, SF_META_XAXISPERCENT and SF_META_YAXISPERCENT in the JSON wave note of the result wave. The plotter uses the settings from the last result in a "with" block. e.g. op_that_sets_axisoffet() with 1 would ignore the plot properties set by the first operation, whereas 1 with op_that_sets_axisoffet() would apply it.
The avg operation in group mode does a wavenote and meta data transfer. This transfer works only if the number of datasets in the output waves are equal to the number of datasets of the input waves. (If there would be less input than output waves, there would be no data for some output waves) The group mode did transfer always from the first group. If the first group contained less datasets than the group with the greatest number of datasets then the transfer failed. As the result of the group averaging always has the same number of datasets as the greatest group the wave note and meta data transfer is now done from the greatest input group. Since: 272c26b (SF: operation avg add mode to average over groups of data, 2025-11-12)
bc28176 to
fea705e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return SFH_GetOutputForExecutor(output, exd.graph, SF_OP_TABLE) | ||
| End | ||
|
|
||
| /// @brief Sets the plot meta data for the ivscc_apfrequency operation |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states 'Sets the plot meta data for the ivscc_apfrequency operation' but the function only sets two specific properties (xAxisPercentage and yAxisPercentage). The comment should be more specific about what properties are being set rather than implying all plot metadata is being configured.
| /// @brief Sets the plot meta data for the ivscc_apfrequency operation | |
| /// @brief Sets the x- and y-axis percentage plot metadata for the ivscc_apfrequency operation |
fea705e to
bc32099
Compare
@timjarsky I changed the logic using the new It works like described in issue #2581 The syntax is The result is a wave with number of bins datasets. Number of dataGroups must equal number of binGroups and binGroups must have a single data point per dataset. This looks in the internal formula used by For three experiments with a bin range from 0 to 500 and a bin size of 100 (pA in that case as the bins refer to the binGroups which are current) I inserted the bin range and bin width argument after the first four arguments, such that: The brackets around binStart, binEnd are required, the brackets around the apfrequency related arguments indicate that these are optional. e.g. I changed the x-formula for the average output to contain the bin centers. |




close #2581