First, I know about the NumPy interface. It isn’t doing what I need it to. See the other discussion: Slow Programmable Filter

I’ve written a programmable filter for some analysis I’m doing, but it’s returning odd results. I’m expecting a new CellData field, but I’m getting something that looks like it’s averaged over blocks (in addition to being wrong). Does anyone have any insight?

This is approximately what I would expect to see.

```
def flatten(input, output):
output.ShallowCopy(input)
numCells = output.GetNumberOfCells()
cellData = input.GetCellData()
r = cellData.GetArray('radius')
v = cellData.GetArray('vol')
d = cellData.GetArray('den')
def base_bump(t, tau):
x = (t-tau)**2
if x > 1:
out = 0
else:
out = exp(1/(x-1))/0.443993816237631
return out
def bump(r, rp, h):
return base_bump(r/h, rp/h)**(1/h)
h = 1
dtype = r.GetDataType()
out = r.NewInstance()
out.SetName("denbar")
for indi in range(0, numCells):
temp = 0
for indj in range(0, numCells):
temp += d.GetValue(indj)*v.GetValue(indj)*bump(
r.GetValue(indi),r.GetValue(indj),h)
out.InsertValue(indi,temp)
output.GetCellData().AddArray(out)
input = self.GetInputDataObject(0, 0)
output = self.GetOutputDataObject(0)
if input.IsA("vtkMultiBlockDataSet"):
output.CopyStructure(input)
iter = input.NewIterator()
iter.UnRegister(None)
iter.InitTraversal()
while not iter.IsDoneWithTraversal():
curInput = iter.GetCurrentDataObject()
curOutput = curInput.NewInstance()
curOutput.UnRegister(None)
output.SetDataSet(iter, curOutput)
flatten(curInput, curOutput)
iter.GoToNextItem();
else:
flatten(input, output)
```