Skip to content

Commit

Permalink
Ensure APS2 files with no waveforms still have the waveform group wri…
Browse files Browse the repository at this point in the history
…tten.
  • Loading branch information
grahamrow committed Aug 17, 2018
1 parent 446ff4f commit 43fc30e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion QGL/drivers/APS2Pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,14 @@ def write_sequence_file(awgData, fileName):
chanStr = '/chan_{0}'.format(chanct + 1)
chanGroup = FID.create_group(chanStr)
#Write the waveformLib to file
FID.create_dataset(chanStr + '/waveforms', data=wfInfo[chanct][0])
if wfInfo[chanct][0].size == 0:
#If there are no waveforms, ensure that there is some element
#so that the waveform group gets written to file.
#TODO: Fix this in libaps2
data = np.array([0], dtype=np.uint16)
else:
data = wfInfo[chanct][0]
FID.create_dataset(chanStr + '/waveforms', data=data)

#Write the instructions to channel 1
if np.mod(chanct, 2) == 0:
Expand Down

0 comments on commit 43fc30e

Please sign in to comment.