The Slit Positioning Algorithm

Field of View

The algorithm sorts and discards the objects as follows:

The algorithm will drop objects listed in the catalog that are not in the field of view -
regardless of their priority. The field of view is rectangular in shape,
with the corners cut off; similar to the shape of the FITS image.

It will then determine if any of the acquisition objects overlap and,
working from left to right, discard those that do overlap.

The position of the slit is shifted according to the value of slitpos_x
and slitpos_y for each object. If the object is too close to the edge such
that (in length or width) the slit falls even partially outside the field of view,
then that object will also be discarded.

Acquisition objects

Before submitting the mask, you must ensure that at least two
acquisition objects are present in the mask, and that these are away
from the GMOS CCD gaps if designing a GMOS mask.

Priority and position sorting of priority 1,2 and 3 objects

Once all possible
acquisition objects are placed on the mask the slit placement then
attempts to place as many priority 1 objects as possible on the mask,
then as many priority 2 objects and finally priority 3. An object of
higher priority will always be placed on a mask at the expense of any
number of lower-priority objects. For example if placing a priority 1
object would prevent 10 priority 2 objects from being placed, the
priority 1 object would be placed nonetheless... similarly for
priority 2 objects at priority 3 object's expense (The algorithm does
not in fact even take conflicts with lower-priority objects into
account when determining which objects it will place on the mask).

The slit placement algorithm also ensures that there
is at least a 2-pixel separation between object spectra once they are
placed on the mask... this value is taken into account when
determining which slits are mutually exclusive (meaning that they
cannot both exist on the same mask) prior to slit selection.

Internal workings of the slit selection algorithm

This
section describes in further detail the inner workings of the slit
selection algorithm as it is on 05/24/2010, this is provided for
informative purposes only and is not necessary knowledge for user
operation of the GMMPS software.

While
the majority of the GMMPS Plugin is written in the TCL language, the
slit selection algorithm, for efficiency reasons, is written in C++.
This C++ file is called from a TCL source file named gmmps_spoc.tcl
with arguments that include, among other things: the name of a
temporary specially formatted catalog file containing information
from the OT file we are building the mask from, the pixel scale of
the objects in that file, the name of the field-of-view definition
file for the given instrument type, and the instrument type itself.
The program output is the calculated Object Definition File(s)
(ODF(s)) containing the parameters for the slits that have been
placed on the mask(s).

The
first thing the slit selection algorithm does is loop through the
input file parsing out information in the relevant catalog columns
and stores that information in an array of 'Slit' objects (the Slit
object is defined in the same C++ file). A check is then made to make
sure no objects fall outside of the field of view, if an object that
is outside of the field of view is found it is dropped from the slit
array and therefor removed from consideration in placement. If the
program is in Band Shuffle mode an object is also dropped if it is
not within a valid band.

In
the next step a 'conflict graph' is constructed for all objects in
the 'Slits' array. A conflict graph is a representation of all the
slits on the mask, with the vectors representing each respective
object and edges between any two vectors that cannot both be placed
upon the same mask. This first conflict map is made so that when a
slit is placed the program will know which slits it can remove (and
therefor remove from consideration for placement) from the main Slits
array, this will be useful in some of the following steps when we are
considering slits of the same priority only (but nonetheless cannot
place overlapping slits from different priorities).

After
this the acquisition slits are placed on the mask-representation.
This step is similar to the following step for slits with priorities
1, 2, and 3, with the exception that these slits will be placed on
ALL masks being created in this session (if more than one mask is
being created). First a conflict graph is made for between all
acquisition objects, the objects are then ranked by degree of the
object's graph representation (the number of edges connected to the
vertex in the conflict graph) in the conflict graph that was based on
objects of the same-priority. Objects are then placed on the graph
starting with the lowest-degree object and proceeding until no more
objects can be placed on the graph. When an object is placed any
other object that conflicted with that object is removed from the
Slits array, as well as the local (same priority level) and global
(all priority levels) conflict graphs—the local conflict graph is
updated during this step to reflect the removal of these objects.
When the local conflict graph is empty then no more objects can be
placed on the graph, and the program moves on to the next-lower
priority level and repeats this process.

After
all possible slits have been placed on the mask using this process
the program determines if it is in Max_Mode. If it is not is mask
mode it does nothing and move on to the final ODF-creation steps. If
Max_Mode IS enabled then the algorithm sorts all slits by the
non-dispersion direction (the x-direction for F2 and the y-direction
for GMOS) and expands each slit as much as possible in that direction
without causing spectra to overlap (and leaving a small space between
each spectra for data reduction purposes). The modified slit
representations are stored in the Slit definitions and the algorithm
proceeds to the final ODF creation steps.

Last update March 24, 2013; Mischa Schirmer
In original form February 10, 2003; Dione Scheltus