I have a Pandas DataFrame in this form, which represents a 3D simulation's results of temperature values in a closed space.
X | Y | Z | T
----+-----+-----+---
x0 | y0 | z0 | T0
x1 | y1 | z1 | T1
....|.....|.....|...
xn | yn | zn | Tn
I define a line vector by two points:
vector (x0,y0,z0), (x1,y1,z1)
The idea is to get the temperature distribution over that line. So I want to extract the values of T in that vector.
This is what I have until now:
import pandas as pd
SCALE = 0.001
X = 76 * SCALE
Y = 1744 * SCALE
Z = 260 * SCALE
vector = (0.0, Y / 2, 0.0), (X, Y / 2, 0.0) # center vector
raw_data = pd.read_csv("data.csv")
df = raw_data[['Points_0','Points_1','Points_2', 'T']]
df = df.rename(columns={'Points_0': 'X', 'Points_1': 'Y', 'Points_2': 'Z'})
and data.csv looks like:
Block Name,Point ID,Points_0,Points_1,Points_2,Points_Magnitude,T,U_0,U_1,U_2,U_Magnitude,p,p_rgh
internalMesh,0,0,0,-0.26,0.26,288.161,0,0,0,0,101486,101486
internalMesh,1,0.00217143,0,-0.26,0.260009,288.182,0,0,0,0,101486,101486
internalMesh,2,0.00434286,0,-0.26,0.260036,288.212,0,0,0,0,101486,101486
internalMesh,3,0.00651429,0,-0.26,0.260082,288.24,0,0,0,0,101486,101486
internalMesh,4,0.00868571,0,-0.26,0.260145,288.268,0,0,0,0,101486,101486
internalMesh,5,0.0108571,0,-0.26,0.260227,288.294,0,0,0,0,101486,101486
internalMesh,6,0.0130286,0,-0.26,0.260326,288.32,0,0,0,0,101486,101486
internalMesh,7,0.0152,0,-0.26,0.260444,288.346,0,0,0,0,101486,101486
internalMesh,8,0.0173714,0,-0.26,0.26058,288.372,0,0,0,0,101486,101486
internalMesh,9,0.0195429,0,-0.26,0.260733,288.397,0,0,0,0,101486,101486
internalMesh,10,0.0217143,0,-0.26,0.260905,288.423,0,0,0,0,101486,101486
internalMesh,11,0.0238857,0,-0.26,0.261095,288.448,0,0,0,0,101486,101486
internalMesh,12,0.0260571,0,-0.26,0.261302,288.473,0,0,0,0,101486,101486
internalMesh,13,0.0282286,0,-0.26,0.261528,288.496,0,0,0,0,101486,101486
internalMesh,14,0.0304,0,-0.26,0.261771,288.52,0,0,0,0,101486,101486
....
internalMesh,69695,0.076,1.744,0.26,1.76491,307.722,0,0,0,0,101466,101485
The problem can be visualized as:
The simulation results are points between the two green plates. and the vector is a line from one plate two the other. The final idea is to plot the temperature profile over that vector.
A thing to notice is that the Vector is always normal to the plates.
