[SciPy-user] How to Enable Delaunay Package
Dominik Szczerba
domi at vision.ee.ethz.ch
Tue Jun 26 18:35:20 EDT 2007
Go the the VTK online documentation, there is plenty of python examples.
- Dominik
Gabriel Gellner wrote:
> Could you give a quick example?
> I would love to have a second way of doing this. . .
>
> Gabriel
>
> On Tue, Jun 26, 2007 at 10:05:23PM +0200, Dominik Szczerba wrote:
>> I use VTK for this purpose (there are python bindings).
>> - Dominik
>>
>> Lorenzo Isella wrote:
>>> Dear All,
>>> I am posting this after a discussion originated on the matplotlib
>>> mailing list.
>>> Fundamentally, I need to plot data on irregular (i.e. non equi-spaced
>>> rectangular) grids.
>>> I finally was recommended to look at the Delaunay package (see approach2
>>> at the link:
>>>
>>> http://scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data
>>> ).
>>>
>>> The problem is that the approach:
>>>
>>> from scipy.sandbox.delaunay import *
>>>
>>> does not work (the system does not find the requested module).
>>>
>>> Now, I am running Debian testing on my box and I have Python2.3,2.4,2.5
>>> installed beside SciPy as taken from the standard repositories.
>>> Under /usr/lib/python2.4/site-packages/scipy/sandbox I have the file
>>> setup.py which I copy and paste at the end of the email.
>>> I try uncommenting the line dealing with Delaunay, but that did not help
>>> me out (probably it is useful only if I am rebuilding SciPy, which I
>>> would like to avoid).
>>> Anyone has experienced the same problem or has any suggestions?
>>> I am really in need to get this working in order to be able to perform
>>> some non-trivial data plotting with matplotlib.
>>> Many thanks
>>>
>>> Lorenzo
>>>
>>>
>>>
>>>
>>> import os
>>>
>>> def configuration(parent_package='',top_path=None):
>>> from numpy.distutils.misc_util import Configuration
>>> config = Configuration('sandbox',parent_package,top_path)
>>>
>>> sandbox_packages = []
>>> try:
>>> sandbox_file = open(os.path.join(config.package_path,
>>> 'enabled_packages.txt'), 'rU')
>>> except IOError:
>>> pass
>>> else:
>>> for line in sandbox_file:
>>> p = line.strip()
>>> if line.startswith('#'):
>>> continue
>>> sandbox_packages.append(p)
>>> sandbox_file.close()
>>>
>>> for p in sandbox_packages:
>>> config.add_subpackage(p)
>>>
>>> # All subpackages should be commented out in the version
>>> # committed to the repository. This prevents build problems
>>> # for people who are not actively working with these
>>> # potentially unstable packages.
>>>
>>> # You can put a list of modules you want to always enable in the
>>> # file 'enabled_packages.txt' in this directory (you'll have to
>>> create it).
>>> # Since this isn't under version control, it's less likely you'll
>>> # check it in and screw other people up :-)
>>>
>>> # An example package:
>>> #config.add_subpackage('exmplpackage')
>>>
>>> # Monte Carlo package
>>> #config.add_subpackage('montecarlo')
>>>
>>> # PySparse fork with NumPy compatibility
>>> #config.add_subpackage('pysparse')
>>>
>>> # Robert Kern's corner:
>>> #config.add_subpackage('rkern')
>>>
>>> # ODRPACK
>>> #config.add_subpackage('odr')
>>>
>>> # Delaunay triangulation and Natural Neighbor interpolation
>>> config.add_subpackage('delaunay')
>>>
>>> # Gist-based plotting library for X11
>>> #config.add_subpackage('xplt')
>>>
>>> # elementwise numerical expressions
>>> #config.add_subpackage('numexpr')
>>>
>>> # Statistical models
>>> #config.add_subpackage('models')
>>>
>>> # Adaptation of Scientific.IO (2.4.9) to use NumPy
>>> #config.add_subpackage('netcdf')
>>>
>>> # Finite Difference Formulae package
>>> #config.add_subpackage('fdfpack')
>>>
>>> # Package with useful constants and unit-conversions defined
>>> #config.add_subpackage('constants')
>>>
>>> # Interpolating between sparse samples
>>> #config.add_subpackage('buildgrid')
>>>
>>> # Package for Support Vector Machine
>>> #config.add_subpackage('svm')
>>>
>>> # Package for Gaussian Mixture Models
>>> #config.add_subpackage('pyem')
>>>
>>> # David Cournapeau's corner: autocorrelation, lpc, lpc residual
>>> #config.add_subpackage('cdavid')
>>>
>>> # New spline package (based on scipy.interpolate)
>>> #config.add_subpackage('spline')
>>>
>>> return config
>>>
>>> if __name__ == '__main__':
>>> from numpy.distutils.core import setup
>>> setup(**configuration(top_path='').todict())
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> SciPy-user mailing list
>>> SciPy-user at scipy.org
>>> http://projects.scipy.org/mailman/listinfo/scipy-user
>> --
>> Dominik Szczerba, Ph.D.
>> Computer Vision Lab CH-8092 Zurich
>> http://www.vision.ee.ethz.ch/~domi
>> _______________________________________________
>> SciPy-user mailing list
>> SciPy-user at scipy.org
>> http://projects.scipy.org/mailman/listinfo/scipy-user
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
--
Dominik Szczerba, Ph.D.
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi
More information about the SciPy-User
mailing list