python MD tranverse current calculation