File MIES_SweepFormula.ipf

SF Sweep formula allows to do analysis on sweeps with a dedicated formula language

Constants for SweepFormula Clampmode user argument strings used in selcm()

static const string SF_OP_SELECTCM_CLAMPMODE_ALL = "all"
static const string SF_OP_SELECTCM_CLAMPMODE_NONE = "none"
static const string SF_OP_SELECTCM_CLAMPMODE_IC = "ic"
static const string SF_OP_SELECTCM_CLAMPMODE_VC = "vc"
static const string SF_OP_SELECTCM_CLAMPMODE_IZERO = "izero"

Functions

variable SF_BringBrowserToFront()
wave SF_GetNamedOperations()
wave SF_GetFormulaKeywords()
static string SF_StringifyState(variable state)
static string SF_StringifyAction(variable action)
static variable SF_FormulaParser(string formula, variable *createdArray = defaultValue, variable indentLevel = defaultValue)

serialize a string formula into JSON

Parameters:
  • formula – string formula

  • createdArray – [optional, default 0] set on recursive calls, returns boolean if parser created a JSON array

  • indentLevel – [internal use only] recursive call level, used for debug output

Returns:

a JSONid representation

static variable SF_ParserHandleRemainingBuffer(variable jsonId, string jsonPath, string formula, string buffer)
static std::tuple<variable, string, variable, variable, variable> SF_ParserModifyJSON(variable action, variable lastAction, variable state, string buffer, string token, variable indentLevel)
static std::tuple<variable, variable, variable> SF_ParserGetActionFromState(variable jsonId, variable state, variable lastCalculation, variable bufferIsEmpty)
static std::tuple<variable, variable, variable> SF_ParserGetStateFromToken(string token, variable jsonId, string buffer)
static std::tuple<string, string> SF_ParserEvaluatePossibleSign(variable jsonId, variable indentLevel)
static variable SF_ParserAddJSON(variable jsonId, string jsonPath, string formula, variable indentLevel)
static string SF_ParserInsertNegation(variable jsonId, string jsonPath, variable indentLevel)
static string SF_ParserAdaptSubPath(variable jsonId, string jsonPath, string subPath)
static variable SF_FPPutInArrayAtPath(variable subId, string jsonPath)

Create a new empty array object, add mainId into it at path and return created json, release subId.

static variable SF_FPAddArray(variable mainId, string jsonPath, variable subId, variable arrayWasCreated)

Adds subId to mainId, if necessary puts subId into an array, release subId.

static string SF_EscapeJsonPath(string str)

add escape characters to a path element

static variable SF_PlaceSubArrayAt(WaveOrNull out, WaveOrNull subArray, variable index)
static wave SF_FormulaExecutorStringOrVariable(string graph, variable jsonId, string jsonPath)
static std::tuple<WaveRefWave, SF_PlotMetaData> SF_GatherFormulaResults(string xFormula, string yFormula, string graph)
static string SF_GetAnnotationPrefix(string dataType)
static string SF_GetTraceAnnotationText(SF_PlotMetaData *plotMetaData, wave data)
static string SF_GetMetaDataAnnotationText(SF_PlotMetaData *plotMetaData, wave data, string traceName)
static wave SF_GenerateTraceColors(wave colorGroups)
static wave SF_GetGroupColors(WaveRefWave formulaResults)

Return an Nx3 wave with one color triplett for each unique trace color group.

std::tuple<RGBColor> SF_GetTraceColor(string graph, string opStack, wave data, WaveOrNull traceGroupColors)
static std::tuple<WaveText, variable> SF_CreateTraceNames(variable numTraces, variable dataNum, SF_PlotMetaData *plotMetaData, wave data)

Generate numTraces trace names for the given input.

Generates the trace names required for a single formula in the plotter and therefore the trace names range from traceCnt to traceCnt + numTraces - 1.

Return values:
  • traces – generated trace names

  • traceCnt – total count of all traces (input and output)

static string SF_ShrinkLegend(string annotation)

Reduces a multi line legend to a single line if only the sweep number changes. Returns the original annotation if more changes or the legend text does not follow the exected format

static std::tuple<WaveText, WaveRefWave> SF_PreparePlotter(string winNameTemplate, string graph, variable winDisplayMode, variable numGraphs)
static variable SF_CommonWindowSetup(string win, string graph)
static wave SF_GatherYUnits(WaveRefWave formulaResults, string explicitLbl, WaveTextOrNull yUnits)
static string SF_CombineYUnits(WaveText units)
static variable SF_CheckNumTraces(string graph, variable numTraces)
static variable SF_CleanUpPlotWindowsOnFail(WaveText plotGraphs)
static variable SF_KillWorkingDF(string graph)
static variable SF_FormulaPlotter(string graph, string formula, variable dmMode = defaultValue)

Plot the formula using the data from graph.

