Greetings!
I want to create a programmable filter that slices my unstructured dataset and then applies a weighted average on this slice. The output would be a table with the value of this weighted average and the x-coordinate of the cut.
I succeeded with the second part when I used a slice as an input. But I struggle to find a way to manually slice an unstructured dataset. Did anybody accomplish this already and can nod me in the right direction? Below is the code I used for the averaging.
Thanks,
Michael
data = inputs[0]
#print(data.Points[0,0])
totpressure = data.PointData['Total_Pressure']
density = data.PointData['Density']
xcoords = data.Points[0, 0]
massavgtotpressure = sum(totpressure*density)/sum(density)
xcoords = sum(xcoords)
output.RowData.append(massavgtotpressure, 'P_tot')
output.RowData.append(xcoords, 'x')