Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
feab7d8
SF: Move part of the argument parsing for operation apfrequency to ow…
MichaelHuth Dec 22, 2025
baff741
SF: Add operation ivscc_apfrequency
MichaelHuth Dec 15, 2025
07c37e3
SF: bugfix for avg operation with group mode
MichaelHuth Dec 19, 2025
d15a889
SF: Add transfer of plotting meta data in merge operation
MichaelHuth Dec 22, 2025
6c13177
SF: Add bins mode to avg operation
MichaelHuth Dec 23, 2025
a5a3911
SF: use avg bins mode in ivscc_apfrequency
MichaelHuth Dec 23, 2025
e3e2b2d
SFO: Change minus,plus,mult,div operation for zero size datasets on b…
MichaelHuth Feb 5, 2026
5b2cf30
f ivscc_apfrequency
MichaelHuth Feb 5, 2026
51086c8
f ivscc_apfrequency
MichaelHuth Feb 5, 2026
d8a5886
SFO: avg with mode bins: skip null wave datasets in gather step
MichaelHuth Feb 6, 2026
5904dfb
SF Constants: Add meta constants for error bar information
MichaelHuth Feb 6, 2026
b08c9af
SFO: Add bins2 mode to avg operation with dbg output
MichaelHuth Feb 6, 2026
ac24208
SF: Add two more checks for avg bin mode for bin datasets
MichaelHuth Feb 9, 2026
bbd52b3
debug printouts
MichaelHuth Feb 9, 2026
6c6c659
SF: Extend merge operation to merge xValues and errorbar information
MichaelHuth Feb 10, 2026
f488eb6
SF: Add support to plot errorbars on traces in SF plotter
MichaelHuth Feb 10, 2026
ac9853e
fix avg bins2 mode xvalues
MichaelHuth Feb 11, 2026
b8f5520
SF: Extend xValues operation to return xValues from SF meta data if p…
MichaelHuth Feb 11, 2026
3d9be24
Add some more debug output to avg
MichaelHuth Feb 11, 2026
81611f8
SFO ivscc_apfrequency add bins2 mode
MichaelHuth Feb 11, 2026
a75c608
Util: Add function to return a non-HS color for traces
MichaelHuth Feb 16, 2026
ad44c08
ivscc_apfrequency op: use 0.2 opacity for apfrequency traces and impr…
MichaelHuth Feb 16, 2026
8929212
Util: Add utility functions IsIntegratedFitFunction and GetIntegrated…
MichaelHuth Feb 19, 2026
98437b2
SFP: Allow greater/lesser characters in strings in parser
MichaelHuth Feb 18, 2026
4219fcf
SFO: Add operation PrepareFit
MichaelHuth Feb 16, 2026
a91627d
Constants: Move some SF_OP constants to SF_OP block
MichaelHuth Feb 17, 2026
36b529e
SFO: Add operation fit2
MichaelHuth Feb 17, 2026
7602c35
f remove debug output ivscc_apfrequency
MichaelHuth Feb 18, 2026
10d95b3
f ivscc_apfrequency Use allowEmptyCode for SFE_ExecuteVariableAssignm…
MichaelHuth Feb 18, 2026
603fa8f
f Add fit to ivscc_apfrequency
MichaelHuth Feb 18, 2026
4b9f22b
f ivscc_apfrequency expose fitresult in topmost varStorage
MichaelHuth Feb 20, 2026
d59148e
JWN: Add function to return all keys at a given path
MichaelHuth Feb 20, 2026
015a268
SFO: Add operation getmeta
MichaelHuth Feb 20, 2026
13a200c
f ivscc_apfrequency move meta data to meta data JWN block
MichaelHuth Feb 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 95 additions & 36 deletions Packages/MIES/MIES_Constants.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2116,37 +2116,56 @@ StrConstant CO_DAP_DIFF_FALLBACK_NI = "DiffFallbackNI"
/// @name Constants for SweepFormula Meta data in JSON format
/// @anchor SFMetaDataConstants
///@{
StrConstant SF_META_DATATYPE = "/DataType" // string
StrConstant SF_META_SWEEPNO = "/SweepNumber" // number
StrConstant SF_META_RANGE = "/Range" // numeric wave
StrConstant SF_META_CHANNELTYPE = "/ChannelType" // number
StrConstant SF_META_CHANNELNUMBER = "/ChannelNumber" // number
StrConstant SF_META_DEVICE = "/Device" // string
StrConstant SF_META_EXPERIMENT = "/Experiment" // string
StrConstant SF_META_SWEEPMAPINDEX = "/SweepMapIndex" // number
StrConstant SF_META_ISAVERAGED = "/IsAveraged" // number
StrConstant SF_META_XVALUES = "/XValues" // numeric wave
StrConstant SF_META_XTICKLABELS = "/XTickLabels" // text wave
StrConstant SF_META_XTICKPOSITIONS = "/XTickPositions" // numeric wave
StrConstant SF_META_YTICKLABELS = "/YTickLabels" // text wave
StrConstant SF_META_YTICKPOSITIONS = "/YTickPositions" // numeric wave
StrConstant SF_META_XAXISLABEL = "/XAxisLabel" // string
StrConstant SF_META_YAXISLABEL = "/YAxisLabel" // string
StrConstant SF_META_LEGEND_LINE_PREFIX = "/LegendLinePrefix" // string
StrConstant SF_META_TAG_TEXT = "/TagText" // string
StrConstant SF_META_OPSTACK = "/OperationStack" // string
StrConstant SF_META_MOD_MARKER = "/Marker" // numeric wave (per point) or number (all points)
StrConstant SF_META_SHOW_LEGEND = "/ShowLegend" // numeric, boolean, defaults to true (1)
StrConstant SF_META_CUSTOM_LEGEND = "/CustomLegend" // string with custom legend text, honours /ShowLegend
StrConstant SF_META_ARGSETUPSTACK = "/ArgSetupStack" // string
StrConstant SF_META_TRACECOLOR = "/TraceColor" // numeric wave, applies to markers and lines
StrConstant SF_META_LINESTYLE = "/LineStyle" // number
StrConstant SF_META_TRACE_MODE = "/TraceMode" // number, one of @ref TraceDisplayTypes
StrConstant SF_META_TRACETOFRONT = "/TraceToFront" // number, boolean, defaults to false (0)
StrConstant SF_META_DONOTPLOT = "/DoNotPlot" // number, boolean, defaults to false (0)
StrConstant SF_META_WINDOW_HOOK = "/WindowHook" // string
StrConstant SF_META_FORMULA = "/Formula" // string
StrConstant SF_META_PLOT = "/Plot" // number, boolean, defaults to false (0)
StrConstant SF_META_DATATYPE = "/DataType" // string
StrConstant SF_META_SWEEPNO = "/SweepNumber" // number
StrConstant SF_META_RANGE = "/Range" // numeric wave
StrConstant SF_META_CHANNELTYPE = "/ChannelType" // number
StrConstant SF_META_CHANNELNUMBER = "/ChannelNumber" // number
StrConstant SF_META_DEVICE = "/Device" // string
StrConstant SF_META_EXPERIMENT = "/Experiment" // string
StrConstant SF_META_SWEEPMAPINDEX = "/SweepMapIndex" // number
StrConstant SF_META_ISAVERAGED = "/IsAveraged" // number
StrConstant SF_META_XVALUES = "/XValues" // numeric wave
StrConstant SF_META_XTICKLABELS = "/XTickLabels" // text wave
StrConstant SF_META_XTICKPOSITIONS = "/XTickPositions" // numeric wave
StrConstant SF_META_YTICKLABELS = "/YTickLabels" // text wave
StrConstant SF_META_YTICKPOSITIONS = "/YTickPositions" // numeric wave
StrConstant SF_META_XAXISLABEL = "/XAxisLabel" // string
StrConstant SF_META_YAXISLABEL = "/YAxisLabel" // string
StrConstant SF_META_LEGEND_LINE_PREFIX = "/LegendLinePrefix" // string
StrConstant SF_META_TAG_TEXT = "/TagText" // string
StrConstant SF_META_OPSTACK = "/OperationStack" // string
StrConstant SF_META_MOD_MARKER = "/Marker" // numeric wave (per point) or number (all points)
StrConstant SF_META_SHOW_LEGEND = "/ShowLegend" // numeric, boolean, defaults to true (1)
StrConstant SF_META_CUSTOM_LEGEND = "/CustomLegend" // string with custom legend text, honours /ShowLegend
StrConstant SF_META_ARGSETUPSTACK = "/ArgSetupStack" // string
StrConstant SF_META_TRACECOLOR = "/TraceColor" // numeric wave, applies to markers and lines
StrConstant SF_META_LINESTYLE = "/LineStyle" // number
StrConstant SF_META_TRACE_MODE = "/TraceMode" // number, one of @ref TraceDisplayTypes
StrConstant SF_META_TRACETOFRONT = "/TraceToFront" // number, boolean, defaults to false (0)
StrConstant SF_META_DONOTPLOT = "/DoNotPlot" // number, boolean, defaults to false (0)
StrConstant SF_META_WINDOW_HOOK = "/WindowHook" // string
StrConstant SF_META_FORMULA = "/Formula" // string
StrConstant SF_META_PLOT = "/Plot" // number, boolean, defaults to false (0)
StrConstant SF_META_XAXISOFFSET = "/XAxisOffset" // number
StrConstant SF_META_YAXISOFFSET = "/YAxisOffset" // number
StrConstant SF_META_XAXISPERCENT = "/XAxisPercent" // number
StrConstant SF_META_YAXISPERCENT = "/YAxisPercent" // number
StrConstant SF_META_ERRORBARYPLUS = "/ErrorYPlus" // numeric wave
StrConstant SF_META_ERRORBARYMINUS = "/ErrorYMinus" // numeric wave
StrConstant SF_META_ERRORBARXPLUS = "/ErrorXPlus" // numeric wave
StrConstant SF_META_ERRORBARXMINUS = "/ErrorXMinus" // numeric wave
StrConstant SF_META_FITCOEFS = "/FitCoefs" // numeric wave
StrConstant SF_META_FITERROR = "/FitError" // number
StrConstant SF_META_FITQUITREASON = "/FitQuitReason" // number
StrConstant SF_META_FITNUMITERS = "/FitNumIters" // number
StrConstant SF_META_FITSTATUSMESSAGE = "/FitStatusMessage" // string
StrConstant SF_META_FITWSIGMA = "/FitWSigma" // numeric wave
StrConstant SF_META_FITMCOVAR = "/FitMCovar" // numeric wave
StrConstant SF_META_FITMFITCONSTRAINT = "/FitMFitConstraint" // numeric wave
StrConstant SF_META_FITWFITCONSTRAINT = "/FitWFitConstraint" // numeric wave
StrConstant SF_META_FITCHISQUARE = "/FitChiSquare" // number
StrConstant SF_META_FITFUNC = "/FitFunc" // string

