Error in running F2Py

When I tried the sample code in : http://www.scipy.org/F2py

I got the following error:

/tmp/tmpHNH55t/src.linux-x86_64-2.6/fortranobject.h:7:20: error: Python.h: No such file or directory

It turns out I needed to install python-dev in my Ubuntu to resolve this problem. After I install python-dev, f2py works well.

Advertisements

Writing VTK file using Python

To write VTK file using Python, download pytvtk. You can read the examples folder to get to know how to use it.

For example to write a structured points of scalar data stored in variable named Coef, we write:


vtk=VtkData(StructuredPoints([Nx,Ny,Nz]),\
PointData(Scalars(ravel(Coef,order='F'),'my scalar')))
vtk.tofile('myfile')

this will save to a file name myfile.vtk



When scientists sin

interesting article from Scientific American:

In his 1974 commencement speech at the California Institute of Technology, Nobel laureate physicist Richard P. Feynman articulated the foundation of scientific integrity: “The first principle is that you must not fool yourself—and you are the easiest person to fool…. After you’ve not fooled yourself, it’s easy not to fool other scientists. You just have to be honest in a conventional way after that.”

full article: http://www.scientificamerican.com/article.cfm?id=when-scientists-sin