Parameters:
  • graph – graph to pass to SF_FormulaExecutor

  • formula – formula to plot

  • dmMode – [optional, default DM_SUBWINDOWS] display mode that defines how multiple sweepformula graphs are arranged

static variable SF_DeriveTraceDisplayMode(WaveOrNull wvX, wave wvY)
static variable SF_GetShowLegend(wave wv)
static variable SF_SplitPlotting(wave wv, variable dim, variable i, variable split)

utility function for SF_FormulaPlotter

split dimension dim of wave wv into slices of size split and get the starting index i

static variable SF_FormulaWaveScaleTransfer(wave source, wave dest, variable dimSource, variable dimDest)

transfer the wave scaling from one wave to another

Note: wave scale transfer requires wave units for the first wave or second wave

Parameters:
  • source – Wave whos scaling should get transferred

  • dest – Wave that accepts the new scaling

  • dimSource – dimension of the source wave, if SF_TRANSFER_ALL_DIMS is used then all scales and units are transferred on the same dimensions, dimDest is ignored in that case, no unit check is applied in that case

  • dimDest – dimension of the destination wave

static wave SF_GetSweepMapIndices(WaveText sweepMap, variable sweepNo, string expName, string device, string colLabel = defaultValue, string wildCardPattern = defaultValue)

Return the matching indices of sweepMap, if expName or device is an emtpy string then it is ignored.

static wave SF_MakeSweepPropertiesDisplayed(variable numTraces)
static wave SF_MakeSweepLNBsDisplayed(variable numTraces)
static wave SF_GetSelectData(string graph, SF_SelectParameters *filter)

Use the labnotebook information to return the active channel numbers for a given set of sweeps.

Parameters:
  • graph – DataBrowser or SweepBrowser reference graph

  • filter – filled SF_SelectParameters structure

Returns:

a selectData style wave with three columns containing sweepNumber, channelType and channelNumber

static variable SF_IsValidSingleSelection(SF_SelectParameters *filter, wave numericalValues, wave textualValues, variable filtSweepNo, variable filtChannelNumber, variable filtChannelType, variable sweepNo, variable channelNumber, variable channelType, variable clampMode, variable setCycleCount, variable setSweepCount, variable doStimsetMatching)
static variable SF_MapClampModeToSelectCM(variable clampMode)
static wave SF_SortSelectData(wave selectData)
static string SF_PreprocessInput(string formula)

Pre process code entered into the notebook.

  • unify line endings to CR

  • remove comments at line ending

  • cut off last CR from back conversion with TextWaveToList

static variable SF_SetStatusDisplay(string bsPanel, string errMsg, variable errState)
variable SF_button_sweepFormula_check(WMButtonAction *ba)
static variable SF_CheckInputCode(string code, string graph)

Checks input code, sets globals for jsonId and error string.

static variable SF_ParseFormulaToJSON(string formula)
variable SF_Update(string graph)
variable SF_IsActive(string win)

checks if SweepFormula (SF) is active.

std::tuple<string, string> SF_GetCode(string win)

Return the sweep formula code in raw and with all necessary preprocesssing.

variable SF_button_sweepFormula_display(WMButtonAction *ba)
variable SF_TabProc_Formula(WMTabControlAction *tca)
static wave SF_FilterEpochs(WaveOrNull epochs, WaveOrNull ignoreTPs)
static wave SF_OperationTPSS(variable jsonId, string jsonPath, string graph)
static wave SF_OperationTPInst(variable jsonId, string jsonPath, string graph)
static wave SF_OperationTPBase(variable jsonId, string jsonPath, string graph)
static wave SF_OperationTPFit(variable jsonId, string jsonPath, string graph)
static wave SF_OperationTP(variable jsonId, string jsonPath, string graph)
static variable SF_GetTPFitQuality(wave residuals, wave sweepData, variable beginTrail, variable endTrail)
static wave SF_OperationTPIterate(string graph, WaveRefWave mode, WaveRefWaveOrNull selectDataArray, WaveOrNull ignoreTPs, string opShort)
static wave SF_OperationTPImpl(string graph, WaveRefWave mode, WaveOrNull selectDataPreFilter, WaveOrNull ignoreTPs, string opShort)
static wave SF_OperationEpochs(variable jsonId, string jsonPath, string graph)
static wave SF_OperationEpochsImpl(string graph, WaveText epochPatterns, WaveOrNull selectData, variable epType, string opShort)
static variable SF_AssertOnMismatchedWaves(wave data0, wave data1, string opShort)
static wave SF_OperationMinus(variable jsonId, string jsonPath, string graph)
static wave SF_OperationMinusImplDataSets(WaveOrNull data0, WaveOrNull data1)
static wave SF_OperationPlus(variable jsonId, string jsonPath, string graph)
static wave SF_OperationPlusImplDataSets(WaveOrNull data0, WaveOrNull data1)
static wave SF_IndexOverDataSetsForPrimitiveOperation(variable jsonId, string jsonPath, string graph, string opShort)
static wave SF_OperationDiv(variable jsonId, string jsonPath, string graph)
static wave SF_OperationDivImplDataSets(WaveOrNull data0, WaveOrNull data1)
static wave SF_OperationMult(variable jsonId, string jsonPath, string graph)
static wave SF_OperationMultImplDataSets(WaveOrNull data0, WaveOrNull data1)
static wave SF_OperationRange(variable jsonId, string jsonPath, string graph)

