Skip to content

Deal with arrays containing 32 bit floats correctly

Matthew Pitkin requested to merge buffer_dtype_mismatch into master

Currently, if the fast_heterodyne gets passed a timeseries that contains 32-bit float numbers, it will end up trying to use the do_complex_heterodyne function rather than the do_heterodyne function. This is because np.float32 != float, while np.float64 == float. This raises an exception, which is handled as a warning, so the code still works, but requires fixing. In particular, Virgo O3 frame data appears to be 32-bit floats.

This MR fixes this issue by explicitly checking for 32-bit floats and converting the type to float if necessary.

Merge request reports