Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. matrix =  [[ 0 for x in range(C1)]for y in range (T1)]
  2. print "matrix generated with ",height, " rows and ",width," coloumns."
  3.  
  4. #######################################
  5.  
  6. for j in range (0,height) :
  7.     vtu_filename = str(targets[j])
  8.     vtu_file=vtktools.vtu(vtu_filename)
  9.     vtu_file.GetFieldNames()
  10.     Magn=vtu_file.GetVectorField('Magnetization') #total magnetization af all cells
  11.  
  12.     for i in range (0,width):
  13.         cell_mag_total = Magn[i] #total magnetization of ith cell    
  14.         My = cell_mag_total[1]
  15.         #Mx_array.append(Mx)
  16.         matrix[j][i] = My
  17.    
  18. # np.savetxt("mx.txt",np.c_[matrix])
  19. print "type matrix +  " , type(matrix)
  20.  
  21. for colm in range (0,width):
  22.         print colm
  23.     signal = matrix[][colm]
  24.         print type(signal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement