Code: Alles auswählen
def get_sheet(filename):
return open_workbook(filename).sheet_by_index(0)
Code: Alles auswählen
def get_sheet(filename):
return open_workbook(filename).sheet_by_index(0)
Code: Alles auswählen
def readVdotLiq(self, fileName):
sh = self._getWorkBook(fileName)
col = self._getPropertyCol('Width', sh)
col2 = self._getPropertyCol('VdotLiq', sh)
#vdotlist = []
self.cellwidth = array([x for x in sh.col_values(col)[1:12] if x != ''])
self.VdotLiq = array([x for x in sh.col_values(col2)[1:12] if x != ''])
#
self.tck = splrep(self.cellwidth,self.VdotLiq,k=3,s=0)
Code: Alles auswählen
def readVdotAir(self, fileName):
sh = self._getWorkBook(fileName)
start_column_index ,start_row_index = 2,2
data_width, data_height = 11,11
end_column_index = start_column_index + data_height
end_row_index = start_row_index + data_width
self.cellwidth = array([sh.col_values(start_column_index-1,start_row_index,\
end_row_index)])
self.cellheight = array([sh.row_values(start_row_index-1,start_column_index,\
end_column_index)])
self.VdotAir = matrix([sh.row_values(i ,start_column_index, end_column_index)\
for i in xrange(start_row_index, end_row_index)])
self.tck = splrep(self.cellwidth,self.VdotAir,k=3,s=0)
Code: Alles auswählen
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 540, in runfile
execfile(filename, namespace)
File "C:/SVNRepo/branches/1.0/modules/measurementDataReader.py", line 250, in <module>
op.readVdotAir('F://Masterthesis//Anstroemung_air.xls')
File "C:/SVNRepo/branches/1.0/modules/measurementDataReader.py", line 122, in readVdotAir
self.tck = splrep(self.cellwidth,self.VdotAir,k=3,s=0)
File "C:\Python27\lib\site-packages\scipy\interpolate\fitpack.py", line 444, in splrep
raise TypeError('Lengths of the first three arguments (x,y,w) must be equal')
TypeError: Lengths of the first three arguments (x,y,w) must be equal
Code: Alles auswählen
def readVdotAir(self, fileName):
sh = self._getWorkBook(fileName)
#
start_column_index ,start_row_index = 2,2
data_width, data_height = 11,11
end_column_index = start_column_index + data_height
end_row_index = start_row_index + data_width
self.cellwidth = array([sh.col_values(start_column_index-1,start_row_index,\
end_row_index)])
self.cellheight = array([sh.row_values(start_row_index-1,start_column_index,\
end_column_index)])
self.VdotAir = array([sh.row_values(i ,start_column_index, end_column_index)\
for i in xrange(start_row_index, end_row_index)])
self.tck = bisplrep(self.cellheight,self.cellwidth, self.VdotAir,kx=3, ky=3)
Code: Alles auswählen
Imported NumPy 1.8.0, SciPy 0.13.3, Matplotlib 1.3.1
+ guidata 1.6.1, guiqwt 2.3.1
Type "scientific" for more details.
>>> runfile('C:/SVNRepo/branches/1.0/modules/measurementDataReader.py', wdir=r'C:/SVNRepo/branches/1.0/modules')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 540, in runfile
execfile(filename, namespace)
File "C:/SVNRepo/branches/1.0/modules/measurementDataReader.py", line 250, in <module>
op.readVdotAir('F://Masterthesis//Anstroemung_air.xls')
File "C:/SVNRepo/branches/1.0/modules/measurementDataReader.py", line 122, in readVdotAir
self.tck = bisplrep(self.cellheight,self.cellwidth, self.VdotAir,kx=3, ky=3)
File "C:\Python27\lib\site-packages\scipy\interpolate\fitpack.py", line 868, in bisplrep
raise TypeError('len(x)==len(y)==len(z) must hold.')
TypeError: len(x)==len(y)==len(z) must hold.
>>>
Code: Alles auswählen
def readVdotAir(self, fileName):
sh = self._getWorkBook(fileName)
start_column_index ,start_row_index = 2,2
data_width, data_height = 11,11
end_column_index = start_column_index + data_height
end_row_index = start_row_index + data_width
self.cellwidth = array(sh.col_values(start_column_index-1,start_row_index,\
end_row_index))
self.cellheight = array(sh.row_values(start_row_index-1,start_column_index,\
end_column_index))
self.VdotAir = self.VdotAir = array([sh.row_values(i ,start_column_index, end_column_index)\
for i in xrange(start_row_index, end_row_index)])
x, y = meshgrid(self.cellheight, self.cellwidth)
self.bitck = Rbf(x, y, self.VdotAir)
Code: Alles auswählen
def get_sheet(fileName):
book= open_workbook(fileName)
sheet = book.sheet_by_index(0)
return book, sheet
def read_vdot_air(fileName):
book, sheet = get_sheet(fileName)
...
Code: Alles auswählen
def readVdotAir(self, fileName):
sh = self._getWorkBook(fileName)
start_column_index ,start_row_index = 2,2
data_width, data_height = 6,6
end_column_index = start_column_index + data_height
end_row_index = start_row_index + data_width
self.cellwidth = array(sh.col_values(start_column_index-1,start_row_index,\
end_row_index))
self.cellheight = array(sh.row_values(start_row_index-1,start_column_index,\
end_column_index))
self.VdotAir = array([sh.row_values(i ,start_column_index, end_column_index)\
for i in xrange(start_row_index, end_row_index)])
#
x, y = meshgrid(self.cellheight, self.cellwidth)
self.bitck = Rbf(x, y, self.VdotAir)
Code: Alles auswählen
def calculateHeatTransfer(self, model, operationData):
VdotAirCell = operationData.VdotAir/(self.nWidth*self.nHeight)
VdotLiqCell = operationData.VdotLiq/(self.nDepth*self.nWidth)
tAirInCell = operationData.tAirIn
tLiqInCell = operationData.tLiqIn
jTeilung = 1./self.nWidth
kTeilung = 1./self.nWidth
cellOp = []
Q = 0.
for i in range(self.nDepth):
for j in range(self.nWidth):
jcell = (j + 0.5)*jTeilung
for k in range(self.nHeight):
kcell = (k + 0.5)*kTeilung
print 'kcell',kcell
print i,j,k, i*self.nHeight*self.nWidth + j*self.nHeight + k
# initialise operation data
cellOp.append(deepcopy(operationData))
# set boundary values for air
if (i - 1) < 0:
tAirIn = tAirInCell
VdotAirCell = operationData.bitck(kcell,jcell)/(self.nHeight*self.nWidth)
if VdotAirCell < 0.:
VdotAirCell = 0.
print 'VdotAirCell',VdotAirCell
Code: Alles auswählen
VdotAirCell = operationData.bitck(jcell,kcell)/(self.nHeight*self.nWidth)
Code: Alles auswählen
VdotAirCell = 4.4
Code: Alles auswählen
Width VdotAir
Height 0 0,2 0,4 0,6 0,8 1
0 4,308064365 4,922172892 5,154789758 4,950086916 4,549985906 4,615118628
0,2 4,736079399 5,192008457 4,391806436 4,401111111 5,164094433 4,661642001
0,4 4,875649518 4,549985906 1,498052619 1,888848955 4,680251351 4,987305614
0,6 4,912868217 4,540681231 1,591099366 1,172389006 4,522071882 4,940782241
0,8 4,6988607 5,201313131 4,308064365 4,261540991 5,089657035 4,810516796
1 4,615118628 4,6988607 4,847735494 5,219922481 5,005914964 4,41041578
Code: Alles auswählen
for i in range(self.nDepth):
for j in range(self.nWidth):
jcell = (j + 0.5)*jTeilung
for k in range(self.nHeight):
kcell = (k + 0.5)*kTeilung
Code: Alles auswählen
def readVdotAir(self, fileName):
sh = self._getWorkBook(fileName)
start_column_index ,start_row_index = 2,2
data_width, data_height = 6,6
end_column_index = start_column_index + data_height
end_row_index = start_row_index + data_width
self.cellwidth = array(sh.col_values(start_column_index-1,start_row_index,\
end_row_index))
self.cellheight = array(sh.row_values(start_row_index-1,start_column_index,\
end_column_index))
self.VdotAir = array([sh.row_values(i ,start_column_index, end_column_index)\
for i in xrange(start_row_index, end_row_index)])
#
x, y = meshgrid(self.cellheight, self.cellwidth)
print 'x,y',x,y
self.bitck = Rbf(x, y, self.VdotAir)
Code: Alles auswählen
if (i - 1) < 0:
tAirIn = tAirInCell
VdotAirCell = operationData.bitck(jcell,kcell)/(self.nHeight*self.nWidth)
Code: Alles auswählen
x, y = meshgrid(self.cellheight, self.cellwidth)
self.bitck = Rbf(x, y, self.VdotAir)