working c to python double arrays example, need to implement in controlloop