ezmsg.blackrock.nsp#

Classes

class NSPSource(*args, settings=None, **kwargs)[source]#

Bases: Unit

Parameters:

settings (Settings | None)

SETTINGS#

alias of NSPSourceSettings

STATE#

alias of NSPSourceState

OUTPUT_SPIKE = OutputStream:unlocated[<class 'ezmsg.event.message.EventMessage'>](self.num_buffers=32, self.force_tcp=False)#
OUTPUT_SIGNAL = OutputStream:unlocated[<class 'ezmsg.util.messages.axisarray.AxisArray'>](self.num_buffers=32, self.force_tcp=False)#
async initialize()[source]#

Runs when the Unit is instantiated. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

shutdown()[source]#

Runs when the Unit terminates. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

on_smp_group(pkt, grp_idx=5)[source]#
Parameters:
async update_clock()[source]#
Return type:

None

async pub_cont()[source]#
Return type:

AsyncGenerator

on_spike(spk_pkt)[source]#
Parameters:

spk_pkt (Structure)

async spikes()[source]#
Return type:

AsyncGenerator

class NSPSourceSettings(inst_addr: str = '', inst_port: int = 51001, client_addr: str = '', client_port: int = 51002, recv_bufsize: int | None = None, protocol: str = '3.11', cont_buffer_dur: float = 0.5, microvolts: bool = True, cbtime: bool = True)[source]#

Bases: Settings

Parameters:
  • inst_addr (str)

  • inst_port (int)

  • client_addr (str)

  • client_port (int)

  • recv_bufsize (int | None)

  • protocol (str)

  • cont_buffer_dur (float)

  • microvolts (bool)

  • cbtime (bool)

inst_addr: str = ''#
inst_port: int = 51001#
client_addr: str = ''#
client_port: int = 51002#
recv_bufsize: int | None = None#
protocol: str = '3.11'#
cont_buffer_dur: float = 0.5#

Duration of continuous buffer to hold recv packets. Up to ~15 MB / second.

microvolts: bool = True#

Convert continuous data to uV (True) or keep raw integers (False).

cbtime: bool = True#

Use Cerebus time for continuous data (True) or local time.time (False). Note that time.time is delayed by the network transmission latency relative to Cerebus time.

__init__(inst_addr='', inst_port=51001, client_addr='', client_port=51002, recv_bufsize=None, protocol='3.11', cont_buffer_dur=0.5, microvolts=True, cbtime=True)#
Parameters:
  • inst_addr (str)

  • inst_port (int)

  • client_addr (str)

  • client_port (int)

  • recv_bufsize (int | None)

  • protocol (str)

  • cont_buffer_dur (float)

  • microvolts (bool)

  • cbtime (bool)

Return type:

None

class NSPSourceState[source]#

Bases: State

device: NSPDevice#
spike_queue: Queue[EventMessage]#
cont_buffer = {1: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 2: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 3: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 4: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 5: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 6: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16))}#
cont_read_idx = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0}#
cont_write_idx = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0}#
template_cont = {1: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 2: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 3: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 4: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 5: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 6: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key='')}#
scale_cont = {1: array([], dtype=float64), 2: array([], dtype=float64), 3: array([], dtype=float64), 4: array([], dtype=float64), 5: array([], dtype=float64), 6: array([], dtype=float64)}#
sysfreq: int = 30000#
n_channels: int = 0#
class NSPSourceSettings(inst_addr: str = '', inst_port: int = 51001, client_addr: str = '', client_port: int = 51002, recv_bufsize: int | None = None, protocol: str = '3.11', cont_buffer_dur: float = 0.5, microvolts: bool = True, cbtime: bool = True)[source]#

Bases: Settings

Parameters:
  • inst_addr (str)

  • inst_port (int)

  • client_addr (str)

  • client_port (int)

  • recv_bufsize (int | None)

  • protocol (str)

  • cont_buffer_dur (float)

  • microvolts (bool)

  • cbtime (bool)

inst_addr: str = ''#
inst_port: int = 51001#
client_addr: str = ''#
client_port: int = 51002#
recv_bufsize: int | None = None#
protocol: str = '3.11'#
cont_buffer_dur: float = 0.5#

Duration of continuous buffer to hold recv packets. Up to ~15 MB / second.

microvolts: bool = True#

Convert continuous data to uV (True) or keep raw integers (False).

cbtime: bool = True#

Use Cerebus time for continuous data (True) or local time.time (False). Note that time.time is delayed by the network transmission latency relative to Cerebus time.

__init__(inst_addr='', inst_port=51001, client_addr='', client_port=51002, recv_bufsize=None, protocol='3.11', cont_buffer_dur=0.5, microvolts=True, cbtime=True)#
Parameters:
  • inst_addr (str)

  • inst_port (int)

  • client_addr (str)

  • client_port (int)

  • recv_bufsize (int | None)

  • protocol (str)

  • cont_buffer_dur (float)

  • microvolts (bool)

  • cbtime (bool)

Return type:

None

class NSPSourceState[source]#

Bases: State

device: NSPDevice#
spike_queue: Queue[EventMessage]#
cont_buffer = {1: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 2: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 3: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 4: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 5: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16)), 6: (array([], dtype=int64), array([], shape=(1, 0), dtype=int16))}#
cont_read_idx = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0}#
cont_write_idx = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0}#
template_cont = {1: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 2: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 3: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 4: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 5: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key=''), 6: AxisArray(data=array([], shape=(1, 0), dtype=float64), dims=['time', 'ch'], axes={}, attrs={}, key='')}#
scale_cont = {1: array([], dtype=float64), 2: array([], dtype=float64), 3: array([], dtype=float64), 4: array([], dtype=float64), 5: array([], dtype=float64), 6: array([], dtype=float64)}#
sysfreq: int = 30000#
n_channels: int = 0#
class NSPSource(*args, settings=None, **kwargs)[source]#

Bases: Unit

Parameters:

settings (Settings | None)

SETTINGS#

alias of NSPSourceSettings

STATE#

alias of NSPSourceState

OUTPUT_SPIKE = OutputStream:unlocated[<class 'ezmsg.event.message.EventMessage'>](self.num_buffers=32, self.force_tcp=False)#
OUTPUT_SIGNAL = OutputStream:unlocated[<class 'ezmsg.util.messages.axisarray.AxisArray'>](self.num_buffers=32, self.force_tcp=False)#
async initialize()[source]#

Runs when the Unit is instantiated. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

shutdown()[source]#

Runs when the Unit terminates. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

on_smp_group(pkt, grp_idx=5)[source]#
Parameters:
async update_clock()[source]#
Return type:

None

async pub_cont()[source]#
Return type:

AsyncGenerator

on_spike(spk_pkt)[source]#
Parameters:

spk_pkt (Structure)

async spikes()[source]#
Return type:

AsyncGenerator