I have a structured grid with a temperature array. I have verified that it has nonzero data stored in this array, checked with:
vtk_to_numpy(volume.GetPointData().GetArray("Temperature"))
.
I am trying to probe a ray through this volume to get the temperatures along this ray. By construction, I know that the endpoints of the ray are on the surface of the volume (and I have visually verified it in ParaView). The code I am using for the probe is:
sampler = vtkLineSource()
sampler.SetResolution(30)
sampler.SetPoint1(start)
sampler.SetPoint2(end)
probe = vtkProbeFilter()
probe.SetInputConnection(sampler.GetOutputPort())
probe.SetSourceData(volume)
probe.Update()
temps = vtk_to_numpy(probe.GetOutputDataObject(0).GetPointData().GetArray("Temperature"))
However when I inspect the temps array, I get all zeros!
Any ideas what I am doing wrong?