Conversion code from PIMAIM to xbs trajectory viewer format