[Paraview] Looping over blocks in a multiblock data set and printing to a table or graph

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon Feb 23 13:53:45 EST 2015


It'll be something like follows:

Programmable Filter: OutputDataSetType= "vtkTable".
==============================================
Script
==============================================
import numpy as np

size = 0
for input_block  in inputs[0]:
  size += 1
meanArray = np.zeros(size, dtype = np.float64)

index = 0
for input_block  in inputs[0]:
  mean = np.mean(input_block.PointData["Elevation"])
  meanArray[index] = mean
  index += 1
output.RowData.append(meanArray, "MeanElevation")

A 4.3.1 state file attached.

Utkarsh

On Mon, Feb 23, 2015 at 11:16 AM, Sandeep Jella <sandeepjella at gmail.com> wrote:
> Hello,
>
> I have a list of surfaces that I would like to automatically loop over and
> calculate means and standard deviations of a variable on each and then plot
> to a single plot.
>
> I guess I'd have to do this in a programmable filter attached to the
> multiblock entity* but need some guidance on the code/macro that will  loop
> over the surfaces.
>
> *  (I used the "Extract block" functionality which selects a bunch of
> surfaces from a much larger dataset)
>
> Many thanks,
>
> Sandeep.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>


More information about the ParaView mailing list