ivoflipse / Pawlabeling

Tool for processing and analyzing pressure measurements
Other
18 stars 1 forks source link

Paws with 'odd' shapes break the program #9

Closed ivoflipse closed 11 years ago

ivoflipse commented 11 years ago

Here's an example measurement by Fellow where on the last frame he steps on the side of the plate and loads just one sensor. This paw throws off the code that drives the rest of the program:

image

Here's the error message:

ValueError: zero-size array to reduction operation maximum which has no identity

This is caused by the rather naive way I calculate the surface, by counting nonzero values:

surface = np.max([np.count_nonzero(paw[:, :, frame]) for frame in range(z)])

The paw here has a shape of (1 x 1 x 0), which logically is somewhat problematic.

ivoflipse commented 11 years ago

I've added a check that sees if the data is 3D, but it seems to be it would be better to simply ignore this contact right after it was found. God knows what this would do to the order of things though...

ivoflipse commented 11 years ago

While I would have liked to keep paws like this around to mark them as invalid, they 'break' the assumption that all paw_data objects are 3D, so I'm simply going to ignore it.