Skip to content

Add ivscc_apfrequency operation#2599

Open
MichaelHuth wants to merge 19 commits intomainfrom
feature/2599-ivscc_apfrequency_operation
Open

Add ivscc_apfrequency operation#2599
MichaelHuth wants to merge 19 commits intomainfrom
feature/2599-ivscc_apfrequency_operation

Conversation

@MichaelHuth
Copy link
Copy Markdown
Collaborator

@MichaelHuth MichaelHuth commented Dec 15, 2025

close #2581

  • Set the opacity of individual traces to 0.2. Leave average trace opacity at 1.
  • adapt xvalues operation to extract also from xvalues meta data
  • add support to plotter for opacity meta data
  • Support fitting the data (use the error bars of the average trace to weight the fit). Consider implementing a new operation that's passed as an optional argument into ivscc_APfrequency.
  • find out how to get automatically determined xOffset constant from e.g. exp_XOffset integrated fit func after fit -> W_fitConstants
  • ??add argument to ivscc_apfrequency that enables that all experiments/cells are fitted.
  • add argument to preparefit to limit the fitting range. For flexibility and simplicity I suggest to add this through a mask wave in fit2 then.
  • Make the fit parameters accessible with a related operation
  • ??the fit result may be based on the acquisition/sweep sequence rather than an ordered list of current intensity (x-scale values) -> 3rd avg mode?
  • add a way to expose the number and type of required coefficients to the user. Perhaps a link to the relevant Igor documentation, and/or a pop-up? -> add to help of preparefit

TBs new todos:

  • Data on the FTP for regression tests: pr-2599/inputRegressionTest
  • C&P into Excel does not work as multiple entries are added into one cell
  • Fix else // SF_OP_IVSCCAPFREQUENCY_NONE branches and add fatal error
  • Add grouping option for the analysisbrowser (add option to generate SF code in the analysis browser for selected experiments, copy to clipboard via context menu, ivscc_apfrequency should support these named groups)
  • getmeta
    • Tests
    • Docu
  • fit2
    • Tests
    • Docu
  • preparefit
    • Tests
    • Docu
  • ivscc_apfrequency
    • Tests
    • Docu
  • ihf docu

close #2628

@MichaelHuth MichaelHuth self-assigned this Dec 15, 2025
@MichaelHuth MichaelHuth force-pushed the feature/2599-ivscc_apfrequency_operation branch 2 times, most recently from 75c4b24 to bd0beed Compare December 17, 2025 18:15
@MichaelHuth
Copy link
Copy Markdown
Collaborator Author

@timjarsky This is a first version to play around. There are still a few things I have to add, that I discuss farther below.

ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage]) where [] denotes that the parameters are optional.

xaxisOffset and yaxisOffset are strings that can be min, max and none.

General Plotting Behavior

The 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 with. This means preceding and succeeding formulas that are also separated with with go to the same subwindow.

xAxisPercentage and yAxisPercentage are treated as properties for the plot by the plotter. Specifically plot means in this context the subwindow where the traces go. Plot properties from the last formula in the with chain are applied. (i.e. there is currently no gathering of plot properties).

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:

1
with
ivscc_apfrequency(min, min, 10, 10)

but not for this:

ivscc_apfrequency(min, min, 10, 10)
with
1

because 1 does not include any plot properties.

Operation Arguments

Currently:

ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage])

with xaxisOffset and yaxisOffset as min, max, none and xAxisPercentage, yAxisPercentage a number between 0 and 100.

The (later) final arguments should also expose arguments from apfrequency, so it will change to ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage, method, level, resultType, normalize, xAxisType).

The default for xaxisOffset and yaxisOffset is min.

On the basis of the experiment avgMethodTesting2.pxp the generated code is:

