Skip to content
Snippets Groups Projects

Update README.md

Merged encinass1u requested to merge Student into main
Compare and Show latest version
1 file
+ 43
0
Compare changes
  • Side-by-side
  • Inline
Gaus_surface_3.py 0 → 100644
+ 43
0
#Code to arrange coordinates and values to create the surface for a posterior cell seeding.
#This code gices 3 different heights on the surface frol -1 to 1.
import numpy as np
from Plotting_3_levels import data_3, 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_multi_level.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_3[:,2])
#Iteration start
iter=1
#Second iteration
fois=1
#Loop to add by row the values of each coordinate
while fois < 415:
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 = 415-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_multi_level.cvs', 'wb') as cvs_file:
pickle.dump(Gts,cvs_file)
Loading