[Paraview] Scalar components and Python Calculator

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Sat May 25 12:25:29 EDT 2013


The data arrays in Python calculator are numpy arrays so simply do
something like follows (barring any typos):

    sqrt( pow(ImageData[:,0], 2), pow(ImageData[:,1], 2) )

Also refer to: http://www.paraview.org/Wiki/ParaView/Users_Guide/Python_Calculator

Utkarsh


On Wed, May 22, 2013 at 5:55 PM, Pettey . Lucas <LPettey at drc.com> wrote:
> Hello,
>
> I am trying to use the Python Calculator on 2 different Scalar components in the same data file.
>
> I have written the real and imaginary parts of a Fortran complex data type to a single ".raw" binary file. ParaView correctly opens this file when I tell it that there are 2 scalar components.
>
> I can use the Calculator to perform calculations on the "X" and "Y" components (the real gets imported by default as ImageData_X and the imaginary as ImageData_Y). An expression in the Calculator filter such as:
>
> sqrt(ImageData_X^2 + ImageData_Y^2)
>
> works fine. The Python Calculator, however, generates an error that ImageData_X and ImageData_Y are not defined.
>
> Both filters are set to Point Data.
>
> Any suggestions?
>
> Thanks
> Lucas
> ________________________________
> This electronic message transmission and any attachments that accompany it contain information from DRC® (Dynamics Research Corporation) or its subsidiaries, or the intended recipient, which is privileged, proprietary, business confidential, or otherwise protected from disclosure and is the exclusive property of DRC and/or the intended recipient. The information in this email is solely intended for the use of the individual or entity that is the intended recipient. If you are not the intended recipient, any use, dissemination, distribution, retention, or copying of this communication, attachments, or substance is prohibited. If you have received this electronic transmission in error, please immediately reply to the author via email that you received the message by mistake and also promptly and permanently delete this message and all copies of this email and any attachments. We thank you for your assistance and apologize for any inconvenience.
> _______________________________________________
> 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


More information about the ParaView mailing list