[Paraview] plot over line question (save data)

Sven Buijssen sven.buijssen at tu-dortmund.de
Fri May 28 11:48:19 EDT 2010


Stephen,

There is no built-in solution as far as I know, but the following pipeline may
serve as a guideline:

* Apply ’Extract Block’ and ’Merge Blocks’ filter for a multi-block data set
* Apply Programmable Filter with the following Python source code:

inp = self.GetInput()
filename = "foo.csv"
FILE = open(filename, "w")
FILE.write("x,y,z, x-velocity\n")
numPoints = inp.GetNumberOfPoints()
vel = inp.GetPointData().GetArray("velocity")
for i in xrange(0, numPoints):
  coords = inp.GetPoint(i)[:3]
  FILE.write(str(coords[0]) + ",")
  FILE.write(str(coords[1]) + ",")
  FILE.write(str(coords[2]) + ",")
  FILE.write(str(vel.GetValue(i * 3)) + "\n")
FILE.close()


Sven


Stephen Wornom wrote, On 28.05.2010 17:39:
> When I save data in the format .csv, I would like to save only the
> values that I select. But save.data writes every variable 17 of which I
> don't want. Is there a way to save only selected values?
> Stephen
> 
> 
> 
> _______________________________________________
> 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