range (start[, stop[, step]])

static wave SF_OperationMin(variable jsonId, string jsonPath, string graph)
static wave SF_OperationMinImpl(WaveOrNull input)
static wave SF_OperationMax(variable jsonId, string jsonPath, string graph)
static wave SF_OperationMaxImpl(WaveOrNull input)
static wave SF_OperationAvg(variable jsonId, string jsonPath, string graph)
static wave SF_OperationAvgImplOver(WaveRefWave input, string graph, string opShort)
static wave SF_OperationAvgImplIn(WaveOrNull input)
static wave SF_OperationRMS(variable jsonId, string jsonPath, string graph)
static wave SF_OperationRMSImpl(WaveOrNull input)
static wave SF_OperationVariance(variable jsonId, string jsonPath, string graph)
static wave SF_OperationVarianceImpl(WaveOrNull input)
static wave SF_OperationStdev(variable jsonId, string jsonPath, string graph)
static wave SF_OperationStdevImpl(WaveOrNull input)
static wave SF_OperationDerivative(variable jsonId, string jsonPath, string graph)
static wave SF_OperationDerivativeImpl(WaveOrNull input)
static wave SF_OperationIntegrate(variable jsonId, string jsonPath, string graph)
static wave SF_OperationIntegrateImpl(WaveOrNull input)
static wave SF_OperationArea(variable jsonId, string jsonPath, string graph)
static wave SF_OperationAreaImpl(WaveOrNull input, variable zero)
static wave SF_OperationButterworth(variable jsonId, string jsonPath, string graph)

butterworth(data, lowPassCutoff, highPassCutoff, order)

static wave SF_OperationButterworthImpl(WaveOrNull input, variable lowPassCutoff, variable highPassCutoff, variable order)
static wave SF_OperationXValues(variable jsonId, string jsonPath, string graph)
static wave SF_OperationXValuesImpl(WaveOrNull input)
static wave SF_OperationText(variable jsonId, string jsonPath, string graph)
static wave SF_OperationTextImpl(WaveOrNull input)
static wave SF_OperationSetScale(variable jsonId, string jsonPath, string graph)

setscale(data, dim, [dimOffset, [dimDelta[, unit]]])

static wave SF_OperationSetScaleImpl(WaveOrNull input, string dim, variable offset, variable delta, string unit)
static wave SF_OperationWave(variable jsonId, string jsonPath, string graph)
static wave SF_OperationSelectChannels(variable jsonId, string jsonPath, string graph)

selchannels([str name]+) converts a named channel from string to numbers.

returns [[channelName, channelNumber]+]

static wave SF_OperationSelectSweeps(variable jsonId, string jsonPath, string graph)

selsweeps(), selsweeps(1,2,3, [4...6]) returns all possible sweeps as 1d array

static wave SF_OperationPowerSpectrum(variable jsonId, string jsonPath, string graph)
static wave SF_PowerSpectrumRatio(WaveOrNull input, variable ratioFreq, variable deltaHz, wave fitData = defaultValue)
variable SF_LineNoiseFit(wave w, variable x)
static wave SF_OperationPowerSpectrumImpl(WaveOrNull input, string unit, variable cutoff, string winFunc)
static wave SF_OperationSelectVis(variable jsonId, string jsonPath, string graph)

selvis(mode) // mode can be all or displayed

returns a one element text wave with either SF_OP_SELECTVIS_ALL or SF_OP_SELECTVIS_DISPLAYED

static wave SF_OperationSelectExperiment(variable jsonId, string jsonPath, string graph)

selexp(expName) // expName is a string with optional wildcards

returns a one element text wave

static wave SF_OperationSelectExpandSCI(variable jsonId, string jsonPath, string graph)

selexpandsci() // no arguments

returns a one element numeric wave

static wave SF_OperationSelectExpandRAC(variable jsonId, string jsonPath, string graph)

selexpandrac() // no arguments

returns a one element numeric wave

static wave SF_OperationSelectSetCycleCount(variable jsonId, string jsonPath, string graph)

selsetcyclecount(x) // one numeric argument

returns a one element numeric wave

static wave SF_OperationSelectSetSweepCount(variable jsonId, string jsonPath, string graph)

selsetsweepcount(x) // one numeric argument

returns a one element numeric wave

static wave SF_OperationSelectSCIIndex(variable jsonId, string jsonPath, string graph)

selsciindex(x) // one numeric argument

returns a one element numeric wave

static wave SF_OperationSelectRACIndex(variable jsonId, string jsonPath, string graph)

