cbadc.utilities.csv_2_control_signal

cbadc.utilities.csv_2_control_signal(filename: str, M: int, msb2lsb: bool = False, separator: str = ',')[source]

Creates an iterator that reads a control sequence from a CSV file.

filenamestr

filename for input file

Mint

number of controls

msb2lsbbool

bit order of input file. Default is least significant bit (LSB) to most significant bit (MSB) from left to right.

separatorstr

separator used in the input file. Default is ` , ` (comma).

array_like, shape=(M,)

a control signal sample

0, 0, 0, 1 0, 0, 1, 1 0, 1, 1, 1”)

# read control signal from the file just created for s in csv_2_control_signal(‘test.csv’, 4, msb2lsb=True):

print(s)

[0 0 0 0] [1 0 0 0] [1 1 0 0] [1 1 1 0]

RuntimeError

for lines with number of entries different from M.