75 l->debug(
"NumpyFrameSaver: EOS");
84 const float baseline =
m_cfg[
"baseline"].asFloat();
86 const float offset =
m_cfg[
"offset"].asFloat();
87 const bool digitize =
m_cfg[
"digitize"].asBool();
97 m_cfg[
"frame_tags"][0] =
"";
101 std::stringstream ss;
102 ss <<
"NumpyFrameSaver: see frame #" << inframe->ident()
103 <<
" with " << inframe->traces()->size() <<
" traces with frame tags:";
104 for (
auto t : inframe->frame_tags()) {
105 ss <<
" \"" <<
t <<
"\"";
107 ss <<
" and trace tags:";
108 for (
auto t : inframe->trace_tags()) {
109 ss <<
" \"" <<
t <<
"\"";
111 ss <<
" looking for tags:";
112 for (
auto jt:
m_cfg[
"frame_tags"]) {
113 ss <<
" \"" << jt.asString() <<
"\"";
118 for (
auto jtag : m_cfg[
"frame_tags"]) {
121 l->debug(
"NumpyFrameSaver: save {} tagged as {}", traces.size(), tag);
122 if (traces.empty()) {
123 l->warn(
"NumpyFrameSaver: no traces for tag: \"{}\"", tag);
129 auto chend = std::unique(chbeg,
channels.end());
133 const size_t ncols = tbinmm.second-tbinmm.first;
135 l->debug(
"NumpyFrameSaver: saving ncols={} nrows={}", ncols, nrows);
139 arr = arr * scale + offset;
145 const short* sdata = sarr.data();
151 l->debug(
"NumpyFrameSaver: saved {} with {} channels {} ticks @t={} ms qtot={}",
152 aname, nrows, ncols, inframe->time() /
units::ms, arr.sum());
162 const std::vector<double> tickinfo{inframe->time(), inframe->tick(), (double)tbinmm.first};
void npz_save(std::string zipname, std::string fname, const T *data, const std::vector< size_t > &shape, std::string mode="w")
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
std::string format(const std::string &form, TYPES...objs)
Eigen::Array< short, Eigen::Dynamic, Eigen::Dynamic > array_xxs
A 16 bit short integer 2D array.
unsigned nrows(sqlite3 *db, std::string const &tablename)
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Eigen::ArrayXXf array_xxf
A real, 2D array.