selracindex(x) // one numeric argument

returns a one element numeric wave

static wave SF_OperationSelectDevice(variable jsonId, string jsonPath, string graph)

seldev(device) // device is a string with optional wildcards

returns a one element text wave

static wave SF_OperationSelectCM(variable jsonId, string jsonPath, string graph)

selcm(mode, mode, ...) // mode can be ic, vc, izero, all see SFClampModeStrings

returns a one element numeric wave with SF_OP_SELECTCM_CLAMPMODE_* ORed together from all arguments, see SFClampcodeConstants

static wave SF_OperationSelectStimset(variable jsonId, string jsonPath, string graph)

selstimset(stimsetName, stimsetName, ...)

returns a N element text wave with stimset names

static wave SF_OperationSelectIVSCCSweepQC(variable jsonId, string jsonPath, string graph)

SelIVSCCSweepQC(passed | failed)

returns a one element numeric wave with either SF_OP_SELECT_IVSCCSWEEPQC_PASSED or SF_OP_SELECT_IVSCCSWEEPQC_FAILED

static wave SF_OperationSelectIVSCCSetQC(variable jsonId, string jsonPath, string graph)

SelIVSCCSetQC(passed | failed)

returns a one element numeric wave with either SF_OP_SELECT_IVSCCSETQC_PASSED or SF_OP_SELECT_IVSCCSETQC_FAILED

static wave SF_OperationSelectRange(variable jsonId, string jsonPath, string graph)

selrange(rangespec)

returns 1 dataset with range specification (either text or 2 point numerical wave)

static variable SF_InitSelectFilterUninitalized(SF_SelectParameters *s)
static wave SF_OperationSelect(variable jsonId, string jsonPath, string graph)

select(selectFilterOp...)

returns 2 datasets, main wave typed SF_DATATYPE_SELECTCOMP dataset 0: N x 3 with columns [sweepNr][channelType][channelNr], typed SF_DATATYPE_SELECT dataset 1: WaveRef wave with range specifications, typed SF_DATATYPE_SELECTRANGE

static std::tuple<SF_SelectParameters> SF_DuplicateSelectFilter(SF_SelectParameters *filter)
static wave SF_RestoreSelectDataFromText(WaveText selectText)
static variable SF_ParseSelectText(WaveText selectText, wave selectData, variable index)
static wave SF_GetUniqueSelectData(wave selectData)
static string SF_CreateSweepMapRowId(string experiment, string datafolder, string device, string sweep)
static string SF_GetSweepMapRowId(WaveText sweepMap, variable index)
static variable SF_GetSweepMapIndexFromIds(WaveText sweepMapIds, string experiment, string datafolder, string device, variable sweepNo)
static wave SF_GetSelectDataWithRACorSCIIndex(string graph, wave selectData, variable index, variable mode)
static wave SF_GetSelectDataWithRACIndex(wave selectData, wave cycleIds, WaveTextOrNull sweepMap, variable index)
static wave SF_GetSelectDataWithSCIIndex(wave selectData, wave cycleIds, wave headstages, WaveTextOrNull sweepMap, variable index)
static wave SF_GetAdditionalSweepsWithSameSCIorRAC(wave numericalValues, variable mode, variable sweepNo, variable channelType, variable channelNumber)
static wave SF_GetSelectDataWithSCIorRAC(string graph, wave selectData, SF_SelectParameters *filter, variable mode)

Takes input selections and extends them. The extension of the selection is chosen through mode, one of SELECTDATA_MODE_* For RAC: For each input selection adds all selections of the same repeated acquisition cycle For SCI: For each input selection adds all selections of the same stimset cycle id and headstage Returns all resulting unique selections.

static string SF_GetSelectionExperiment(string graph, string expName)
static string SF_GetSelectionDevice(string graph, string device)
static variable SF_SetSelectionFilterDefaults(string graph, SF_SelectParameters *filter, variable includeAll)

sets uninitialized fields of the selection filter

static wave SF_OperationData(variable jsonId, string jsonPath, string graph)

data(array range[, array selectData])

returns [sweepData][sweeps][channelTypeNumber] for all sweeps selected by selectData

static wave SF_OperationAnaFuncParam(variable jsonId, string jsonPath, string graph)
static wave SF_OperationAnaFuncParamIterate(string graph, WaveText names, WaveRefWaveOrNull selectDataArray, string opShort)
static wave SF_OperationAnaFuncParamImplAllNames(WaveText names, WaveRefWave lbnParams)

Gather all requested analysis function parameters with wildcard support

Parameters:
  • names – requested analysis function parameter names, can include wildcards

  • lbnParams – wave reference wave, one wave per selectData entry, with the analysis function parameter data from the labnotebook including JWN metadata

Returns:

expanded analysis function parameter names (i.e. without wildcards) which match at least in one selectData entry

