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

Sandeep Jella sandeepjella at gmail.com
Tue Feb 24 23:08:25 EST 2015


Hi Utkarsh, this works perfectly!

I have a related question...

I created a custom filter that I'd like to call from within the loop (over
the blocks).  Being able to call other filters within the loop would
tremendously save time...is there such a possibility?

Many thanks again for your  fast response earlier,

Sandeep.




On Mon, Feb 23, 2015 at 1:54 PM, Utkarsh Ayachit <
utkarsh.ayachit at kitware.com> wrote:

> On Mon, Feb 23, 2015 at 1:53 PM, Utkarsh Ayachit
> <utkarsh.ayachit at kitware.com> wrote:
> > 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
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150224/0fbf9089/attachment.html>


More information about the ParaView mailing list