 Author:
 Serge Monkewitz
A scan, in the sense understood by the WAX software, is a convex polygon on the unitsphere, with four unit vector corners and four great circle edges. This quadrilateral approximates an observed area on the sky, an area for which raw image data is available and has been used for apparition extraction.
This page describes algorithms which determine how many such scans cover a particular position on the sky  a quantity which roughly indicates the expected number of apparitions of a single astronomical source located at that position, assuming an ideal instrument and observation conditions.
A scan has four corners , with edges linking corners 0 and 1, 1 and 2, 2 and 3, and 3 and 0. Each great circle edge can be specified with a single vector perpendicular to the plane passing through the origin and both edge vertices :
The corners are numbered such that they appear in counterclockwise order when viewed from outside the unitsphere in a right handed coordinate system.
The scan coverage for a position (unitvector) is defined as the number of scans covering .
For to lay inside a scan , it must satisfy the following four conditions :
that is, must lay inside each of the edge planes.
The obvious method of determining scan coverage for a position is to perform the test above for each existing scan.
Since the databases being processed involve apparitions from up to 70000 scans, this would involve performing between 70000 and 280000 dot products and comparisons to determine the scan coverage of a single position.
Because scan coverage is likely to be computed for the position of every group generated by WAX, this algorithm is unacceptable.
The BSP algorithm uses two forms of spatial subdivision, both of which lower the number of dotproducts and comparisons required to determine scancoverage for any given position.
First of all, the sky is divided into 256 declination bands (each of height radians). Each band is further subdivided into equal width lanes, with a minimum lane width of 0.3 degrees. This subdivision scheme is essentially identical to the one used for apparitions (see Lane Subdivision), but is performed on scans and on a much coarser scale.
If a list of overlapping scans were stored for each lane, this coarse subdivision scheme would already drastically reduce the number of coverage tests required for a position. However, there are datasets which contain clusters of more than 3000 scans, stacked virtually on top of eachother. Simple binning as described would still incur a cost of up to 12000 dot products per position for these cases.
Therefore, instead of storing a list of overlapping scans for each lane, the overlapping scans are used to generate a Binary Space Partitioning (BSP) tree. This tree is stored for each lane in every band, and is used for all coverage computations.
A BSP tree is generated from a set of convex polygons by recursively splitting the set against edge planes. Note that existing algorithms for clipping polygons in 2D can easily be extended to work with polygons on the surface of the unitsphere.
Let be the set of polygons corresponding to scans.

From a polygon in , take an as yet unconsidered edge plane and use it to split into two polygon sets, one containing polygons completely inside the chosen edge plane, , the other containing polygons completely outside, . Polygons straddling the edge plane are themselves split into an inside and outside polygon (using the aforementioned clipping algorithms).

If is nonempty and contains a polygon with an as yet unconsidered edge plane, feed to step 1. Otherwise, store the number of polygons in . Then continue with step 3.

If is nonempty and contains a polygon with an as yet unconsidered edge plane, feed to step 1. Otherwise, store the number of polygons in .
The process, illustrated below, produces a binary tree in depth first order, where nodes correspond to splitting planes and leaves are convex polygons inside of which scan coverage is constant (no leaf contains a scan edge).
Computing the scan coverage for a position is equivalent to finding the BSP tree leaf containing . This is easily done, starting with a current node equal to the root node of the tree :

Using the splitting plane normal of the current node, determine whether belongs to the inside or outside child of the current node :

belongs to the inside child

Otherwise (), belongs to the outside child

If the child containing is a node, set the current node to equal the child and continue with step 1.

Otherwise, the child containing is a leaf. Since scan coverage is constant inside each leaf, the scan coverage for has been found and the computation is complete.
This process is illustrated below, with empty leaves (those with 0 scan coverage) omitted from the diagram.
The ascent of the tree will involve a number of nodes no greater than the maximum tree depth. The worst cases encountered in practice (stacks of 1500 to 3500 scans) result in tree depths between 12 and 40. Since one dot product is performed for each node visited in the BSP tree, the algorithm performs at most 40 vector dot products for a scan coverage computation (as opposed to between 1500 and 14000).
Similarly, the minimum and maximum scan coverage of the positions inside a given search area can be found by finding the minimum and maximum scan coverage of the leaves intersecting the search area.
The WAX software currently only supports small circular search regions, specified as a search region center, , and a search radius, . A position is inside the area if and only if .
Finding the leaves intersecting the search area is accomplished as follows, starting with a current node equal to the root node of the tree :

Using the splitting plane normal of the current node, determine whether the search area intersects the inside and outside children of the current node.

If , then the search region touches the inside child :

If the inside child is a node, set the current node to equal the child and continue with step 1.

Otherwise, the inside child is a leaf. Compare the scan coverage for the leaf to the minimum and maximum scan coverage values found so far and update them if necessary.

if , then the search region touches the outside child :

If the outside child is a node, set the current node to equal the child and continue with step 1.

Otherwise, the outside child is a leaf. Compare the scan coverage for the leaf to the minimum and maximum scan coverage values found so far and update them if necessary.
Picking a search radius will produce a minimum and maximum scan coverage equal to the scan coverage for .
Generated on Thu Oct 21 13:19:39 2004 for WAX Version 2.1 by
1.3.8