static wave SF_OperationAnaFuncParamImpl(string graph, WaveText names, WaveOrNull selectData, string opShort)
static wave SF_OperationLabnotebook(variable jsonId, string jsonPath, string graph)

labnotebook(array keys[, array selectData [, string entrySourceType]])

return lab notebook key for all sweeps that belong to the channels channels

static wave SF_OperationLabnotebookIterate(string graph, WaveText lbnKeys, WaveRefWaveOrNull selectDataArray, variable mode, string opShort)
static wave SF_OperationLabnotebookImpl(string graph, WaveText LBNKeys, WaveOrNull selectData, variable mode, string opShort)
static wave SF_OperationLabnotebookImplGetEntry(string graph, wave selectData, variable index, string lbnKey, variable mode)
static string SF_GetLabnotebookEntryUnits_Impl(wave numericalKeys, wave textualKeys, string entry)
static wave SF_GetLabnotebookEntryUnits(string graph, WaveText allLBNKeys, wave selectData)
static wave SFH_OperationLabnotebookExpandKeys(string graph, WaveText LBNKeys, wave selectData, variable mode)
static variable SF_SetSweepXAxisTickLabels(wave output, WaveOrNull selectDataPlainOrArray)
static wave SF_OperationLog(variable jsonId, string jsonPath, string graph)
static variable SF_OperationLogImpl(WaveOrNull input)
static wave SF_OperationLog10(variable jsonId, string jsonPath, string graph)
static wave SF_OperationLog10Impl(WaveOrNull input)
static wave SF_OperationCursors(variable jsonId, string jsonPath, string graph)
static wave SF_OperationFindLevel(variable jsonId, string jsonPath, string graph)
static wave SF_OperationApFrequency(variable jsonId, string jsonPath, string graph)
static variable SF_OperationApFrequencyNormalizeOverSweeps(WaveRefWave output, variable normValue)
static variable SF_OperationApFrequencyNormalizeOverSweepsImpl(WaveOrNull data, variable normValue)
static wave SF_OperationApFrequencyImpl(WaveOrNull data, variable level, variable method, string yStr, string normStr, string xAxisTypeStr, variable *normOSValue, wave normMean)
static string SF_OperationApFrequencyMethodToString(variable method)
static variable SF_ApFrequencyInstantaneous(wave peaksAt)
static wave SF_ApFrequencyInstantaneousPairs(wave peaksAt, variable yModeTime, variable xAxisIsCounts)
static wave SF_OperationStore(variable jsonId, string jsonPath, string graph)
static wave SF_SplitCodeToGraphs(string code)
static std::tuple<string, string> SF_SplitGraphsToFormula(string graphCode)
static string SF_GetFormulaWinNameTemplate(string mainWindow)
variable SF_button_sweepFormula_tofront(WMButtonAction *ba)
static wave SF_NewChannelsWave(variable size)
static wave SF_AverageTPFromSweep(WaveText epochMatches, wave sweepData)
static variable SF_AverageTPFromSweepImpl(wave tpData, wave tpStart, wave sweepData, variable i)
wave SF_GetAllOldCodeForGUI(string win)
static wave SF_GetAllOldCode()
variable SF_PopMenuProc_OldCode(WMPopupAction *pa)
variable SF_SetFormula(string databrowser, string formula)
wave SF_ExecuteFormula(string formula, string graph, variable singleResult = defaultValue, variable checkExist = defaultValue, variable useVariables = defaultValue)

Executes a given formula without changing the current SweepFormula notebook supports by default variable assignments does not support “with” and “and” keywords.

Parameters:
  • formula – formula string to execute

  • graph – name of databrowser window

  • singleResult – [optional, default 0], if set then the first dataSet is retrieved from the waveRef wave and returned, the waveRef wave is disposed

  • checkExist – [optional, default 0], only valid if singleResult=1, if set then the data wave in the single dataSet retrieved must exist

  • useVariables – [optional, default 1], when not set, hint the function that the formula string contains only an expression and no variable definitions

static variable SF_ConvertAllReturnDataToPermanent(WaveRefWave output, string win, string opShort)
static wave SF_GetArgumentTop(variable jsonId, string jsonPath, string graph, string opShort)

Executes the complete arguments of the JSON and parses the resulting data to a waveRef type.

Deprecated:

: executing all arguments e.g. as array in the executor poses issues as soon as data types get mixed. e.g. operation(0, A, [1, 2, 3]) fails as [0, A, [1, 2, 3]] can not be converted to an Igor wave. Thus, it is strongly recommended to parse each argument separately.

