LArPix IO

class larpix.io.IO[source]

Base class for IO objects that explicitly describes the necessary functions required by any IO class implementation. Additional functions are not used by the larpix core classes.

__init__()[source]

Declaration of IO object

Variables:is_listening – flag for start_listening and stop_listening commands
classmethod encode(packets)[source]

Encodes a list of packets into a list of IO message objects

Parameters:packetslist of larpix Packet objects to encode into IO messages
Returns:list of IO messages
classmethod decode(msgs)[source]

Decodes a list of IO message objects into respective larpix Packet objects

Parameters:msgslist of IO messages
Returns:list of larpix Packet objects
classmethod is_valid_chip_key(key)[source]

Check if provided key is valid for IO implementation. Chip key should be an immutable python type and not tuple

Parameters:key – key to check validity
Returns:True if valid key
classmethod parse_chip_key(key)[source]

Translate a chip key into a dict of contained information

Parameters:key – chip key to parse
Returns:dict of IO information contained in key
classmethod generate_chip_key(**kwargs)[source]

Create a chip key based on supplied info, raise an error if not enough information is provided

Returns:chip key of an immutable python type and not tuple
send(packets)[source]

Function for sending larpix packet objects

Parameters:packetslist of larpix Packet objects to send via IO
Returns:None
start_listening()[source]

Function for starting read communications on IO

Returns:None
stop_listening()[source]

Function for halting read communications on IO

Returns:None
empty_queue()[source]

Read and remove the current items in the internal queue. The details of the queue implementation is left up to the specific IO class. Generally returns all packets that have been read since last call to start_listening or empty_queue, whichever was most recent.

Returns:tuple of (list of Packet objects, raw bytestream)

Implementations

Here is the documentation for various implemented IO classes.

Index