18#include <pybind11/numpy.h>
19#include <pybind11/pybind11.h>
20#include <pybind11/stl.h>
24namespace py = pybind11;
30 uint64_t* data =
static_cast<uint64_t*
>(frag.
get_data());
33 for (
size_t i(0); i<data_size; ++i) {
34 fmt::print(
"{:06d} 0x{:016x}\n", i, data[i]);
103 extern uint32_t
get_n_frames(daqdataformats::Fragment
const& frag);
104 extern py::array_t<uint16_t>
np_array_adc(daqdataformats::Fragment
const& frag);
106 extern py::array_t<long double>
np_array_timestamp(daqdataformats::Fragment
const& frag);
119 py::module_ wib_module = m.def_submodule(
"wib");
125 py::module_ wib2_module = m.def_submodule(
"wib2");
132 py::module_ wibeth_module = m.def_submodule(
"wibeth");
139 py::module_ daphne_module = m.def_submodule(
"daphne");
156 py::module_ daphneeth_module = m.def_submodule(
"daphneeth");
173 py::module_ tde_module = m.def_submodule(
"tde");
dict unpack(dict j, str block)
py::array_t< uint16_t > np_array_adc_stream(daqdataformats::Fragment &frag)
Unpacks a Fragment containing DAPHNEStreamFrames into a numpy array with the ADC values and dimensi...
py::array_t< uint8_t > np_array_channels_stream(daqdataformats::Fragment &frag)
Unpacks channel numbers for Fragment that contains DAPHNEStreamFrames into a numpy array with dimensi...
py::array_t< uint64_t > np_array_timestamp_stream_data(void *data, int nframes)
Unpacks data containing DAPHNEStreamFrames into a numpy array with the timestamps with dimension (n...
py::array_t< uint16_t > np_array_adc_stream_data(void *data, int nframes)
Unpacks data containing DAPHNEStreamFrames into a numpy array with the ADC values and dimension (nu...
py::array_t< uint64_t > np_array_timestamp_stream(daqdataformats::Fragment &frag)
Unpacks the timestamps in a Fragment containing DAPHNEStreamFrames into a numpy array with dimensio...
uint32_t get_n_frames(daqdataformats::Fragment const &frag)
Gets number of DAPHNEFrames in a fragment
py::array_t< uint8_t > np_array_channels_data(void *data, int nframes)
Unpacks channel numbers for DAPHNEFrames into a numpy array with dimensions (nframes)
uint32_t get_n_frames_stream(daqdataformats::Fragment const &frag)
Gets number of DAPHNEStreamFrames in a fragment
py::array_t< uint8_t > np_array_channels_stream_data(void *data, int nframes)
Unpacks channel numbers for DAPHNEStreamFrames into a numpy array with dimensions (nframes,...
py::array_t< uint8_t > np_array_channels(daqdataformats::Fragment &frag)
Unpacks channel numbers for Fragment that contains DAPHNEFrames into a numpy array with dimensions
py::array_t< uint64_t > np_array_timestamp_data(void *data, int nframes)
Unpacks data containing DAPHNEFrames into a numpy array with the timestamps with dimension (number of...
py::array_t< uint64_t > np_array_timestamp(daqdataformats::Fragment &frag)
Unpacks the timestamps in a Fragment containing WIBFrames into a numpy array with dimension (number o...
py::array_t< uint16_t > np_array_adc(daqdataformats::Fragment &frag)
Unpacks a Fragment containing DAPHNEFrames into a numpy array with the ADC values and dimension (numb...
py::array_t< uint16_t > np_array_adc_data(void *data, int nframes)
Unpacks data containing DAPHNEFrames into a numpy array with the ADC values and dimension (number of ...
py::array_t< uint16_t > np_array_adc_stream(daqdataformats::Fragment &frag)
Unpacks a Fragment containing DAPHNEStreamFrames into a numpy array with the ADC values and dimensi...
uint32_t get_n_frames(daqdataformats::Fragment const &frag)
Gets number of DAPHNEFrames in a fragment
py::array_t< uint64_t > np_array_timestamp(daqdataformats::Fragment &frag)
Unpacks the timestamps in a Fragment containing WIBFrames into a numpy array with dimension (number o...
py::array_t< uint8_t > np_array_channels_data(void *data, int nframes)
Unpacks channel numbers for DAPHNEFrames into a numpy array with dimensions (nframes)
py::array_t< uint8_t > np_array_channels(daqdataformats::Fragment &frag)
Unpacks channel numbers for Fragment that contains DAPHNEFrames into a numpy array with dimensions
uint32_t get_n_frames_stream(daqdataformats::Fragment const &frag)
Gets number of DAPHNEStreamFrames in a fragment
py::array_t< uint64_t > np_array_timestamp_data(void *data, int nframes)
Unpacks data containing DAPHNEFrames into a numpy array with the timestamps with dimension (number of...
py::array_t< uint16_t > np_array_adc_stream_data(void *data, int nframes)
Unpacks data containing DAPHNEStreamFrames into a numpy array with the ADC values and dimension (nu...
py::array_t< uint8_t > np_array_channels_stream(daqdataformats::Fragment &frag)
Unpacks channel numbers for Fragment that contains DAPHNEStreamFrames into a numpy array with dimensi...
py::array_t< uint16_t > np_array_adc_data(void *data, int nframes)
Unpacks data containing DAPHNEFrames into a numpy array with the ADC values and dimension (number of ...
py::array_t< uint16_t > np_array_adc(daqdataformats::Fragment &frag)
Unpacks a Fragment containing DAPHNEFrames into a numpy array with the ADC values and dimension (numb...
py::array_t< uint8_t > np_array_channels_stream_data(void *data, int nframes)
Unpacks channel numbers for DAPHNEEthStreamFrames into a numpy array with dimensions (nframes,...
py::array_t< uint64_t > np_array_timestamp_stream_data(void *data, int nframes)
Unpacks data containing DAPHNEStreamFrames into a numpy array with the timestamps with dimension (n...
py::array_t< uint64_t > np_array_timestamp_stream(daqdataformats::Fragment &frag)
Unpacks the timestamps in a Fragment containing DAPHNEStreamFrames into a numpy array with dimensio...
py::array_t< uint16_t > np_array_adc(daqdataformats::Fragment const &frag)
Unpacks a Fragment containing TDEEthFrames into a numpy array with the ADC values and dimension (numb...
py::array_t< long double > np_array_timestamp(daqdataformats::Fragment const &frag)
Unpacks the timestamps in a Fragment containing TDEEthFrames into a numpy array with dimension (numbe...
py::array_t< long double > np_array_timestamp_data(void *data, uint32_t n_frames)
Unpacks data containing TDEEthFrames into a numpy array with the timestamps with dimension (number of...
uint32_t get_n_frames(daqdataformats::Fragment const &frag)
Gets number of TDEEthFrames in a fragment.
py::array_t< uint16_t > np_array_adc_data(void *data, uint32_t n_frames)
Unpacks data containing TDEEthFrames into a numpy array with the ADC values and dimension (number of ...
void register_unpack(py::module &)
py::array_t< uint16_t > np_array_adc_data(void *data, int nframes)
Unpacks data containing WIB2Frames into a numpy array with the ADC values and dimension (number of WI...
py::array_t< uint64_t > np_array_timestamp(daqdataformats::Fragment const &frag)
Unpacks the timestamps in a Fragment containing WIBFrames into a numpy array with dimension (number o...
py::array_t< uint16_t > np_array_adc(daqdataformats::Fragment const &frag)
Unpacks a Fragment containing WIB2Frames into a numpy array with the ADC values and dimension (number...
py::array_t< uint64_t > np_array_timestamp_data(void *data, int nframes)
Unpacks data containing WIB2Frames into a numpy array with the timestamps with dimension (number of W...
uint32_t get_n_frames(daqdataformats::Fragment const &frag)
Gets number of WIB2Frames in a fragment.
py::array_t< uint64_t > np_array_timestamp(daqdataformats::Fragment &frag)
Unpacks the timestamps in a Fragment containing WIBFrames into a numpy array with dimension (number o...
py::array_t< uint16_t > np_array_adc(daqdataformats::Fragment &frag)
Unpacks a Fragment containing WIBFrames into a numpy array with the ADC values and dimension (number ...
py::array_t< uint64_t > np_array_timestamp_data(void *data, int nframes)
Unpacks data containing WIBFrames into a numpy array with the timestamps with dimension (number of WI...
py::array_t< uint16_t > np_array_adc_data(void *data, int nframes)
Unpacks data containing WIBFrames into a numpy array with the ADC values and dimension (number of WIB...
py::array_t< uint64_t > np_array_timestamp(daqdataformats::Fragment const &frag)
Unpacks the timestamps in a Fragment containing WIBFrames into a numpy array with dimension (number o...
py::array_t< uint16_t > np_array_adc(daqdataformats::Fragment const &frag)
Unpacks a Fragment containing WIBEthFrames into a numpy array with the ADC values and dimension (numb...
uint32_t get_n_frames(daqdataformats::Fragment const &frag)
Gets number of WIBEthFrames in a fragment.
py::array_t< uint16_t > np_array_adc_data(void *data, uint32_t n_frames)
Unpacks data containing WIBEthFrames into a numpy array with the ADC values and dimension (number of ...
py::array_t< uint64_t > np_array_timestamp_data(void *data, uint32_t n_frames)
Unpacks data containing WIBEthFrames into a numpy array with the timestamps with dimension (number of...
void print_hex_fragment(daqdataformats::Fragment const &frag)