File MIES_MiesUtilities_Recreation.ipf

This file holds MIES utility functions for sweep and config wave recreation.

Functions

variable RecreateMissingSweepAndConfigWaves(string device, dfref deviceDataDFR)

Tries to find deleted sweep and config waves which are still present due to 1D waves from databrowser backups or labnotebook entries.

The result is placed in root:reconstructed which is overwritten.

For reconstructing single sweep or config waves, see RecreateSweepWaveFromBackupAndLBN() and RecreateConfigWaveFromLBN().

Example invocation:

  • RecreateMissingSweepAndConfigWaves(“ITC18USB_DEV_0”, root:MIES:HardwareDevices:ITC18USB:Device0:Data:)

  • Inspect the results in root:reconstructed

  • If you are satisfied, move the waves from root:reconstructed into e.g. root:MIES:HardwareDevices:ITC18USB:Device0:Data:

  • Proceed with the data as usual

In case the routine throws an assertion, please open an issue so that we can investigate.

wave RecreateSweepWaveFromBackupAndLBN(wave numericalValues, WaveText textualValues, variable sweepNo, dfref deviceDataDFR)

Try recreating a WaveRef sweep wave from its databrowser backup. For a text sweep wave, call SplitSweepIntoComponents afterwards with a target DF.

Returns:

$”” if reconstruction failed or a free wave with the sweep data and correct metadata

wave RecreateConfigWaveFromLBN(string device, wave numericalValues, wave textualValues, variable sweepNo)

Try recreating the DAQ config wave from labnotebook entries.

Returns:

$"" if recreation failed or a free wave on success.

static std::tuple<WAVE, WaveRefWave> GetSingleSweepWaves(dfref singleSweepFolder, variable channelType)

Return waves with the channel numbers and references to 1D waves from the X_XXXX folders.

static variable AddToSweepWave(WaveRefWave channelWaves, wave channelNumbers, WaveRefWave sweepWave, variable indexOffset)

Add the returned 1D waves from GetSingleSweepWaves() into sweepWave. sweepWave must be WaveRef wave. The size of sweepWave is increased if required.

Returns:

index of last row filled

static variable AddChannelPropertiesFromLBN(wave numericalValues, wave textualValues, variable sweepNo, wave configWave, variable channelType)

Set ChannelNumber and ChannelType in configWave.

static variable GetSamplingIntervalFromLBN(wave numericalValues, variable sweepNo, variable channelType)

Return the sampling interval [ms] rounded to microseconds.

static variable AddDAQChannelTypeFromLBN(wave numericalValues, wave textualValues, variable sweepNo, wave configWave)

Set DAQChannelType in configWave.

static variable AddHeadstageFromLBN(wave numericalValues, variable sweepNo, wave configWave)

Set Headstage in configWave.

static variable AddClampModeFromLBN(wave numericalValues, variable sweepNo, wave configWave)

Set ClampMode in configWave.

static variable AddChannelUnitFromLBN(wave numericalValues, WaveText textualValues, variable sweepNo, wave configWave)

Add wave note entry CHANNEL_UNIT_KEY for the used channel units.