In [1]:
%matplotlib inline
In [16]:
import matplotlib.pyplot as plt
import csv
import numpy as np
In [3]:
ld = [ 1., 1.]
WIDTH = 16
HEIGHT = 8
print WIDTH*HEIGHT
hd = [ld[0]/(float(WIDTH)), ld[1]/(float(HEIGHT)) ]
In [44]:
# list the csv files we can import
import os
[filename for filename in os.listdir('./') if filename.find('.csv') >= 0 ]
Out[44]:
In [45]:
with open('simplelinear2dtex_result.csv','r') as csvfile_result:
plot_results = csv.reader(csvfile_result, delimiter=',')
result_list = list( list(rec) for rec in plot_results )
with open('simplelinear2dtex_ogref.csv','r') as csvfile_ogref:
plot_ogref = csv.reader(csvfile_ogref, delimiter=',')
ogref_list = list( list(rec) for rec in plot_ogref )
with open('simplelinear2dtex_d_result.csv','r') as csvfile_d:
plot_d = csv.reader(csvfile_d, delimiter=',')
d_list = list( list(rec) for rec in plot_d )
with open('simplelinear2dtex_add_l_result.csv','r') as csvfile_addl:
plot_addl = csv.reader(csvfile_addl, delimiter=',')
addl_list = list( list(rec) for rec in plot_addl )
with open('simplelinear2dtex_dx_result.csv','r') as csvfile_dx:
plot_dx = csv.reader(csvfile_dx, delimiter=',')
dx_list = list( list(rec) for rec in plot_dx )
with open('simplelinear2dtex_dy_result.csv','r') as csvfile_dy:
plot_dy = csv.reader(csvfile_dy, delimiter=',')
dy_list = list( list(rec) for rec in plot_dy )
In [46]:
csvfile_result.close()
csvfile_ogref.close()
csvfile_d.close()
csvfile_addl.close()
csvfile_dx.close()
csvfile_dy.close()
In [47]:
# convert the strings in the list of lists into floats
result_list = [[float(ele) for ele in row] for row in result_list]
ogref_list = [[float(ele) for ele in row] for row in ogref_list]
d_list = [[float(ele) for ele in row] for row in d_list]
addl_list = [[float(ele) for ele in row] for row in addl_list]
dx_list = [[float(ele) for ele in row] for row in dx_list]
dy_list = [[float(ele) for ele in row] for row in dy_list]
In [48]:
# convert the list of lists of floats into numpy arrays
result_list = np.array( result_list)
ogref_list = np.array( ogref_list)
d_list = np.array( d_list)
addl_list = np.array( addl_list )
dx_list = np.array( dx_list )
dy_list = np.array( dy_list )
In [20]:
result_list - ogref_list
Out[20]:
In [42]:
print result_list.shape; print ogref_list.shape; print d_list.shape;
print addl_list.shape; print dx_list.shape
In [35]:
# np.array_str from
# cf. http://stackoverflow.com/questions/2891790/pretty-printing-of-numpy-array
print np.array_str(result_list, precision=3, suppress_small=True)
In [24]:
d_list
Out[24]:
Take a look at the cudaTextureDesc::addressMode
, whether it's cudaAddressModeWrap
or cudaAddressModeClamp
In [34]:
print np.array_str( addl_list, precision=3, suppress_small=True )
In [43]:
print np.array_str( dx_list, precision=3, suppress_small=True )
In [49]:
print np.array_str( dy_list, precision=3, suppress_small=True )
In [ ]: