Re: [Paraview] Cannot Automate Vectors with Python and CSV Files

2014-05-14 Thread Magician
Hi Darren,


How about:

try: paraview.simple
except: from paraview.simple import *

points_csv = CSVReader(FileName = 
'/Users/magician/Documents/ParaViewTest/points.csv')
TableToPoints1 = TableToPoints(
XColumn = 'x',
YColumn = 'y',
ZColumn = 'z',
)
Show()
Calculator1 = Calculator(Function = 'vx*iHat+vy*jHat+vz*kHat')
Show()
Glyph1 = Glyph(
Vectors = ['POINTS', 'Result'],
GlyphType = 'Arrow',
SetScaleFactor = 1.0,
)
Show()
Render()


I tried on ParaView 4.1.0 of OSX.


Magician


On May 14, 2014, at 20:18, paraview-requ...@paraview.org wrote:

 Date: Tue, 13 May 2014 18:46:53 +
 From: Darren Pereira darren.pere...@mail.utoronto.ca
 To: paraview@paraview.org paraview@paraview.org
 Subject: [Paraview] Cannot Automate Vectors with Python and CSV Files
 Message-ID: 146813590.42...@mail.utoronto.ca
 Content-Type: text/plain; charset=iso-8859-1
 
 Hey there,
 
 
 I'm working on displaying velocity vectors but have reached a major 
 roadblock. I have a set of CSV files with columns x, y, z, vx, vy, and vz - 
 the positions and velocity components of the velocity vectors I want to show. 
 By manually loading in the CSV files, applying the TableToPoints filter, 
 applying the Calculator filter, and then applying the Glyph filter, I can 
 display these vectors.
 
 
 The problem comes when I try to write a Python script to the exact same 
 thing. This problem has been reported as a bug with Paraview 
 (http://vtk.org/Bug/bug_relationship_graph.php?bug_id=14184graph=dependency),
  where Python cannot select Row Data. I'm really having difficulty finding 
 a way around it. Is there a way to use my CSV files to display my velocity 
 vectors in a similar fashion, but with Python? What I've done manually is so 
 far the only way I know how to display vectors, but it's not Python 
 compatible. Any help would be greatly appreciated!
 
 
 Thanks,
 
 Darren

___
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


[Paraview] Cannot Automate Vectors with Python and CSV Files

2014-05-13 Thread Darren Pereira
Hey there,


I'm working on displaying velocity vectors but have reached a major roadblock. 
I have a set of CSV files with columns x, y, z, vx, vy, and vz - the positions 
and velocity components of the velocity vectors I want to show. By manually 
loading in the CSV files, applying the TableToPoints filter, applying the 
Calculator filter, and then applying the Glyph filter, I can display these 
vectors.


The problem comes when I try to write a Python script to the exact same thing. 
This problem has been reported as a bug with Paraview 
(http://vtk.org/Bug/bug_relationship_graph.php?bug_id=14184graph=dependency), 
where Python cannot select Row Data. I'm really having difficulty finding a 
way around it. Is there a way to use my CSV files to display my velocity 
vectors in a similar fashion, but with Python? What I've done manually is so 
far the only way I know how to display vectors, but it's not Python compatible. 
Any help would be greatly appreciated!


Thanks,

Darren
___
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