add test5

This commit is contained in:
2026-05-17 23:43:07 +02:00
parent 555c976df2
commit d08495a451
7 changed files with 85 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ void npy_save(std::string path, std::vector<bool>& x) {
npy::write_npy(path, d);
}
std::vector<double> fetch_y_axis(npy::npy_data<double>& acc) {
std::vector<double> fetch_y_axis(npy::npy_data<double>& acc, int dim) {
// TODO: later on, we should use a vector projection towards gravity
std::vector<double> signal;
const size_t rows_real = acc.shape[0];
@@ -27,12 +27,12 @@ std::vector<double> fetch_y_axis(npy::npy_data<double>& acc) {
#else
const size_t rows = acc.shape[0];
#endif
int stride = 3;
int offset = 1; // [x,y,z] per row - fetch y
int stride = (int) acc.shape[1];
int offset = dim; // [x,y,z] per row - fetch y by default
signal.resize(rows);
if (acc.fortran_order) {
stride = 1;
offset = (int) rows_real;
offset = (int) rows_real * offset;
}
/*
std::cout << "is_fortran=" << acc.fortran_order << std::endl;