Quaternion and 3D orientation offline

I am using a compatible Arduino microcontroller (RedBear Duo) to get 9dof data from the latest adafruit 9dof. I would like to be able to get quaternions and 3d orientation offline. The setting of my project is as follow: I collected 9dof data for 1 month, there is also 1hertz GPS from the entire sensor deployment. I have calibrated all the axis of the 9dof.

At the moment I have a file with all the data inside, following there is a sample of it:


I would like to use python to get the positional vectors and an animation of the body in which the sensor was. I have looked a lot on the web but I can only found online approaches in which the animation and the quaternions are builded live. I need to do this offline.

Do anyone know or have a reference to some algorithm I can use to do that?

Thank you.

RTImulib is open source and has modules to read a variety of sensors. It should not be difficult to write a new module that would take your data file as a sensor input stream.

It may have already been written, but if not and you write one, please post the code as I'm sure other people would be interested.

There are various forks of RTImulib for different processors and operating systems, including Windows and Arduino, so look around a bit. In fact, RTImulib2 offers a desktop version that gets its data from an Arduino operating the sensor. That may do just what you want.