static wave SF_GetNumericVarArgs(variable jsonId, string jsonPath, string graph, string opShort)
static wave SF_AverageDataOverSweeps(WaveRefWave input)
static wave SF_SweepAverageHelper(WaveRefWave group)
static variable SF_RemoveEndOfSweepNaNs(WaveOrNull input)
static wave SF_CreatePlotFormulaDataWave()
static variable SF_CollectTraceData(variable *index, WaveRefWave graphData, string traceName, WaveOrNull wx, wave wy)
static std::tuple<string, string> SF_SplitVariableAssignment(string line)
static std::tuple<WaveText, string> SF_GetVariableAssignments(string preProcCode)
static string SF_CheckVariableAssignments(string preProcCode, variable jsonId)
static string SF_ExecuteVariableAssignments(string graph, string preProcCode)
dfref SF_GetBrowserDF(string graph)
wave SF_ResolveDatasetFromJSON(variable jsonId, string jsonPath, string graph, variable argNum)

Executes the part of the argument part of the JSON and parses the resulting data to a waveRef type.

static wave SF_ResolveDataset(wave input)
string SF_GetDefaultFormula()
wave SF_OperationMerge(variable jsonId, string jsonPath, string graph)
wave SF_OperationDataset(variable jsonId, string jsonPath, string graph)
static std::tuple<WaveDouble, WaveDouble> SF_ParseFitConstraints(WaveTextOrNull constraints, variable numParameters)
wave SF_OperationFitLine(variable jsonId, string jsonPath, string graph)
wave SF_OperationFit(variable jsonId, string jsonPath, string graph)
wave SF_OperationFitImpl(wave xData, wave yData, string fitFunc, wave holdWave, wave initialValues)
static wave SF_ConvertNonFiniteElements(WaveText subArray)
static variable SF_ConvertNonFiniteElementsImpl(string element)
static std::tuple<WAVE, WaveText> SF_ExecutorCreateOrCheckNumeric(WaveDoubleOrNull out, WaveTextOrNull outT, variable size0, variable size1, variable size2, variable size3)
static std::tuple<WAVE, WaveText> SF_ExecutorCreateOrCheckTextual(WaveOrNull out, WaveTextOrNull outT, variable size0, variable size1, variable size2, variable size3)
static variable SF_FormulaPlotterExtendResultsIfCompatible(WaveRefWave formulaResults)

This function extends formulaResults if possible. For each result from a Y formula it is attempted to move datasets from inside an array outside in the form [dataset(1, 2), dataset(3, 4)] -> dataset([1, 3], [3, 4]) because the plotter can iterate over datasets only at the outermost occurrence. As result the inside elements may be plottable after this transformation. algorithm details: Each Y formula result is ‘repackaged’ in an array and attempted to be transformed Case 1: On a failed transformation the initial array is returned. Case 2: On a successful transformation a dataset with one or more elements is returned Regarding the plotter the array of case 1 is treated as a single dataset. All the results from case 1 and case 2 are gathered in a waveref wave collectY. The X formula results are associated multiple times for case 2 if multiple datasets were returned and are gathered in a waveref wave collectX that grows identical to collectY. The formulaResults wave gets modified to store the new transformed results.

static string SF_GetSelectRowId(wave select, variable row)
static wave SF_CreateSelectWaveRowIds(wave select)
static wave SF_GetSetIntersectionSelect(wave select1, wave select2)

Returns the set intersection of two select waves from operation select.

static variable SF_FilterByClampModeEnabled(variable clampModeFilter, variable channelType)
static string SF_MatchSweepMapColumn(string graph, string match, string colLabel, string opShort)
variable TraceValueDisplayHook(WMTooltipHookStruct *s)

Variables

static const double SF_STATE_UNINITIALIZED = -1
static const double SF_STATE_COLLECT = 1
static const double SF_STATE_ADDITION = 2
static const double SF_STATE_SUBTRACTION = 3
static const double SF_STATE_MULTIPLICATION = 4
static const double SF_STATE_PARENTHESIS = 6
static const double SF_STATE_FUNCTION = 7
static const double SF_STATE_ARRAY = 8
static const double SF_STATE_ARRAYELEMENT = 9
static const double SF_STATE_WHITESPACE = 10
static const double SF_STATE_NEWLINE = 12
static const double SF_STATE_DIVISION = 13
static const double SF_STATE_STRING = 14
static const double SF_STATE_STRINGTERMINATOR = 15
static const double SF_ACTION_UNINITIALIZED = -1
static const double SF_ACTION_SKIP = 0
static const double SF_ACTION_COLLECT = 1
static const double SF_ACTION_LOWERORDER = 2
static const double SF_ACTION_HIGHERORDER = 3
static const double SF_ACTION_ARRAYELEMENT = 4
static const double SF_ACTION_PARENTHESIS = 5
static const double SF_ACTION_FUNCTION = 6
static const double SF_ACTION_ARRAY = 7
static const string SF_PARSER_REGEX_SIGNED_NUMBER = "^(?i)[+-]?[0-9]+(?:\.[0-9]+)?(?:[\+-]?E[0-9]+)?$"
static const string SF_PARSER_REGEX_QUOTED_STRING = "^\".*\"$"
static const string SF_PARSER_REGEX_SIGNED_PARENTHESIS = "^(?i)[+-]?\\([\s\S]*$"
static const string SF_PARSER_REGEX_SIGNED_FUNCTION = "^(?i)[+-]?[A-Za-z]+"
static const string SF_PARSER_REGEX_OTHER_VALID_CHARS = "[A-Za-z0-9_\.:;=!$]"
static const string SF_SWEEPFORMULA_REGEXP = "^(.+?)(?:\\bvs\\b(.+))?$"

