File MIES_Epochs.ipf¶
EP Handle code relating to epoch information
Functions
-
variable EP_ClearEpochs(string device)¶
Clear the list of epochs.
-
variable EP_CollectEpochInfo(string device, DataConfigurationResult *s)¶
Fill the epoch wave with epochs before DAQ/TP.
- Parameters:
device – device
s – struct holding all input
-
static variable EP_CollectEpochInfoDA(string device, DataConfigurationResult *s)¶
-
static variable EP_CollectEpochInfoTTL(string device, DataConfigurationResult *s)¶
-
static variable EP_AddEpochsFromTP(string device, variable channel, variable baselinefrac, variable testPulseLength, variable offset, variable amplitude)¶
Adds four epochs for a test pulse and three sub epochs for test pulse components.
- Parameters:
device – [in] title of device panel
channel – [in] number of DA channel
baselinefrac – [in] base line fraction of testpulse
testPulseLength – [in] test pulse length in micro seconds
offset – [in] start time of test pulse in micro seconds
amplitude – [in] amplitude of the TP in the DA wave without gain
-
static variable EP_AddEpochsFromOodDAQRegions(string device, variable channel, string oodDAQRegions, variable stimsetBegin, variable stimsetEnd)¶
Adds epochs for oodDAQ regions.
- Parameters:
device – [in] title of device panel
channel – [in] number of DA channel
oodDAQRegions – [in] string containing list of oodDAQ regions as d-d;…
stimsetBegin – [in] offset time in micro seconds where stim set begins
stimsetEnd – [in] offset time in micro seconds where stim set ends
-
static variable EP_AddEpochsFromStimSetNote(string device, variable channel, variable channelType, wave stimset, variable stimsetBegin, variable setLength, variable sweep, variable scale)¶
Adds epochs for a stimset and sub epochs for stimset components currently adds also sub sub epochs for pulse train components.
- Parameters:
device – [in] title of device panel
channel – [in] number of DA or TTL channel
channelType – [in] type of channel
stimset – [in] stimset wave
stimsetBegin – [in] offset time in micro seconds where stim set begins
setLength – [in] length of stimset in micro seconds
sweep – [in] number of sweep
scale – [in] scale factor between the stimsets internal amplitude to the DA wave without gain
-
static variable EP_SortEpochs(string device)¶
Sorts all epochs per channel number / channel type in EpochsWave.
Removes epochs marked for removal, those with NaN as StartTime and EndTime, as well.
Sorting:
Ascending starting time
Descending ending time
Ascending tree level
- Parameters:
device – [in] title of device panel
-
static variable EP_GetEpochCount(WaveText epochWave, variable channel, variable channelType)¶
Returns the number of epoch in the epochsWave for the given channel.
- Parameters:
epochWave – [in] wave with epoch info
channel – [in] number of DA/TTL channel
channelType – [in] type of channel (DA or TTL)
- Returns:
number of epochs for channel
-
variable EP_AddUserEpoch(string device, variable channelType, variable channelNumber, variable epBegin, variable epEnd, string tags, string shortName = defaultValue)¶
Add user epochs.
Allows to add user epochs for not yet finished sweeps. The tree level is fixed to EPOCH_USER_LEVEL to not collide with stock entries.
- Parameters:
device – device
channelType – channel type, currently only XOP_CHANNEL_TYPE_DAC and XOP_CHANNEL_TYPE_TTL is supported
channelNumber – channel number
epBegin – start time of the epoch in seconds
epEnd – end time of the epoch in seconds
tags – tags for the epoch
shortName – [optional, defaults to auto-generated] user defined short name for the epoch, will be prefixed with EPOCH_SHORTNAME_USER_PREFIX
-
static variable EP_AddEpoch(string device, variable channel, variable channelType, variable epBegin, variable epEnd, string epTags, string epShortName, variable level, variable lowerlimit = defaultValue, variable upperlimit = defaultValue)¶
Adds a epoch to the epochsWave.
- Parameters:
device – [in] title of device panel
channel – [in] number of DA/TTL channel
channelType – [in] type of channel (either DA or TTL)
epBegin – [in] start time of the epoch in micro seconds
epEnd – [in] end time of the epoch in micro seconds
epTags – [in] tags of the epoch
epShortName – [in] short name of the epoch, should be unique
level – [in] level of epoch
lowerlimit – [in] [optional, default = -Inf] epBegin is limited between lowerlimit and Inf, epEnd must be > this limit
upperlimit – [in] [optional, default = Inf] epEnd is limited between -Inf and upperlimit, epBegin must be < this limit
-
variable EP_WriteEpochInfoIntoSweepSettings(string device, wave sweepWave, wave configWave)¶
Write the epoch info into the sweep settings wave.
- Parameters:
device – device
sweepWave – sweep wave
configWave – config wave
-
string EP_EpochWaveToStr(wave epochsWave, variable channel, variable channelType)¶
Convert the epochs wave layer given by
channel
andchannelType
to a string suitable for storing the labnotebook.- Parameters:
epochsWave – wave with epoch information
channel – DA/TTL channel number
channelType – channel type (DA or TTL)
-
wave EP_EpochStrToWave(string epochStr)¶
Converts a string containing epoch information in the format that is stored in the Labnotebook to a 2D epoch wave.
See also
- Parameters:
epochStr – [in] string with epoch information in the format as stored in the labnotebook
- Returns:
2D text wave with epoch information, use EPOCH_COL_ constants for column access
-
string EP_GetShortName(string name)¶
Returns the ShortName from a epoch name string, empty string if no ShortName is present.
-
string EP_RemoveShortNameFromTags(string tags)¶
-
static variable EP_AdaptEpochInfo(string device, wave configWave, variable acquiredTime, variable plannedTime)¶
Adapt epoch information.
Adjust epoch end time to the acquired time
Blanks out which are then too small or lie outside the acquired region
Add an unacquired epoch
- Parameters:
device – device
configWave – DAQ config wave
acquiredTime – Last acquired time point [s]
plannedTime – Last time point in the sweep [s]
-
static variable EP_AdaptEpochInfoChannel(string device, variable channelNumber, variable channelType, variable acquiredTime, variable plannedTime)¶
-
wave EP_GetEpochs(wave numericalValues, wave textualValues, variable sweepNo, variable channelType, variable channelNumber, string shortname, variable treelevel = defaultValue, WaveText epochsWave = defaultValue)¶
Get epochs from the LBN filtered by given parameters.
See also
XopChannelConstants
- Parameters:
numericalValues – Numerical values from the labnotebook
textualValues – Textual values from the labnotebook
sweepNo – Number of sweep
channelType – type of channel
channelNumber – GUI channel number
shortname – short name filter, can be a regular expression which is matched caseless. For older tag formats it can be a simple tag entry (or regexp).
treelevel – [optional: default = not set] tree level of epochs, if not set then treelevel is ignored
epochsWave – [optional: defaults to $””] when passed, gathers epoch information from this wave directly. This is required for callers who want to read epochs during MID_SWEEP_EVENT in analysis functions.
- Returns:
Text wave with epoch information, only rows fitting the input parameters are returned. Can also be a null wave.
-
wave EP_FetchEpochs(wave numericalValues, WaveTextOrNull textualValues, variable sweep, variable channelNumber, variable channelType)¶
Return free text wave with the epoch information of the given channel.
See also
XopChannelConstants
- Parameters:
numericalValues – Numerical values from the labnotebook
textualValues – Textual values from the labnotebook
sweep – Number of sweep
channelNumber – GUI channel number
channelType – Type of channel
- Returns:
epochs wave, see GetEpochsWave() for the wave layout
-
variable EP_CopyLBNEpochsToEpochsWave(string device, variable sweepNo)¶
Append epoch information from the labnotebook to the newly cleared epoch wave.
-
static wave EP_GetGaps(wave numericalValues, wave textualValues, variable sweepNo, variable channelType, variable channelNumber)¶
Helper function that returns (unintended) gaps between epochs.
-
wave EP_GetNextEpoch(wave numericalValues, wave textualValues, variable sweepNo, variable channelType, variable channelNumber, string shortname, variable treelevel, variable ignoreGaps = defaultValue)¶
Returns the following epoch of a given epoch name in a specified tree level.
-
variable EP_GetEpochAmplitude(string epochTag)¶
returns the Amplitude value from the epoch tag data
Variables
-
static const string EPOCH_SHORTNAME_KEY = "ShortName"¶
-
static const string EPOCH_TYPE_KEY = "Type"¶
-
static const string EPOCH_SUBTYPE_KEY = "SubType"¶
-
static const string EPOCH_AMPLITUDE_KEY = "Amplitude"¶
-
static const string EPOCH_PULSE_KEY = "Pulse"¶
-
static const string EPOCH_CYCLE_KEY = "Cycle"¶
-
static const string EPOCH_INCOMPLETE_CYCLE_KEY = "Incomplete Cycle"¶
-
static const string EPOCH_HALF_CYCLE_KEY = "Half Cycle"¶
-
static const string EPOCHNAME_SEP = ";"¶
-
static const string STIMSETKEYNAME_SEP = "="¶
-
static const string SHORTNAMEKEY_SEP = "="¶
-
static const string EPOCH_SN_BL_TOTALONSETDELAY = "B0_TO"¶
-
static const string EPOCH_SN_BL_ONSETDELAYUSER = "B0_OD"¶
-
static const string EPOCH_SN_BL_DDAQ = "B0_DD"¶
-
static const string EPOCH_SN_BL_TERMINATIONDELAY = "B0_TD"¶
-
static const string EPOCH_SN_BL_UNASSOC_NOTP_BASELINE = "B0_TP"¶
-
static const string EPOCH_SN_BL_DDAQOPT = "B0_DO"¶
-
static const string EPOCH_SN_BL_GENERALTRAIL = "B0_TR"¶
-
static const string EPOCH_SN_TP = "TP"¶
-
static const string EPOCH_SN_TP_PULSE = "TP_P"¶
-
static const string EPOCH_SN_TP_BLFRONT = "TP_B0"¶
-
static const string EPOCH_SN_TP_BLBACK = "TP_B1"¶
-
static const string EPOCH_SN_OODAQ = "OD"¶
-
static const string EPOCH_SN_STIMSET = "ST"¶
-
static const string EPOCH_SN_STIMSETBLTRAIL = "B"¶
-
static const string EPOCH_SN_EPOCH = "E"¶
-
static const string EPOCH_SN_PULSETRAIN = "PT"¶
-
static const string EPOCH_SN_PULSETRAIN_FULLPULSE = "P"¶
-
static const string EPOCH_SN_PULSETRAIN_PULSEAMP = "P"¶
-
static const string EPOCH_SN_PULSETRAIN_PULSEBASE = "B"¶
-
static const string EPOCH_SN_PULSETRAIN_PULSEBASETRAIL = "BT"¶
-
static const string EPOCH_SN_PULSETRAINBASETRAIL = "BT"¶
-
static const string EPOCH_SN_TRIG = "TG"¶
-
static const string EPOCH_SN_TRIG_CYCLE = "C"¶
-
static const string EPOCH_SN_TRIG_CYCLE_INCOMPLETE = "I"¶
-
static const string EPOCH_SN_TRIG_HALF_CYCLE = "H"¶
-
static const string EPOCH_SN_UNACQUIRED = "UA"¶
-
static const double EPOCH_GAPS_WORKAROUND = 0¶