Export sweep traces #1047
-
Hello, I have a question regarding the function export traces. There is a way to have correlative sweeps for each AD channel in one folder? Instead to have a folder for each sweep and inside the sweeps AD0, AD1, etc. If not, which could be an easy alternative. For example, concatenation? Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Sorry for the late reply. There are multiple ways to get the sweep data. The most prominent are:
|
Beta Was this translation helpful? Give feedback.
-
And here is a complete example to get you started. Function GatherData(string device, variable sweepNo)
variable i, j, numChannels, numEntries, channelType
WAVE/Z sweepWave = GetSweepWave(device, sweepNo)
if(!WaveExists(sweepWave))
return NaN
endif
WAVE configWave = GetConfigWave(sweepWave)
// regenerate the splitted 1D waves
// we don't want to assume that the databrowser was used
WAVE numericalValues = GetLBNumericalValues(device)
DFREF deviceDataDFR = GetDeviceDataPath(device)
DFREF singleSweepDFR = GetSingleSweepFolder(deviceDataDFR, sweepNo)
KillOrMoveToTrash(dfr = singleSweepDFR)
DFREF singleSweepDFR = GetSingleSweepFolder(deviceDataDFR, sweepNo)
SplitSweepIntoComponents(numericalValues, sweepNo, sweepWave, configWave, TTL_RESCALE_ON, targetDFR = singleSweepDFR)
Make/FREE channelTypes = {XOP_CHANNEL_TYPE_DAC, XOP_CHANNEL_TYPE_ADC, XOP_CHANNEL_TYPE_TTL}
numChannels = DimSize(channelTypes, ROWS)
for(i = 0; i < numChannels; i += 1)
channelType = channelTypes[i]
WAVE/WAVE singleColumnWaves = GetDAQDataSingleColumnWaves(singleSweepDFR, channelType)
numEntries = DimSize(singleColumnWaves, ROWS)
for(j = 0; j < numEntries; j += 1)
WAVE/Z data = singleColumnWaves[j]
if(!WaveExists(data))
continue
endif
printf "Sweep data for channel %s%d exists\r", StringFromList(channelType, XOP_CHANNEL_NAMES), j
// TODO add code here to work with data
endfor
endfor
End Calling this with one sweep acquired and one active headstage gives:
|
Beta Was this translation helpful? Give feedback.
And here is a complete example to get you started.