Closed ivoflipse closed 10 years ago
This Stack Overflow answer mentions behavior that seems similar, where if you want None replaced with np.NaN, just do this:
>>> my_list = [3, 5, 6, None, 6, None]
>>> np.array(my_list, dtype=np.float)
array([ 3., 5., 6., nan, 6., nan])
Which might indicate that either one line or one whole frame contained a NaN, causing the whole thing to be cast to NaN as well
For now I've manually fixed it by replacing all the NaNs with zeros and writing the new array back and then updating the maximum value. I still have to check whether that affects any of the other calculations, like that of the COP or anything that somehow sliced data from the frames containing NaN.
As for the cause, I'm still clueless
I still don't know what caused it, but haven't encountered it ever since on multiple computers, so I'm blaming cosmic radiation!
I was using the program and noticed the color scaling looked off. The console was also crapping about:
Turns out the measurement data contains NaNs so all the boolean checks go out of whack.
I read in the offending file in an IPython Notebook and there's no problem, so it feels like a real Heisenbug. I've asked Elianne to send me some of the zipped files, to see what could have gone wrong, but I actually ran it on her version of Pawlabeling and it worked just fine too. So this is really strange.
Comparing the two files, it wasn't even some values being clipped to NaN or something like that, but whole frames being replaced. So now I'm left wondering where the hell this happens...
The frames where there's nothing on the plate, things seem to go wrong. Really strange!