Field and Chunk Boundaries

Field Boundaries

Defining the boundaries on the sky associated with each field is a bit tricky. There are three regions associated with each field, related to bits in the object "status" bit mask:
OK_RUN
Each field is 1361+128 rows long, where the last 128 rows are also the first 128 rows in the next field. Thus, the first and last 128 rows of the 1489 total rows intersect the previous and adjacent fields. We divide both overlap regions in two, assigning the inner halves to this field and the outer halves to the adjacent fields. Thus, rows 64 - 1361+64 of a given field are considered to belong to the field, comprising the OK_RUN area of the field. All objects belonging to this area of its field have their OK_RUN bit set. The OK_RUN areas within a given scan thus completely cover the area scanned without overlapping. This area is of itself of little interest, except that the areas defined below are subsamples of these areas.
OK_SCANLINE
Each survey stripe is a great circle on the sky. One can define 12 non-overlapping but touching scanlines on the sky associated with each stripe. Scanlines are separated by lines of constant great circle latitude (nu). Each of these scanlines is scanned by one column of the imaging camera during a set of two north-south scan pairs which cover the stripe. The twelve scanlines for a given stripe do not overlap, however scanlines between adjacent stripes may overlap. For a given camera column (camCol) and strip (n=north, s=south), the scanline boundaries of constant great circle latitude are:
    nuMin = ((camCol - 1) * 2 + (strip == 'n' ? 1 : 0) - 6) *
            at_scanSeparation;
    nuMax = nuMin + at_scanSeparation;
"at_scanSeparation" is defined in the "astrotools" product, and has the value 0.20977443333 deg. We define the OK_SCANLINE area of a field as that portion of the OK_RUN area which intersects the scanline. Lines of constant great circle longitude are to high accuracy parallel to field columns. Thus, the OK_SCANLINE region can be considered to high approximation as a rectangle delimited by lines of constant great circle longitude on the left and right (though in reality they are lines of constant row number) and lines of constant great circle latitude on the bottom and top. The approximate lines of constant great circle longitude delimiting the left and right boundaries ("startMu" and "endMu" in the sample code below, both in degrees) of the region may be determined using the r' TRANS structure ("trans" in the sample code below):
    double nu, startMu, endMu;
    atTransApply(&trans, 'r', 64., 0., 1024., 0., NULL, NULL,
                 &startMu, NULL, &nu, NULL);
    atTransApply(&trans, 'r', 1361.+64., 0., 1024., 0., NULL, NULL,
                 &endMu, NULL, &nu, NULL);
All objects within this region have their OK_SCANLINE bit set. If doing science with single frames pipeline runs independent of the survey as a whole, this is usually the best sample to use. The area of this region is stored for each field in the SX.

Within context of the survey, there is one complication. Each field belongs to one or two segments. Each segment has a bounding lower and upper line of constant great circle longitude. If one of the segment ends goes through a field, then the OK_SCANLINE region of that field must be adjusted accordingly. Thus, if the segment mu limits are specified in degrees by the variables "segmentStartMu" and "segmentEndMu", one can determine the field boundaries as:

    startMu = (startMu > segmentStartMu ? startMu : segmentStartMu);
    endMu = (endMu < segmentEndMu ? endMu : segmentEndMu);
PRIMARY
The sky may be divided into touching but non-overlapping regions delimited by lines of constant survey latitude. Each stripe is centered on a line of constant survey latitude (eta). The region of sky associated to that stripe is bounded below and above by the lines of constant survey latitude (in degrees):
    etaMin = eta - 1.25;
    etaMax = eta + 1.25;
The primary survey area is specified as a group of such stripes, where the area of each stripe is further bounded by lines of constant survey longitude ("lambdaMin" and "lambdaMax"). The intersection of the OK_SCANLINE region of a field with the survey area of its associated stripe is the PRIMARY region. All PRIMARY regions are non-overlapping, and uniquely define the survey. All objects in a field that lie within its stripe's eta limits have their OK_STRIPE bit set. If they also lie within the lambda limits, they have their PRIMARY bit set; this set of PRIMARY objects comprises the primary survey sample.

The PRIMARY region boundary for a field is difficult to define, as it can consist of as few as 4 and as many as 6 line segments, each constant in a different variable (mu, nu, lamdba, or eta). Lets stick with great circle coordinates (mu, nu). The upper constant-eta stripe boundary can be expressed in great circle coordinates as:

    nu = tan(at_stripeSeparation * at_deg2Rad / 2.) *
         sin((mu - 95.) * at_deg2Rad) * at_rad2Deg;
where "at_stripeSeparation" is defined by the "astrotools" product and has the value 2.5 deg. The lower boundary is the negative of the upper. The constant-lambda stripe boundaries can be expressed in great circle coordinates as:
    nu = acos(cos((lambda + 90) * at_deg2Rad) / (cos((mu - 95) + at_deg2Rad)))
         * at_rad2Deg;
One way to determine the PRIMARY region boundaries is then simply to step along in mu from the OK_SCANLINE region start to end mu boundaries, calculating the nu coordinate of the stripe eta and lambda boundaries, comparing them to the OK_SCANLINE nu boundaries, and using the most limiting of the three. The area of the PRIMARY region for each field is stored in the SX.

Chunk Boundaries

Chunks are defined as areas of stripes (delimited by upper and lower lines of constant survey latitude, eta) bounded by a lines of constant great circle longitude (mu).