Regular expression which extracts both formulas from $a vs $b

static const string SF_SWEEPFORMULA_GRAPHS_REGEXP = "^(.+?)(?:\\r[ \t]*and[ \t]*\\r(.*))?$"

Regular expression which extracts formulas pairs from $a vs $b\rand\r$c vs $d\rand\r...

static const string SF_SWEEPFORMULA_WITH_REGEXP = "^(.+?)(?:\\r[ \t]*with[ \t]*\\r(.*))?$"

Regular expression which extracts y-formulas from $a\rwith\r$b\rwith\r$c\r...

static const double SF_MAX_NUMPOINTS_FOR_MARKERS = 1000
static const double SF_APFREQUENCY_FULL = 0x0
static const double SF_APFREQUENCY_INSTANTANEOUS = 0x1
static const double SF_APFREQUENCY_APCOUNT = 0x2
static const double SF_APFREQUENCY_INSTANTANEOUS_PAIR = 0x3
static const string SF_OP_MINUS = "-"
static const string SF_OP_PLUS = "+"
static const string SF_OP_MULT = "*"
static const string SF_OP_DIV = "~1"
static const string SF_OP_RANGE = "range"
static const string SF_OP_RANGESHORT = "…"
static const string SF_OP_MIN = "min"
static const string SF_OP_MAX = "max"
static const string SF_OP_AVG = "avg"
static const string SF_OP_MEAN = "mean"
static const string SF_OP_RMS = "rms"
static const string SF_OP_VARIANCE = "variance"
static const string SF_OP_STDEV = "stdev"
static const string SF_OP_DERIVATIVE = "derivative"
static const string SF_OP_INTEGRATE = "integrate"
static const string SF_OP_TIME = "time"
static const string SF_OP_XVALUES = "xvalues"
static const string SF_OP_TEXT = "text"
static const string SF_OP_LOG = "log"
static const string SF_OP_LOG10 = "log10"
static const string SF_OP_APFREQUENCY = "apfrequency"
static const string SF_OP_CURSORS = "cursors"
static const string SF_OP_SELECTSWEEPS = "selsweeps"
static const string SF_OP_AREA = "area"
static const string SF_OP_SETSCALE = "setscale"
static const string SF_OP_BUTTERWORTH = "butterworth"
static const string SF_OP_SELECTCHANNELS = "selchannels"
static const string SF_OP_DATA = "data"
static const string SF_OP_LABNOTEBOOK = "labnotebook"
static const string SF_OP_ANAFUNCPARAM = "anaFuncParam"
static const string SF_OP_WAVE = "wave"
static const string SF_OP_FINDLEVEL = "findlevel"
static const string SF_OP_EPOCHS = "epochs"
static const string SF_OP_TP = "tp"
static const string SF_OP_STORE = "store"
static const string SF_OP_SELECT = "select"
static const string SF_OP_SELECTVIS = "selvis"
static const string SF_OP_SELECTEXP = "selexp"
static const string SF_OP_SELECTDEV = "seldev"
static const string SF_OP_SELECTEXPANDSCI = "selexpandsci"
static const string SF_OP_SELECTEXPANDRAC = "selexpandrac"
static const string SF_OP_SELECTSETCYCLECOUNT = "selsetcyclecount"
static const string SF_OP_SELECTSETSWEEPCOUNT = "selsetsweepcount"
static const string SF_OP_SELECTSCIINDEX = "selsciindex"
static const string SF_OP_SELECTRACINDEX = "selracindex"
static const string SF_OP_SELECTCM = "selcm"
static const string SF_OP_SELECTSTIMSET = "selstimset"
static const string SF_OP_SELECTIVSCCSWEEPQC = "selivsccsweepqc"
static const string SF_OP_SELECTIVSCCSETQC = "selivsccsetqc"
static const string SF_OP_SELECTRANGE = "selrange"
static const string SF_OP_POWERSPECTRUM = "powerspectrum"
static const string SF_OP_TPSS = "tpss"
static const string SF_OP_TPINST = "tpinst"
static const string SF_OP_TPBASE = "tpbase"
static const string SF_OP_TPFIT = "tpfit"
static const string SF_OPSHORT_MINUS = "minus"
static const string SF_OPSHORT_PLUS = "plus"
static const string SF_OPSHORT_MULT = "mult"
static const string SF_OPSHORT_DIV = "div"
static const string SF_OP_EPOCHS_TYPE_RANGE = "range"
static const string SF_OP_EPOCHS_TYPE_NAME = "name"
static const string SF_OP_EPOCHS_TYPE_TREELEVEL = "treelevel"
static const string SF_OP_TP_TYPE_BASELINE = "base"
static const string SF_OP_TP_TYPE_INSTANT = "inst"
static const string SF_OP_TP_TYPE_STATIC = "ss"
static const string SF_OP_SELECTVIS_ALL = "all"
static const string SF_OP_SELECTVIS_DISPLAYED = "displayed"
static const string SF_OP_SELECT_IVSCCQC_PASSED = "passed"
static const string SF_OP_SELECT_IVSCCQC_FAILED = "failed"
static const string SF_OP_TPFIT_FUNC_EXP = "exp"
static const string SF_OP_TPFIT_FUNC_DEXP = "doubleexp"
static const string SF_OP_TPFIT_RET_TAULARGE = "tau"
static const string SF_OP_TPFIT_RET_TAUSMALL = "tausmall"
static const string SF_OP_TPFIT_RET_AMP = "amp"
static const string SF_OP_TPFIT_RET_MINAMP = "minabsamp"
static const string SF_OP_TPFIT_RET_FITQUALITY = "fitq"
static const string SF_OP_APFREQUENCY_Y_TIME = "time"
static const string SF_OP_APFREQUENCY_Y_FREQ = "freq"
static const string SF_OP_APFREQUENCY_NORMOVERSWEEPSMIN = "normoversweepsmin"
static const string SF_OP_APFREQUENCY_NORMOVERSWEEPSMAX = "normoversweepsmax"
static const string SF_OP_APFREQUENCY_NORMOVERSWEEPSAVG = "normoversweepsavg"
static const string SF_OP_APFREQUENCY_NORMWITHINSWEEPMIN = "norminsweepsmin"
static const string SF_OP_APFREQUENCY_NORMWITHINSWEEPMAX = "norminsweepsmax"
static const string SF_OP_APFREQUENCY_NORMWITHINSWEEPAVG = "norminsweepsavg"
static const string SF_OP_APFREQUENCY_NONORM = "nonorm"
static const string SF_OP_APFREQUENCY_X_COUNT = "count"
static const string SF_OP_APFREQUENCY_X_TIME = "time"
static const string SF_OP_AVG_INSWEEPS = "in"
static const string SF_OP_AVG_OVERSWEEPS = "over"
static const string SF_OP_SELECT_STIMSETS_ALL = "*"
static const double EPOCHS_TYPE_INVALID = -1
static const double EPOCHS_TYPE_RANGE = 0
static const double EPOCHS_TYPE_NAME = 1
static const double EPOCHS_TYPE_TREELEVEL = 2
static const string SF_CHAR_COMMENT = "#"
static const string SF_CHAR_CR = "\r"
static const string SF_CHAR_NEWLINE = "\n"
static const double SF_TRANSFER_ALL_DIMS = -1
static const string SF_PLOTTER_GUIDENAME = "HOR"
static const string SF_XLABEL_USER = ""
static const double SF_MSG_OK = 1
static const double SF_MSG_ERROR = 0
static const double SF_MSG_WARN = -1
static const double SF_NUMTRACES_ERROR_THRESHOLD = 10000
static const double SF_NUMTRACES_WARN_THRESHOLD = 1000
static const string SF_AVERAGING_NONSWEEPDATA_LBL = "NOSWEEPDATA"
static const string SF_POWERSPECTRUM_UNIT_DEFAULT = "default"
static const string SF_POWERSPECTRUM_UNIT_DB = "db"
static const string SF_POWERSPECTRUM_UNIT_NORMALIZED = "normalized"
static const string SF_POWERSPECTRUM_AVG_ON = "avg"
static const string SF_POWERSPECTRUM_AVG_OFF = "noavg"
static const string SF_POWERSPECTRUM_WINFUNC_NONE = "none"
static const double SF_POWERSPECTRUM_RATIO_DELTAHZ = 10
static const double SF_POWERSPECTRUM_RATIO_EPSILONHZ = 0.25
static const double SF_POWERSPECTRUM_RATIO_EPSILONPOSFIT = 1E-3
static const double SF_POWERSPECTRUM_RATIO_MAXFWHM = 5
static const double SF_POWERSPECTRUM_RATIO_GAUSS_SIGMA2FWHM = 2.35482004503
static const double SF_POWERSPECTRUM_RATIO_GAUSS_NUMCOEFS = 4
static const double SF_VARIABLE_PREFIX = 36
static const string SF_GETSETINTERSECTIONSELECT_FORMAT = "%d_%d_%d_%f"
static const double SELECTDATA_MODE_SCI = 1
static const double SELECTDATA_MODE_RAC = 2
static const double SWEEPPROP_CLAMPMODE = 0
static const double SWEEPPROP_SETCYCLECOUNT = 1
static const double SWEEPPROP_SETSWEEPCOUNT = 2
static const double SWEEPPROP_END = 3
static const string DB_EXPNAME_DUMMY = "|DataBrowserExperiment|"