13#include <pybind11/numpy.h>
15namespace py = pybind11;
31 py::array_t<uint16_t> ret(256 * nframes);
32 auto ptr =
static_cast<uint16_t*
>(ret.request().ptr);
33 for (
size_t i=0; i<(size_t)nframes; ++i) {
35 for (
size_t j=0; j<256; ++j)
36 ptr[256 * i + j] = fr->
get_adc(j);
38 ret.resize({nframes, 256});
49 py::array_t<uint64_t> ret(nframes);
50 auto ptr =
static_cast<uint64_t*
>(ret.request().ptr);
51 for (
size_t i=0; i<(size_t)nframes; ++i) {
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.