/// A color group allows to have matching colors for sweep data with the same channel type/number and sweep.
/// It is applied before the matching headstage/average colors in #SF_GetTraceColor().
Expand Down Expand Up @@ -2205,12 +2224,14 @@ StrConstant SF_DATATYPE_SELECTSETSWEEPCOUNT = "SelectSetSweepCount"
StrConstant SF_DATATYPE_SELECTSCIINDEX = "SelectSCIIndex"
StrConstant SF_DATATYPE_SELECTRACINDEX = "SelectRACIndex"
StrConstant SF_DATATYPE_ANAFUNCPARAM = "AnaFunc"
StrConstant SF_DATATYPE_PREPAREFIT = "PrepareFit"

StrConstant SF_WREF_MARKER = "\"WREF@\":"
StrConstant SF_VARIABLE_MARKER = "/SF_IsVariable" // numeric

StrConstant SF_ANNOTATION_NAME = "metadata"
StrConstant SF_VARNAME_REGEXP = "[A-Z]{1}[A-Z0-9_]*"
StrConstant SF_SERIALIZE = "/serial" // path prefix
///@}

/// @name Constants for SweepFormula Clampmode codes returned by operation selcm()
Expand Down Expand Up @@ -2442,11 +2463,6 @@ Constant PSX_DECONV_FILTER_DEF_ORDER = 4

