File MIES_MiesUtilities_Logbook.ipf¶
This file holds MIES utility functions for working with the various Logbooks.
Functions
-
variable GetLogbookType(wave wv)¶
Return the logbook type, one of LogbookTypes.
-
wave GetLogbookWaves(variable logbookType, variable logbookWaveType, string device = defaultValue)¶
Return the logbook waves.
- Parameters:
device – [optional only for LBT_RESULTS] device
logbookType – one of LogbookTypes
logbookWaveType – one of LabnotebookWaveTypes
-
wave ExtractLogbookSliceTimeStamp(wave logbook)¶
Extract a date/time slice of the logbook wave.
-
wave ExtractLogbookSliceDeltaTime(wave logbook)¶
Extract the delta time slice of the logbook wave.
-
wave ExtractLogbookSliceSweep(wave values)¶
Extract the sweep number slice of the labnotebook values wave.
-
wave ExtractLogbookSliceEmpty(wave values)¶
Extract a slice of the logbook wave and makes it empty.
-
static wave ExtractLogbookSlice(wave logbook, variable logbookType, variable colOrLayer, string suffix)¶
Extract a single column/layer of the labnotebook/TPStorage values wave.
This is useful if you want to plot values against e.g time and let Igor do the formatting of the date/time values. Always returns a numerical wave.
The slice is returned as-is if it exists already. Callers which modify the logbook are responsible to resize the slice as well.
-
static std::tuple<WaveOrNull, variable> GetLastSettingChannelInternal(wave numericalValues, wave values, variable sweepNo, string setting, variable channelNumber, variable channelType, variable entrySourceType)¶
Return a numerical/textual setting for the given channel.
The function takes care of associated/unassociated channel properties and all other internals.
See also
- Parameters:
numericalValues – numerical labnotebook
values – labnotebook to read data from, either numerical or textual
sweepNo – sweep number
setting – name of the labnotebook entry to search
channelNumber – channel number
channelType – channel type, one of XopChannelConstants
entrySourceType – type of the labnotebook entry, one of DataAcqModes. If you don’t care about the entry source type pass UNKNOWN_MODE.
- Returns:
A tuple of the result wave and the index into it.
-
static variable GetLogbookSettingsColumn(wave values, string key)¶
-
std::tuple<WAVE, variable> GetNonEmptyLBNRows(wave labnotebookValues, string setting)¶
Return a wave with all labnotebook rows which have a non-empty entry for setting.
-
static variable EnforceIndependentSetting(wave settings)¶
Test helper to enforce that every query done for an INDEP_HEADSTAGE setting does not search an entry which is HEADSTAGE dependent. The additional check that not all entries are the same is for really old legacy entries which are INDEP but set for all headstages.
Does nothing outside of CI.
-
static variable FindRange(wave wv, variable col, variable val, variable entrySourceType, variable *first, variable *last)¶
Find the first and last point index of a consecutive range of values in the labnotebook, searches the range from the back.
- Parameters:
wv – [in] wave to search
col – [in] column to look for
val – [in] value to search
entrySourceType – [in] type of the labnotebook entry, one of DataAcqModes
first – [out] point index of the beginning of the range
last – [out] point index of the end of the range
-
variable GetSweepColumn(wave labnotebookValues)¶
Returns the numerical index for the sweep number column in the settings history waves (numeric and text)
-
wave GetUniqueSettings(wave values, string setting)¶
Return a unique list of labnotebook entries of the given setting.
- Parameters:
values – numerical logbook wave
setting – name of the value to search
-
variable GetIndexForHeadstageIndepData(wave values)¶
Return the index for headstage independent data.
Before dfe2d862 (Make the function AB_SplitTTLWaveIntoComponents available for all, 2015-10-07) we stored headstage independent data in either all entries or only the first one. Since that commit we store the data in
INDEP_HEADSTAGE
.
-
string CreateLBNUnassocKey(string setting, variable channelNumber, variable channelType)¶
Create a labnotebook key for unassociated channels.
We support two types of unassociated keys. Old style, prior to 403c8ec2 (Merge pull request #370 from AllenInstitute/feature/sweepformula_enable, 2019-11-13) but after its introduction in ad8dc8ec (Allow AD/DA channels not associated with a headstage again, 2015-10-22) are written as “$Name UNASSOC_$ChannelNumber”.
New style have the format “$Name u_(AD|DA)$ChannelNumber”, these include the channel type to make them more self explaining.
-
string CreateTTLChannelLBNKey(string entry, variable channelNumber)¶
Create a LBN key for TTL channels.
-
variable IsUnassocLBNKey(string name)¶
Check if the given labnotebook entry is from an unassociated DA/AD channel.
-
string RemoveUnassocLBNKeySuffix(string name)¶
Remove the unassociated, old and new, prefix of the given labnotebook entry name.
See also
-
variable EntrySourceTypeMapper(variable entrySourceType)¶
Maps the labnotebook entry source type, one of DataAcqModes, to a valid wave index.
UTF_NOINSTRUMENTATION
-
variable ReverseEntrySourceTypeMapper(variable mapped)¶
Rerverse the effect of EntrySourceTypeMapper()
UTF_NOINSTRUMENTATION
-
string CreateAnaFuncLBNKey(variable type, string formatString, variable chunk = defaultValue, variable query = defaultValue, variable waMode = defaultValue)¶
Return labnotebook keys for patch seq analysis functions.
- Parameters:
type – One of SpecialAnalysisFunctionTypes
formatString – One of PatchSeqLabnotebookFormatStrings or MultiPatchSeqLabnotebookFormatStrings
chunk – [optional] Some format strings expect a chunk number
query – [optional, defaults to false] If the key is to be used for setting or querying the labnotebook
waMode – [optional, defaults to PSQ_LBN_WA_NONE] One of LBNWorkAroundFlags
-
variable SetAnalysisFunctionVersion(string device, variable type, variable headstage, variable sweepNo)¶
Add a labnotebook entry denoting the analysis function version.
-
variable GetHeadstageForChannel(wave numericalValues, variable sweep, variable channelType, variable channelNumber, variable entrySourceType)¶
Returns the active headstage for a given sweep, channelType, channelNumber from the LBN.
- Parameters:
numericalValues – LBN wave with numerical values
sweep – sweep number
channelType – channel type number
channelNumber – channel number
entrySourceType – type of the labnotebook entry, one of DataAcqModes
- Returns:
headstage number or NaN if no headstage was found
-
wave GetTTLLabnotebookEntry(WaveText textualValues, string name, variable sweep)¶
Return a list of TTL stimsets which are indexed by DAEphys TTL channels.
The indexing here is hardware independent. For ITC hardware the assertion “log(ttlBit)/log(2) == DAEphys TTL channel” holds.
- Parameters:
textualValues – Text labnotebook values
name – One of LabnotebookTTLNames
sweep – Sweep number
-
variable GetTotalOnsetDelayFromDevice(string device)¶
Return the total onset delay from the given device during DAQ.
UTF_NOINSTRUMENTATION
See also
-
std::tuple<variable, variable, variable> GetAnalysisFunctionType(wave numericalValues, WaveText textualValues, variable sweepNo, variable channelNumber, variable channelType)¶
Retrieve the analysis function that was run for a given sweep / channelNumber / channelType.
- Parameters:
numericalValues – numerical labnotebook
textualValues – textual labnotebook
sweepNo – sweep number
channelNumber – channel number
channelType – channelType
- Return values:
type – analysis function type SpecialAnalysisFunctionTypes
waMode – bit-mask of possible workarounds for CreateAnaFuncLBNKey()
headstage – headstage where the analysis function was run on
-
variable ParseLogbookMode(string modeText)¶
-
string StringifyLogbookMode(variable mode)¶
Variables
-
static const double GET_LB_MODE_NONE = 0¶
-
static const double GET_LB_MODE_READ = 1¶
-
static const double GET_LB_MODE_WRITE = 2¶
-
static const string LBN_UNASSOC_REGEXP_LEGACY = "^(.*) UNASSOC_[[:digit:]]+$"¶
-
static const string LBN_UNASSOC_REGEXP = "^(.*) u_(AD|DA)[[:digit:]]+$"¶
-
static const string PSQ_PB_LBN_PREFIX = "Pipette in Bath"¶
-
static const string PSQ_CR_LBN_PREFIX = "Chirp"¶
-
static const string PSQ_SP_LBN_PREFIX = "Squ. Pul."¶
-
static const string PSQ_DS_LBN_PREFIX = "DA Scale"¶
-
static const string PSQ_RB_LBN_PREFIX = "Rheobase"¶
-
static const string PSQ_RA_LBN_PREFIX = "Ramp"¶
-
static const string PSQ_SE_LBN_PREFIX = "Seal evaluation"¶
-
static const string PSQ_VM_LBN_PREFIX = "True Rest Memb."¶
-
static const string PSQ_AR_LBN_PREFIX = "Access Res. Smoke"¶
-
static const string MSQ_FRE_LBN_PREFIX = "F Rheo E"¶
-
static const string MSQ_DS_LBN_PREFIX = "Da Scale"¶
-
static const string MSQ_SC_LBN_PREFIX = "Spike Control"¶