MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / get_sampling_rate

Method get_sampling_rate

python_package/brainflow/board_shim.py:684–700  ·  view source on GitHub ↗

get sampling rate for a board :param board_id: Board Id :type board_id: int :param preset: preset :type preset: int :return: sampling rate for this board id :rtype: int :raises BrainFlowError: If this board has no such data exit code is UNSUPP

(cls, board_id: int, preset: int = BrainFlowPresets.DEFAULT_PRESET)

Source from the content-addressed store, hash-verified

682
683 @classmethod
684 def get_sampling_rate(cls, board_id: int, preset: int = BrainFlowPresets.DEFAULT_PRESET) -> int:
685 """get sampling rate for a board
686
687 :param board_id: Board Id
688 :type board_id: int
689 :param preset: preset
690 :type preset: int
691 :return: sampling rate for this board id
692 :rtype: int
693 :raises BrainFlowError: If this board has no such data exit code is UNSUPPORTED_BOARD_ERROR
694 """
695
696 sampling_rate = numpy.zeros(1).astype(numpy.int32)
697 res = BoardControllerDLL.get_instance().get_sampling_rate(board_id, preset, sampling_rate)
698 if res != BrainFlowExitCodes.STATUS_OK.value:
699 raise BrainFlowError('unable to request info about this board', res)
700 return int(sampling_rate[0])
701
702 @classmethod
703 def get_package_num_channel(cls, board_id: int, preset: int = BrainFlowPresets.DEFAULT_PRESET) -> int:

Callers

nothing calls this directly

Calls 3

BrainFlowErrorClass · 0.90
get_sampling_rateMethod · 0.65
get_instanceMethod · 0.45

Tested by

no test coverage detected