StrConstant PSX_JWN_COMBO_KEYS_NAME = "ComboKeys"

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

StrConstant SWEEP_NOTE_KEY_ORIGCREATIONTIME_UTC = "OriginalCreationTimeInUTC"

StrConstant DF_NAME_FREE = "freeroot"
Expand Down Expand Up @@ -2552,6 +2568,14 @@ StrConstant SF_OP_TPINST = "tpinst"
StrConstant SF_OP_TPBASE = "tpbase"
StrConstant SF_OP_TPFIT = "tpfit"
StrConstant SF_OP_EXTRACT = "extract"
StrConstant SF_OP_IVSCCAPFREQUENCY = "ivscc_apfrequency"
StrConstant SF_OP_PREPAREFIT = "preparefit"
StrConstant SF_OP_MERGE = "merge"
StrConstant SF_OP_FIT = "fit"
StrConstant SF_OP_FITLINE = "fitline"
StrConstant SF_OP_DATASET = "dataset"
StrConstant SF_OP_FIT2 = "fit2"
StrConstant SF_OP_GETMETA = "getmeta"

#ifdef AUTOMATED_TESTING
StrConstant SF_OP_TESTOP = "testop"
Expand Down Expand Up @@ -2614,3 +2638,38 @@ StrConstant SF_WINNAME_SUFFIX_TABLE = "table"
Constant SF_DISPLAYTYPE_GRAPH = 0
Constant SF_DISPLAYTYPE_TABLE = 1
///@}

