fixed resizing of digital frames

This commit is contained in:
Erik Frojdh
2023-06-06 08:18:49 +02:00
parent 43f0f0e43a
commit ad953aefde
2 changed files with 16 additions and 1 deletions

View File

@ -136,12 +136,18 @@ static PyObject *RawFileReader_read(RawFileReader *self, PyObject *args) {
// resize the array to match the number of clusters read
PyArray_Resize((PyArrayObject *)frames, &new_shape, 1, NPY_ANYORDER);
if(digital_frames){
PyArray_Resize((PyArrayObject *)digital_frames, &new_shape, 1, NPY_ANYORDER);
}
// if we also read header we need to reshape the header
if (self->read_header) {
new_shape.len = 1;
PyArray_Resize((PyArrayObject *)header, &new_shape, 1,
NPY_ANYORDER);
}
}
// Build up a tuple with the return values