[Paraview] Reading excel data into paraview

Berk Geveci berk.geveci at kitware.com
Fri Jan 23 09:53:19 EST 2009


NOTE: Everything described here works with cvs version. I don't think
they will work with 3.4.

* Load the csv file - this will create a table
* Apply Table to Points - choose the right columns for X, Y and Z values
* Apply programmable filter with the following code:
output = self.GetOutputDataObject(0)
npts = output.GetNumberOfPoints()
lines = vtk.vtkCellArray()
lines.InsertNextCell(npts)
for i in range(npts):
	lines.InsertCellPoint(i)
output.SetLines(lines)
output.SetVerts(None)

This will produce a polygonal dataset that contains one polyline that
connects all points. Then you can save the dataset out as a VTK file.
I recommend legacy VTK. If you write a python script that does the
above for each timestep, you can create a set of legacy VTK files. If
they are named as
foo1.vtk
foo2.vtk
...

You can then load them as a time series.

-berk


On Thu, Jan 22, 2009 at 4:17 PM, Jamie Ruprecht <j.ruprecht at hotmail.com> wrote:
>
> Hi everybody,
>
> I have just started working on paraview and have data which is a
> 1-dimensional times series of water suface elevations. At each time step I
> have water heights recorded for the length of the computational domain. The
> columns in my excel file represents the changing water profile for each time
> step and the rows represent the spatial step. My aim is to generate a 2D
> animation showing a wave propagating along the computational domain.
>
> Mike suggested that I convert the file from .xls to .csv (for easier
> reading) than to .pvd (to view in paraview). This is all well and good,
> though I am not that confident with python coding, I think if I had an
> example I will be able to get my head around it though. If anyone could help
> me out in that would be much appreciated.
>
> Cheers,
> Jamie.
>
> ________________________________
> Sell your car for just $40 at CarPoint.com.au It's simple!
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list