[Paraview] ParaView programmable filter -> what datatype to use to store complex number and complex number visualization

Burlen Loring burlen.loring at gmail.com
Wed May 21 12:05:00 EDT 2014


So you have 3 numpy arrays each with 3 complex values?

In any case you'll use vtk double  array for this, and you'll want to 
explictly handle real and imaginary parts. PV can iso surface the real 
and imaginary parts separately. There are a couple of ways you could do 
that. 1) each array of complex values could go into a 2 component 
vtkDoubleArray, first component is the real part and second component is 
the imaginary part. 2) each array of complex values could go into 2 1 
component double arrays, the first double array for the real part and 
the second double array for the imaginary part. Since you mentioned iso 
surfacing I'm guessing option 2 will be the easiest path for you.

Burlen

On 05/21/2014 07:20 AM, Su, Simon M CTR USARMY ARL (US) wrote:
> Hello,
>
> I am calculating the roots using numpy in the python programmable 
> filter. numpy.roots(coeff) is returning an array of type ndarray with 
> complex128 array elements.
>
> <type 'numpy.ndarray'>
>
> [-0.77184451+1.11514251j -0.77184451-1.11514251j 0.54368901+0.j ]
>
> array size = 3
>
> (-0.771844506346+1.11514250804j)
>
> <type 'numpy.complex128'>
>
> (-0.771844506346-1.11514250804j)
>
> <type 'numpy.complex128'>
>
> (0.543689012692+0j)
>
> <type 'numpy.complex128'>
>
>
>
> In my calculation I will have 3 roots so I will be creating three 
> variables root1, root2, root3, and  add them to the output data via
>
> output.GetPointData().AddArray(root1)
> output.GetPointData().AddArray(root2)
> output.GetPointData().AddArray(root3)
>
> what would the vtk type that I need to use to create root1, root2, and 
> root3?
>
> Can ParaView draw an isosurface using root1, or root2, or root3?
>
> Any help on this is much appreciated.
>
> thanks
> -simon
>
>
>
>
>
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20140521/39c1d759/attachment.html>


More information about the ParaView mailing list