Next: , Previous: Filter, Up: Overview


3.3 Binning

Rays are binned according to their positions in the xy plane. It is assumed that all of the rays have the same z coordinate; they are not projected there by spatquant. If rays are accumulated, the only information retained is the sum of the weights of the rays which fall within a bin; all other information is discarded. The weight of accumulated rays may optionally be divided by the area of their bins, providing their surface density (see Binning Parameters, norm_area).

3.3.1 Grid Schemes

spatquant has been designed to make it easy to implement different types of spatial gridding (rectilinear, polar, polar-log). While each of these schemes is two dimensional, each dimension is different depending upon the scheme. spatquant uses two dimensions, i and j, which are mapped by each of the schemes onto their particular grid. i and j have integral values, and represent the indices of the bins in their respective dimensions. j varies most quickly in the data stored in memory, and is treated as a “dependent” variable. There may be different numbers of bins in the j dimension for any value of i. As an example, in a polar grid, i would be the index mapped onto radius and j that onto angle. The density of bins at small radii may be made different than at large radius by changing the extent of j.

3.3.1.1 Rectilinear Grid, Rectangular bins

Bins are rectangular in shape, with independent height and width dimensions, and are placed in a rectangular grid. There is no space between bins. i maps onto the rows (y), and j maps onto the columns (x). Bins limits are inclusive of their lower edges and exclusive of the higher edges; i.e.,

When in sparse mode, the grid is positioned so that the center of the bin with is at the user provided grid center coordinates (see Binning Parameters). The grid is positioned similarly if spatquant is in core mode and the numbers of requested rows and columns are odd. If the number of columns is even, the x coordinate is at If the number of rows is even, the y coordinate is at

3.3.1.2 Rectilinear Grid, Circular bins

Bins are circular in shape and are placed on a rectangular grid. The grid spacing is independent of the bin size, with the limitation that bins cannot overlap. i maps onto the rows (y), and j maps onto the columns (x). Rays which fall on bin edges are included in the bins.

When in sparse mode, the grid is positioned so that the center of the bin with is at the user provided grid center coordinates (see Binning Parameters). The grid is positioned similarly if spatquant is in core mode and the numbers of requested rows and columns are odd. If the number of columns is even, the x coordinate is at If the number of rows is even, the y coordinate is at

3.3.1.3 Circular Grid, Wedge bins

Bins are wedge in shape, and are placed in a circular grid. The index i, j respectively denote the radial, angular index of the grid. (see Binning Parameters).

3.3.1.4 Hexagonal Grid, Circular bins

Bins are circular in shape, and are placed in a hexagonal grid. The grid is set up like this (the numbers represent the indices of the “columns”):

spatquant_fig1.png

Note that the “columns” follow the wiggles and that the “rows” are as in a rectilinear grid. The diameter of the bins can be no larger than the spacing between bin centers. The coordinates of the central bin are determined similarly to what is done for the rectilinear grid, rectangular bin scheme, with allowances for the extra width of the grid due to the staggering of the rows.

3.3.2 Grid Limits

It is often the case that the user is interested in all of the rays which arrive at a particular z-plane (regardless of their position on the xy plane). To accomodate this situation, as well as the ordinary case where the grid has edges (as in the simulation of a detector), spatquant bins data in two modes. If the user wishes to clip the rays outside a specified rectangle, the program operates in core mode, in which it creates a 2D matrix in memory (hence the term “core”). If no clipping is to be done, spatquant operates in sparse mode, where it keeps track only of those bins which contain rays. This mode relieves the user of needing to know how large an area the ray distribution will cover. In addition, if the amount of memory required for core mode is larger than a user specified limit, sparse mode is used automatically.