[Paraview] python scripting / calculator filter

2008-12-02 Thread Pierre-Olivier Dallaire
Good afternoon, I'm looking for an example on how to use the calculator filter in a python script. With the calculator, I want to : 1) Extract each component of a vector array (x, y, z); 2) Apply a scalar factor on each array (for unit conversion). Best regards, PO _

Re: [Paraview] python scripting / calculator filter

2008-12-02 Thread Peter Brady
Here's something I did recently calc = servermanager.filters.Calculator(Input=pderiv) calc.ResultArrayName = 'w' calc.AddVectorVariable = ['Vorticity', 'Vorticity', '0', '1', '2'] calc.Function = '(Vorticity).(kHat)' calc.UpdatePipeline() # w is now element 16 This gave the vorticity in the khat

Re: [Paraview] python scripting / calculator filter

2008-12-02 Thread Pierre-Olivier Dallaire
Thanks Peter, very useful ! PO On 2-Dec-08, at 4:53 PM, Peter Brady wrote: Here's something I did recently calc = servermanager.filters.Calculator(Input=pderiv) calc.ResultArrayName = 'w' calc.AddVectorVariable = ['Vorticity', 'Vorticity', '0', '1', '2'] calc.Function = '(Vorticity).(kHat)' c