/// @name Maximum number of colors for traces defined
///
/// @anchor TraceColorMax
///@{
Constant TRACECOLORMAX = 21
///@}

/// @name Characters allowed in the SF PrepareFit operation to hold a coefficient
///
/// @anchor SFPrepareFitHoldStringCharacters
///@{
StrConstant SF_PREPAREFIT_HOLDCHAR_HOLD = "X"
StrConstant SF_PREPAREFIT_HOLDCHAR_FREE = "O"
///@}

/// @name Bits for Fit Errors
/// @anchor FitErrors
///@{
Constant FIT_ERROR_ANY = 1
Constant FIT_ERROR_SINGULARMATRIX = 2
Constant FIT_ERROR_OUTOFMEMORY = 4
Constant FIT_ERROR_RETURNEDNANORINF = 8
Constant FIT_ERROR_FUNCREQUESTEDSTOP = 16
Constant FIT_ERROR_REENTRANT_FIT = 32
///@}

/// @name Codes for Fit Quit Reasons
/// @anchor FitQuitReason
///@{
Constant FIT_QUITREASON_OK = 0
Constant FIT_QUITREASON_ITERATIONLIMITREACHED = 1
Constant FIT_QUITREASON_STOPPEDBYUSER = 2
Constant FIT_QUITREASON_NOCHISQUAREDECREASE = 3
///@}
14 changes: 12 additions & 2 deletions Packages/MIES/MIES_GuiUtilities.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ End
/// where the color white has been removed.
Function [STRUCT RGBColor s] GetTraceColor(variable index)

index = mod(index, 21)
index = mod(index, TRACECOLORMAX)
switch(index)
case 0:
s.red = 7967; s.green = 7710; s.blue = 7710
Expand Down Expand Up @@ -742,11 +742,21 @@ Function [STRUCT RGBColor s] GetTraceColor(variable index)
endswitch
End

/// @brief Returns the trace color used for avergae type traces
/// @brief Returns the trace color used for average type traces
Function [STRUCT RGBColor s] GetTraceColorForAverage()

[s] = GetTraceColor(NUM_HEADSTAGES + 1)
End

/// @brief Returns a color that is not attributed to a headstage and not the average color
Function [STRUCT RGBColor s] GetTraceColorNonHeadstage(variable idx)

variable range

range = TRACECOLORMAX - (NUM_HEADSTAGES + 2)
idx = mod(idx, range)

[s] = GetTraceColor(idx + NUM_HEADSTAGES + 2)
End

/// @brief Get colors from alternative color scheme
Expand Down
15 changes: 15 additions & 0 deletions Packages/MIES/MIES_JSONWaveNotes.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,18 @@ threadsafe Function/WAVE JWN_CreatePath(WAVE wv, string jsonPath)
JSON_AddTreeObject(jsonID, jsonPath)
JWN_WriteWaveNote(wv, JWN_GetWaveNoteHeader(wv), jsonID)
End

/// @brief Returns a text wave with the json keys available at path, null wave if path does not exist
///
/// @param wv wave reference where the WaveNote is taken from
/// @param jsonPath path to create as object
threadsafe Function/WAVE JWN_GetKeysAt(WAVE wv, string jsonPath)

variable jsonID

jsonID = JWN_GetWaveNoteAsJSON(wv)
WAVE/Z keys = JSON_GetKeys(jsonID, jsonPath, ignoreErr = 1)
JSON_Release(jsonID)

return keys
End
Loading
Loading