ransack generates random points inside the mask.

ransack [-d] [-q] [-c<n>] [-r<n>] [-m<a>[u]] [-s<n>] [-e<n>] [-u<inunit>[,<outunit>]] [-p[+|-]<n>] [-i<f>[<n>][u]] polygon_infile1 [polygon_infile2 ...] azel_outfile

The -c<n> switch seeds the random number generator with integral seed <n>.

The -r<n> switch commands to generate <n> random numbers.

polygon_infile1 [polygon_infile2 ...] are polygon files specifying the mask.

azel_outfile is the name of a file to which to write the random positions. In addition to recording the azimuth and elevation of each position, ransack writes the id number of the polygon inside which the random position falls.

The algorithm is as follows. ransack first selects randomly a polygon in the mask, with probability proportional to the product of the polygon's weight and area. It lassos that polygon with a circle that is intended to be a tight fit, but is not necessarily minimal. It generates a point randomly within the circle, tests whether the point lies inside the polygon, and keeps the point if it does.

ransack lassos polygons as needed, recording a lasso so that a lasso is computed only once for any polygon. If the desired number of random points exceeds the number of polygons in the mask, then ransack starts by lassoing every polygon in the mask.

ransack is quite fast.

Back to list of commands.