Skip to content
Snippets Groups Projects
Commit a92b7cf1 authored by Boman Romain's avatar Boman Romain
Browse files

adapt parameters to panthera

parent b1f7e671
No related branches found
No related tags found
No related merge requests found
Pipeline #10127 passed
......@@ -21,8 +21,11 @@ import numpy as np
import fossils
fossils.setup_pythonpath()
# folder = os.path.join('workspace', \
# 'models_dolicorhynchops_dolicorhynchops_10k')
folder = os.path.join('workspace', \
'models_dolicorhynchops_dolicorhynchops_10k')
'models_Panthera_pardus_Panthera_pardus_RC_30')
meshfile = os.path.join(folder, 'mesh.msh')
datafile = os.path.join(folder, 'smooth_stress_zz.msh') # <= values for colours
......@@ -61,14 +64,21 @@ points = ugrid.GetPoints()
npts = points.GetNumberOfPoints()
# print(f'npts={npts}')
# print(f'len(data)={len(data)}')
vmin = np.min(data)
vmin = np.min(data) # <= use real full range (dolico)
vmax = np.max(data)
vmin = -30. # <= use custom range (panthera)
vmax = 30.
# print(f'vmin={vmin}')
# print(f'vmax={vmax}')
rng = vmax-vmin
for i, v in enumerate(data):
val = int((v-vmin)/rng*255) # compute "hue" value from 0 to 255
if val>255: val=255 # saturate
if val<0: val=0
r, g, b = colorsys.hsv_to_rgb(val/255, 1.0, 1.0) # convert to "rainbow colours"
colors.InsertTuple3(i, r*255, g*255, b*255)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment