Documentation for jbiu/

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

math/

point_convolve.pro


top source point_convolve

Math

result = point_convolve(points=points, binsize=binsize, range=range, sigma=sigma, weight=weight, cutoff=cutoff, noconvol=noconvol, nofft=nofft)

Convolves a list of N-dimensional points with a Gaussian kernel.

By default, this function uses an FFT and the convolution theorem. If /NOFFT is set, then it uses the built-in CONVOL function. If either /NOCONVOL is set or SIGMA is an MxN array, then it uses manual summation.

Return value

An grid containing the output density field. Each dimension i in the output grid has length (RANGE[i,1]-RANGE[i,0])/BINSIZE[i]. Returns -1 on error.

Keywords

points in

Array of MxN points for M dimensions and N particles (required).

binsize in

Bin sizes for final output grid. Either a scalar or an array of length M. (required)

range in

Array of Mx2, containning the extent of output grid in each dimension. (required)

sigma in

Width of Gaussian kernel. May either be a scalar that is applied to all dimensions, an array of length M for different widths in each dimension, OR an MxN array containing a separate width for each particle and dimension (this option uses manual summation as if /NOCONVOL were set, and is therefore much slower). (required)

weight in

An array of length N containing the weight to assign to each point. A weight of 1 (default) corresponds to a Gaussian normalized such that its integral over the entire M-dimensional space is unity.

cutoff in

Assume that the kernel may be safely truncated after this many SIGMAs. Default: 8 (corresponding to a dynmical range of 7.9e13).

noconvol in

If /NOCONVOL is set than use manual summation rather than an FFT.

nofft in

If /NOFFT is set then use the built-in CONVOL routine rather than an FFT.

Examples

xpos = 10.*RANDOMU(seed,100) ypos = 20.*RANDOMU(seed,100) density = POINT_CONVOLVE(POINTS=TRANSPOSE([[xpos],[ypos]]), BINSIZE=1., RANGE=[[0.,0.], [10.,20.]], SIGMA=[2.,4.])

Author information

History:

Written by: Jeremy Bailin 12 June 2008 Public release in JBIU 15 Apr 2008 Fixed off-by-one bug and improved memory usage

File attributes

Modification date: Mon Feb 15 12:18:03 2010
Lines: 298