Skip to content
Snippets Groups Projects

Update README.md

Merged encinass1u requested to merge Student into main
1 file
+ 42
0
Compare changes
  • Side-by-side
  • Inline
Gaus_surface.py 0 → 100644
+ 42
0
 
#Code to arrange coordinates and values to create the surface for a posterior cell seeding.
 
import numpy as np
 
from Plotting_by_distance import data_t, L
 
import pickle
 
 
#Initial matrix filled with 0 with the dimensions of Surface
 
E = np.zeros((414,545))
 
#Choose False if its the first time running the code
 
Existing_surface=False
 
 
 
#Open the already existing surface
 
if Existing_surface==True:
 
with open('Gts_Surface_T.cvs', 'rb') as csv_file:
 
Gts = pickle.load(csv_file)
 
else:
 
Gts= E
 
#List with the discrete values for each coordinate in the plane
 
coord_value = (data_t[:,2])
 
 
#Iteration start
 
iter=1
 
#Second iteration
 
fois=1
 
#Loop to add by row the values of each coordinate
 
while fois < 411:
 
fois+=1
 
#Definition of ranges for the values of 0 and 1 of the coordinates
 
min = 545*fois
 
max = 545*(fois+1)
 
#Part of the coordinate value list that will be introduced in the corresponding row
 
W= coord_value[min:max]
 
#r is the row number
 
r = 413-fois
 
for i in range(r-1,r):
 
for j in range(545):
 
#Adding the values of the list to each coordinate
 
Gts[i,j]= W[j]
 
#pickle the information entered in the matrix
 
with open('Gts_Surface_T.cvs', 'wb') as cvs_file:
 
pickle.dump(Gts,cvs_file)
 
Loading