sel = select(selsweeps(), selstimset("*rheo*", "*supra*"), selvis(all))
selexpAD0 = select(selexp("C57BL6J-734969.15.10A.01.nwb"), $sel, selchannels(AD0), selrange(E1))
selexpDA0 = select(selexp("C57BL6J-734969.15.10A.01.nwb"), $sel, selchannels(DA0), selrange(E1))
freq0 = apfrequency(data($selexpAD0))
current0 = max(data($selexpDA0))
currentNorm0 = $current0 - extract($current0, 0) #*1
selexpAD1 = select(selexp("C57BL6J-734969.15.10B.01.nwb"), $sel, selchannels(AD0), selrange(E1))
selexpDA1 = select(selexp("C57BL6J-734969.15.10B.01.nwb"), $sel, selchannels(DA0), selrange(E1))
freq1 = apfrequency(data($selexpAD1))
current1 = max(data($selexpDA1))
currentNorm1 = $current1 - extract($current1, 0) #*2
ivsccavg = avg([$freq0,$freq1], group)
ivscccurrentavg = avg([$currentNorm0,$currentNorm1], group)

$freq0 - extract($freq0, 0) #*3
vs
$currentNorm0
with
$freq1 - extract($freq1, 0) #*4
vs
$currentNorm1
with
$ivsccavg - extract($ivsccavg, 0) #*5
vs
$ivscccurrentavg - extract($ivscccurrentavg, 0) #*6

I added a #* to the formulas that change depending on the min, max, none setting.

#*1, #*2 and #*6 depend on the xaxisOffset argument with the following logic:

min: currentNormX = $currentX - extract($currentX, 0)
max: currentNormX = $currentX - max(flatten($currentX))
none: currentNormX = $currentX

for #*6 it is:
min: $ivscccurrentavg - extract($ivscccurrentavg, 0)
max: $ivscccurrentavg - max(flatten($ivscccurrentavg))
none: $ivscccurrentavg

#*3, #*4 and #*5 depend on the yaxisOffset argument with the following logic:

min: $freqX - extract($freqX, 0)
max: $freqX - max(flatten($freqX))
none: $freqX

for #*5 it is:
min: $ivsccavg - extract($ivsccavg, 0)
max: $ivsccavg - max(flatten($ivsccavg))
none: $ivsccavg

I need to add a flatten operation because the result in e.g. $freqX are single values in 7 datasets (for avgMethodTesting2.pxp). Thus, our max() operation would determine the max in each dataset individually, but that is not what is wanted. The flatten operation should change n datasets with a single data point to an array with n elements.

Therefore, the max argument is currently not implemented yet until I have the flatten operation implemented.

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.
For now I thought of $ivscc_apfrequency_explist as name and it would be a string array.

Base automatically changed from feature/2592-refactor_sf_plotter2 to main December 17, 2025 21:59
@timjarsky

This comment was marked as outdated.

@MichaelHuth

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings December 18, 2025 12:35
@MichaelHuth MichaelHuth force-pushed the feature/2599-ivscc_apfrequency_operation branch from bd0beed to d228f41 Compare December 18, 2025 12:35

This comment was marked as outdated.

@MichaelHuth MichaelHuth force-pushed the feature/2599-ivscc_apfrequency_operation branch from d228f41 to 5e60339 Compare December 18, 2025 16:59
Copilot AI review requested due to automatic review settings December 19, 2025 15:53
@MichaelHuth

This comment was marked as outdated.

This comment was marked as outdated.

@MichaelHuth MichaelHuth force-pushed the feature/2599-ivscc_apfrequency_operation branch from 0b71dcf to dc98aba Compare December 19, 2025 16:04
@timjarsky
Copy link
Copy Markdown
Collaborator

@MichaelHuth

Thanks for handling the metadata management for mismatched sweep numbers across experiments.

A few points for discussion:

  1. The marker coloring makes it hard for me to evaluate the output (see plot image below). Can we use a single color for each experiment? Can the data be a single 1D wave instead of multiple x-y waves (this will enable fitting)?

  2. There are many zero-frequency measurements spread across the x-axis.

  3. The average seems more variable than the input data, perhaps because there are too many data points?

  4. I'm not sure about the utility of the negative current values with "min" and "max" (second image). The two axes options that I'm sure are needed are none (where each FI curve starts at zero current and zero frequency) and the absolute current values.

