Check data formats

Plotting input data works now, output data is still wrong
Flatten (pack) and unpack all arrays in Python

This will cause less confision, and is easier to test with few
modifications to C source.