#!/usr/bin/python

from abstracts import *
import cPickle
import sys


file1 = sys.argv[1]
file2 = sys.argv[2]

xdat = Xdatcarreader()
xdat.readFile(file1)
back = xdat.data

xdat = Xdatcarreader()
xdat.readFile(file2)
there = xdat.data

alldata = []

for i in range(len(back)):
    alldata.append(back[-i-1])
for i in range(len(there)):
    alldata.append(there[i])

cfile = 'trajectory.dat'
ufile = open(cfile, 'w')
cPickle.dump(alldata, ufile)
ufile.close()

# ufile=open('XX','w')
# for i in range(len(alldata)):
#  for j in range(len(alldata[0])):
#    ufile.write(`alldata[i][j][0]`+'\t'+`alldata[i][j][1]`+'\t'+`alldata[i][j][2]`+'\n')
#  ufile.write('\n')
# ufile.close()
# print xdat.data[0]
# print xdat.data[-1]