ivscc_apfrequency(none, none)
image

ivscc_apfrequency()
image

Copilot AI review requested due to automatic review settings December 20, 2025 03:25
@MichaelHuth MichaelHuth force-pushed the feature/2599-ivscc_apfrequency_operation branch from dc98aba to 79f149a Compare December 20, 2025 03:25
Copy link
Copy Markdown

Copilot AI left a 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.

Comment thread Packages/MIES/MIES_SweepFormula.ipf Outdated
Comment thread Packages/MIES/MIES_SweepFormula_Operations.ipf Outdated
Comment thread Packages/MIES/MIES_SweepFormula_Operations.ipf
Comment thread Packages/MIES/MIES_SweepFormula_Operations.ipf Outdated
Comment thread Packages/MIES/MIES_SweepFormula_Operations.ipf Outdated
@MichaelHuth
Copy link
Copy Markdown
Collaborator Author

MichaelHuth commented Dec 20, 2025

@timjarsky

  1. I changed that. There are now experiment + 1 traces with markers. The +1 trace is the average in the average color. The experiment traces use the common table for trace colors, with one color per experiment. I also added code to show the experiment name in the legend for these.
  2. I still have to look into this, why a lot of the results return a zero. Currently the standard setting of apfrequency for the internal apfrequency call are used.
  3. Yes, it looks a bit like that. I did not see that in my local testing with the three experiments though. I guess in the graphs you pasted there is for some of the average points only a single sweep for an index in the groups.
    e.g. first exp has 10 and second exp has 11 sweeps selected, then sweep data for index 10 is only present from the second experiment -> only one sweep goes into the average and then the trace point from the experiment and the trace point from the average are equal. The average is shown in front and covers the point from the experiment. You may check for the average points on the very top if there is a data point from an experiment underneath.
  4. I think it is the other way around, with none no offset is applied. min moves the trace to zero and max moves the trace such that the former maximum point is at zero.
    What I think might be unexpected with the initial formula construct is that there is an offset used per trace. Thus, when changing none -> min then each trace start is moved to zero separately and the visual relation between the traces shifts. (same applies for max)
    This per-trace behavior is the same for the xaxisOffset and yaxisOffset.
image

@MichaelHuth MichaelHuth force-pushed the feature/2599-ivscc_apfrequency_operation branch from 79f149a to 95732dc Compare December 22, 2025 14:16
@MichaelHuth
Copy link
Copy Markdown
Collaborator Author

@timjarsky
Regarding 2.: The default level for apfrequency is 0. This results in zero peaks found for sweeps where E1 does not cross the zero line and for this apfrequency returns 0 as result with the default arguments.

I have added support for the apfrequency argument block after the first four argument for ivscc_apfrequency. The arguments are now:
ivscc_apfrequency([xaxisOffset, yaxisOffset, xAxisPercentage, yAxisPercentage, method, level, resultType, normalize, xAxisType])

The last four arguments are "forwarded" to apfrequency.

@timjarsky
Copy link
Copy Markdown
Collaborator

@MichaelHuth, Are failing sweeps included or filtered out? If included, please update to use only passing sweeps.

Copilot AI review requested due to automatic review settings December 22, 2025 19:09
@MichaelHuth MichaelHuth removed their assignment Feb 25, 2026
@MichaelHuth
Copy link
Copy Markdown
Collaborator Author

  • after JWs comment regarding CurveFit syntax, I am not sure if something for the "poly x" (and related) types need to be changed regarding extra arguments. Needs to be checked.

Copilot AI review requested due to automatic review settings March 2, 2026 18:00
@t-b t-b force-pushed the feature/2599-ivscc_apfrequency_operation branch from 13a200c to c855eb2 Compare March 2, 2026 18:00
Copy link
Copy Markdown

Copilot AI left a 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 15 out of 17 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

WAVE/Z/T keys = JWN_GetKeys(wv, "")
CHECK_EQUAL_TEXTWAVES(keys, {"a", "b"})

WAVE/Z/T keys = JWN_GetKeys(wv, "I_DONT_EXIST")
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test redeclares the local variable keys a second time (WAVE/Z/T keys = ...) in the same function scope, which is not allowed and will cause a compile error. Reuse the existing keys variable (assignment without redeclaration) or use a different variable name for the second call.

Suggested change
WAVE/Z/T keys = JWN_GetKeys(wv, "I_DONT_EXIST")
keys = JWN_GetKeys(wv, "I_DONT_EXIST")

Copilot uses AI. Check for mistakes.
Comment thread Packages/MIES/MIES_Constants.ipf Outdated
Comment on lines +2577 to +2580
StrConstant SF_OP_MERGE = "merge"
StrConstant SF_OP_FIT = "fit"
StrConstant SF_OP_FITLINE = "fitline"
StrConstant SF_OP_DATASET = "dataset"
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SF_OP_MERGE, SF_OP_FIT, SF_OP_FITLINE, and SF_OP_DATASET are defined twice in this block, which will cause a compile-time error due to duplicate StrConstant definitions. Remove the duplicated second set (lines 2577–2580) and keep only a single definition per operation constant.

Suggested change
StrConstant SF_OP_MERGE = "merge"
StrConstant SF_OP_FIT = "fit"
StrConstant SF_OP_FITLINE = "fitline"
StrConstant SF_OP_DATASET = "dataset"

Copilot uses AI. Check for mistakes.
variable numArgs, numCoefs
string fitfuncName, holdStr, checkStr

SFH_CheckArgumentCount(exd, opShort, 0, maxArgs = 4)
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preparefit is documented/implemented to accept up to 5 arguments (including constraints at position 4), but SFH_CheckArgumentCount(..., maxArgs = 4) rejects any call that supplies the constraints argument. Update the max argument count to allow the constraints parameter.

Suggested change
SFH_CheckArgumentCount(exd, opShort, 0, maxArgs = 4)
SFH_CheckArgumentCount(exd, opShort, 0, maxArgs = 5)

Copilot uses AI. Check for mistakes.
Comment on lines +3853 to +3879
WAVE/Z/T keys = JWN_GetKeysAt(data, SF_SERIALIZE)
serStr = ""
for(string key : keys)
path = SF_SERIALIZE + "/" + key
val = JWN_GetNumberFromWaveNote(data, path)
if(!IsNaN(val))
serStr += key + ": " + num2str(val, "%f") + "\r"
continue
endif
str = JWN_GetStringFromWaveNote(data, path)
if(!IsEmpty(str))
serStr += key + ":\r" + str + "\r"
continue
endif
WAVE/Z wvn = JWN_GetNumericWaveFromWaveNote(data, path)
if(WaveExists(wvn))
str = NumericWaveToList(wvn, "\r")
serStr += key + ":\r" + str
continue
endif
WAVE/Z/T wt = JWN_GetTextWaveFromWaveNote(data, path)
if(WaveExists(wt))
str = TextWaveToList(wt, "\r")
serStr += key + ":\r" + str
continue
endif
endfor
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SFO_OperationGetMeta calls JWN_GetKeysAt(...), but there is no such function added/defined in the repo (the new helper is JWN_GetKeys). This will fail to compile; replace this call with the correct API (and handle the null-wave case if the path does not exist).

