SOURCE SELECTIONS
if --procsrcsexpr is non-empty: use --procsrcsexpr to select sources for image and order regions if --setflags is true: update SRC_SELECT column with this result else: initialize selected sources from SRC_SELECT column
EXCLUDED SOURCE SELECTIONS
if --exclsrcsexpr is non-empty: use --exclsrcsexpr to select sources for exclusion from background region if --setflags is true: update BACK_SELECT column with this result else: initialize excluded sources from BACK_SELECT column
SPATIAL BACKGROUND REGION
unless a correctly specified or protected background region exists: initialize empty region for each node: add polygon bounding the exposed surface for each excluded source: intersect polygon excluding --xpsfexcl percent of cross-dispersion PSF scan region for total number of enclosed pixels add region to source list
IMAGE AND ORDER REGIONS
for each selected source: unless a correctly specified or protected image region exists: initialize empty region for each node: if Spectroscopy: add polygon enclosing the xdsp PSF from --xpsfbelow to --xpsfabove else: (High Time Resolution) add polygon enclosing all exposure scan region for total number of enclosed pixels add region to source list for each order (1 to --maxorder): unless a correctly specified or protected order region exists: initialize empty region for each node: add polygon enclosing --pdistincl percent of PI distribution add excluded rectangle to each node with a calibration source scan region for total number of enclosed pixels add region to source list unless Spectroscopy or a correctly specified or protected background order region exists: initialize empty region for each node: if first order and CCD < 4: switch to second order construct polygon enclosing --pdistincl percent of PI distribution transform it by reflecting around top vertex at each vertex pair add transformed polygon to region add excluded rectangle to each node with a calibration source scan region for total number of enclosed pixels add region to source list