[vtkusers] howto output VTK files with python

daniele dada_dna at yahoo.it
Wed Sep 7 18:03:17 EDT 2005


Hi!
I don't even know if it is the right ml to ask... but here is my problem:

I wrote a python script to parse hyperchem logfile in order to extract 
UV-spectrum data from many logfiles. Each UV spectrum is a 2D data set 
(wavenumber, intensity). I'd like to combine multiple UV spectrum, in 
order to obtain a 3D progression of them. I've done that assignin a 
number to each compound, that is, a number each 2D spectrum, and I 
obtained a 3D set of data: (numberID, wavenumber, intensity).
All coords of the same compound have the same numberID, so they result 
aligned on the same coord.
Eg:
spectrum1:
300,1 0,001
278,4 0,024
250,0 0,007

spectrum2:
302,0 0,003
283,5 0,178
236,9 0,002

becomes:
300,1 0,001 1
278,4 0,024 1
250,0 0,007 1
302,0 0,003 2
283,5 0,178 2
236,9 0,002 2

So I have that data, in python. Now I need to write it to a VTK file (in 
order to read it with MayaVi).
I red about pyvtk, and I tryied it, never obtaining anything (i get 
python errors or mayavi errors).

Is there a simple way to output from python a vtk file that plots my 
data set?
pyvtk is so poorly documented...

tnx!

-- 

-----
it.scienza.chimica, 25/8/05:
 > che differenza c'è tra molarità, molalità e moralità?
con le prime due puoi descrivere un politico.
[dp]
http://blog.daniele.homelinux.org




More information about the vtkusers mailing list