Suggested change
WAVE/Z/T keys = JWN_GetKeysAt(data, SF_SERIALIZE)
serStr = ""
for(string key : keys)
path = SF_SERIALIZE + "/" + key
val = JWN_GetNumberFromWaveNote(data, path)
if(!IsNaN(val))
serStr += key + ": " + num2str(val, "%f") + "\r"
continue
endif
str = JWN_GetStringFromWaveNote(data, path)
if(!IsEmpty(str))
serStr += key + ":\r" + str + "\r"
continue
endif
WAVE/Z wvn = JWN_GetNumericWaveFromWaveNote(data, path)
if(WaveExists(wvn))
str = NumericWaveToList(wvn, "\r")
serStr += key + ":\r" + str
continue
endif
WAVE/Z/T wt = JWN_GetTextWaveFromWaveNote(data, path)
if(WaveExists(wt))
str = TextWaveToList(wt, "\r")
serStr += key + ":\r" + str
continue
endif
endfor
WAVE/Z/T keys = JWN_GetKeys(data, SF_SERIALIZE)
serStr = ""
if(WaveExists(keys))
for(string key : keys)
path = SF_SERIALIZE + "/" + key
val = JWN_GetNumberFromWaveNote(data, path)
if(!IsNaN(val))
serStr += key + ": " + num2str(val, "%f") + "\r"
continue
endif
str = JWN_GetStringFromWaveNote(data, path)
if(!IsEmpty(str))
serStr += key + ":\r" + str + "\r"
continue
endif
WAVE/Z wvn = JWN_GetNumericWaveFromWaveNote(data, path)
if(WaveExists(wvn))
str = NumericWaveToList(wvn, "\r")
serStr += key + ":\r" + str
continue
endif
WAVE/Z/T wt = JWN_GetTextWaveFromWaveNote(data, path)
if(WaveExists(wt))
str = TextWaveToList(wt, "\r")
serStr += key + ":\r" + str
continue
endif
endfor
endif

Copilot uses AI. Check for mistakes.
Comment on lines +2930 to +2956
sprintf expr, "selexpAD%d = select(selexp(\"%s\"), $sel, selchannels(AD0), selrange(E1))", i, uniqueFiles[i]
formula = SF_AddExpressionToFormula(formula, expr)
sprintf expr, "selexpDA%d = select(selexp(\"%s\"), $sel, selchannels(DA0), selrange(E1))", i, uniqueFiles[i]
formula = SF_AddExpressionToFormula(formula, expr)
sprintf expr, "freq%d = apfrequency(data($selexpAD%d), %d, %f, %s, %s, %s)", i, i, method, level, timeFreq, normalize, xAxisType
formula = SF_AddExpressionToFormula(formula, expr)
sprintf expr, "current%d = max(data($selexpDA%d))", i, i
formula = SF_AddExpressionToFormula(formula, expr)
if(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_FIRST))
sprintf expr, "currentNorm%d = $current%d - extract($current%d, 0)", i, i, i
elseif(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_MIN))
sprintf expr, "currentNorm%d = $current%d - min(merge($current%d))", i, i, i
elseif(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_MAX))
sprintf expr, "currentNorm%d = $current%d - max(merge($current%d))", i, i, i
else // SF_OP_IVSCCAPFREQUENCY_NONE
sprintf expr, "currentNorm%d = $current%d", i, i
endif
formula = SF_AddExpressionToFormula(formula, expr)
endfor

Make/FREE/T/N=(numExp) freqs, currents, exps
freqs[] = "$freq" + num2istr(p)
freqList = TextWaveToList(freqs, ",", trailSep = 0)
currents[] = "$currentNorm" + num2istr(p)
currentList = TextWaveToList(currents, ",", trailSep = 0)
exps[] = "\"" + uniqueFiles[p] + "\""
expList = TextWaveToList(exps, ",", trailSep = 0)
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SFO_OperationIVSCCApFrequency constructs a SweepFormula string by interpolating experiment file names from uniqueFiles directly into expressions like selexp("%s") and into the ivscc_apfrequency_explist array without any escaping. On platforms where file names can contain " or other special characters, an attacker who controls experiment file names (e.g. via a crafted NWB/PXP on disk) can inject additional SweepFormula operations by breaking out of the quoted string (for example with a name like evil");otherOp()), which will then be executed under the user’s context. To avoid this injection vector, validate file/experiment names to a strict safe character set or escape them appropriately for the SweepFormula string literal context before inserting them into formula via sprintf/SF_AddExpressionToFormula.

