Rev. | 10802bc6bafcd08ae8ddf850680ee8a875bd775b |
---|---|
Größe | 1,012 Bytes |
Zeit | 2009-07-14 18:43:24 |
Autor | lorenzo |
Log Message | I simply commented out the stitching of some files since they are no longer
|
#!/usr/bin/env python
import scipy as s
import pylab as p
import numpy as n
def read_and_stitch(ini, end,base_name):
extension=".dat"
my_range=s.arange(ini,end)
temp_arr=s.zeros(3).astype("int")-1
for j in xrange((end-ini+1)):
i=j+ini
print "i is, ", i
ext2="%05d"%i
temp_name=base_name+ext2
temp_name=temp_name+extension
print "temp_name is, ", temp_name
my_load=p.load(temp_name).astype("int")
#my_load=my_load[:, 1:3]
print "s.shape(my_load) is, ", s.shape(my_load)
print "s.shape(temp_arr) is, ", s.shape(temp_arr)
temp_arr=s.vstack((temp_arr,my_load)).astype("int")
temp_arr=temp_arr[1:,:]
temp_name=base_name+extension
p.save(temp_name, temp_arr, fmt='%d')
return 0
# temp_name="sliced_dynamics"
# my_dyn=read_and_stitch(0, 499,temp_name)
temp_name="sliced_dynamics_self_loops"
my_dyn=read_and_stitch(0, 499,temp_name)
print "So far so good"