add test5
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user