Copilot uses AI. Check for mistakes.
@t-b t-b force-pushed the feature/2599-ivscc_apfrequency_operation branch from c855eb2 to 9e61b08 Compare April 28, 2026 20:48
MichaelHuth and others added 19 commits April 29, 2026 17:16
- 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.

- use *LP_Rheo* instead of *rheo* as stimset selection
- better resilience where partial results are zero sized datasets
The PrepareFit operation allows to gather information for fitting input data.
The function returns a wave reference wave that stores all gathered information.
The format of this wave is designed to allow further extensions for e.g.
masking, weights etc.

This is a preparation operation for a fit operation that implements the actual fit.
PrepareFit allows to use the same fit setup for different fits.
- this allows the user to use getmeta($ivscc_apfrequency_fit)
We can just use SetDimensionLabelsFromWaveContents with cleanup for that.
The defaults for the prefix was switched.
Copilot AI review requested due to automatic review settings April 29, 2026 22:05
@t-b t-b force-pushed the feature/2599-ivscc_apfrequency_operation branch from 9e61b08 to 3196644 Compare April 29, 2026 22:05
Copy link
Copy Markdown

Copilot AI left a 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 14 out of 14 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

formula = SF_AddExpressionToFormula(formula, expr)

if(!CmpStr(xaxisOffset, SF_OP_IVSCCAPFREQUENCY_FIRST))
// expr = "ivsccavg_norm_x = merge($ivscccurrentavg - extract($ivscccurrentavg, 0, 0))"
Comment on lines +3240 to +3246
if((FitQuitReason & FIT_QUITREASON_ITERATIONLIMITREACHED) == FIT_QUITREASON_ITERATIONLIMITREACHED)
msg += "Iteration limit reached.\r"
endif
if((FitQuitReason & FIT_QUITREASON_STOPPEDBYUSER) == FIT_QUITREASON_STOPPEDBYUSER)
msg += "User stopped fit.\r"
endif
if((FitQuitReason & FIT_QUITREASON_NOCHISQUAREDECREASE) == FIT_QUITREASON_NOCHISQUAREDECREASE)
Comment on lines +3360 to +3364
// ODR fit
FuncFit/C/Q/M=2/H=holdStr $fitFuncName, coefs, wvY/X=xWave/D=fitOutput/C=constraints/W=weightY/A=0/R=yResiduals/XW=weightX/XD=xOutput/XR=xResiduals/I=1/M=mask
else
FuncFit/C/Q/M=2/H=holdStr $fitFuncName, coefs, wvY/X=xWave/D=fitOutput/C=constraints/W=weightY/A=0/R=yResiduals/I=1/M=mask
endif
Comment on lines +3823 to +3827
JWN_SetWaveInWaveNote(fitOutput, SF_META_ERRORBARYPLUS, yResiduals)
JWN_SetWaveInWaveNote(fitOutput, SF_META_ERRORBARYMINUS, yResiduals)
if(xErrorsOut)
JWN_SetWaveInWaveNote(fitOutput, SF_META_ERRORBARXPLUS, xResiduals)
JWN_SetWaveInWaveNote(fitOutput, SF_META_ERRORBARXMINUS, xResiduals)
dsNum = SFH_GetArgumentAsNumeric(exd, opShort, 2, defValue = 0)

numDatasets = DimSize(datasets, ROWS)
SFH_ASSERT(dsNum < numDatasets, "Dataset with given number does not exist in input data")
Comment on lines +3183 to +3190
/// fit2(wvY, wvX, preparefit(...))
Function/WAVE SFO_OperationFit2(STRUCT SF_ExecutionData &exd)

string opShort = SF_OP_FIT2
string dataType
variable numDatasets

SFH_CheckArgumentCount(exd, opShort, 2, maxArgs = 3)
variable numArgs, numCoefs
string fitfuncName, holdStr, checkStr

numArgs = SFH_CheckArgumentCount(exd, opShort, 0, maxArgs = 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dedicated SF operation ivscc_apfrequency Introduce plotter feature to add errorbars to traces

4 participants