@@ -1250,7 +1250,8 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s)
12501250 params. samplingRate = ConvertSamplingIntervalToRate ( GetSamplingInterval ( s. DAQConfigWave, params. channelType)) * KILO_TO_ONE
12511251 col = AFH_GetDAQDataColumn ( s. DAQConfigWave, params. channelNumber, params. channelType)
12521252 writtenDataColumns[ col] = 1
1253- WAVE params. data = GetDAQDataSingleColumnWaveNG ( s. numericalValues, s. textualValues, s. sweep, sweepDFR, params. channelType, params. channelNumber)
1253+ WAVE /Z params. data = GetDAQDataSingleColumnWaveNG ( s. numericalValues, s. textualValues, s. sweep, sweepDFR, params. channelType, params. channelNumber)
1254+ ASSERT_TS ( WaveExists ( params. data) , "Missing AD data for channel " + num2str ( adc) + " of headstage " + num2str ( i ) + "." )
12541255 NWB_GetTimeSeriesProperties ( s. nwbVersion, s. numericalKeys, s. numericalValues, params, tsp)
12551256 params. groupIndex = IsFinite ( params. groupIndex) ? params. groupIndex : GetNextFreeGroupIndex ( s. locationID, path)
12561257 WriteSingleChannel ( s. locationID, path, s. nwbVersion, params, tsp, compressionMode = s. compressionMode)
@@ -1263,7 +1264,8 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s)
12631264 params. samplingRate = ConvertSamplingIntervalToRate ( GetSamplingInterval ( s. DAQConfigWave, params. channelType)) * KILO_TO_ONE
12641265 col = AFH_GetDAQDataColumn ( s. DAQConfigWave, params. channelNumber, params. channelType)
12651266 writtenDataColumns[ col] = 1
1266- WAVE params. data = GetDAQDataSingleColumnWaveNG ( s. numericalValues, s. textualValues, s. sweep, sweepDFR, params. channelType, params. channelNumber)
1267+ WAVE /Z params. data = GetDAQDataSingleColumnWaveNG ( s. numericalValues, s. textualValues, s. sweep, sweepDFR, params. channelType, params. channelNumber)
1268+ ASSERT_TS ( WaveExists ( params. data) , "Missing DA data for channel " + num2str ( dac) + " of headstage " + num2str ( i ) + "." )
12671269 NWB_GetTimeSeriesProperties ( s. nwbVersion, s. numericalKeys, s. numericalValues, params, tsp)
12681270 params. groupIndex = IsFinite ( params. groupIndex) ? params. groupIndex : GetNextFreeGroupIndex ( s. locationID, path)
12691271 WAVE /Z/ T params. epochs = EP_FetchEpochs_TS ( s. numericalValues, s. textualValues, s. sweep, params. channelNumber, params. channelType)
@@ -1308,7 +1310,8 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s)
13081310
13091311 NWB_GetTimeSeriesProperties ( s. nwbVersion, s. numericalKeys, s. numericalValues, params, tsp)
13101312 params. groupIndex = IsFinite ( params. groupIndex) ? params. groupIndex : GetNextFreeGroupIndex ( s. locationID, path)
1311- WAVE params. data = GetDAQDataSingleColumnWaveNG ( s. numericalValues, s. textualValues, s. sweep, sweepDFR, params. channelType, i )
1313+ WAVE /Z params. data = GetDAQDataSingleColumnWaveNG ( s. numericalValues, s. textualValues, s. sweep, sweepDFR, params. channelType, i )
1314+ ASSERT_TS ( WaveExists ( params. data) , "Missing TTL data for channel " + num2str ( i ) + "." )
13121315 WAVE /Z/ T params. epochs = EP_FetchEpochs_TS ( s. numericalValues, s. textualValues, s. sweep, i , params. channelType)
13131316
13141317 s. locationID = WriteSingleChannel ( s. locationID, path, s. nwbVersion, params, tsp, compressionMode = s. compressionMode, nwbFilePath = s. nwbFilePath)
0 commit comments