How Effective and Expensive is Dithering? 
=========================================
Or: some remarks on the Jakobsen conjecture


1. Throughput for dithered observations
--------------------------------------- 

The goal of dithering is to minimize the errors in flux measurement
for any arbitrarily located target. The assumption is that the
"average" efficiency for a given dither pattern has been calibrated
once. Therefore, the effectiveness of a dither strategy can be by the
variations in the throughput for randomly located targets.  For the
purpose of this discussion, we define this variation as var= (f_max -
f_min )/2./f_mean, where f_min, f_max and f_mean are the minimum,
maximum and mean of the average slit efficiency for targets placed at 
any random position.
figure 1
If we could re-configure the MSA at every dither position, any
randomly located target would always be located within the "nearest
pixel trigger zone" (NPTZ).  However, since we do not re-configure
every time, we have to accept that some targets are sometimes located
outside this zone. The dither strategy considered is the following.
The pattern consists of n_dith x n_dith equally spaced raster
points. The step size between dither points is 0.5 facets /
n_dither. The facets to be opened will be chosen to that the average
target location on the MSA for all dither positions is within the
NPTZ. This is illustrated in figure 1 which shows the locations of
three targets for a n_dith x n_dith= 4x4 dither raster.  The left most
panel shows the case where the target is perfectly centered in the
slit. This implies perfect centering on the NPTZ which is marked as a
pink dashed line.  This position can be chosen for one single target.
The right most panel shows the dither position of a target at the
least favorable possible position, i.e. the furthest a target can
leave the NPTZ. If the target were located even further away from the
slit center, a different set of facet would be chosen to form the
slit. The middle panel shows an intermediate position. Using the
Fourier code for NIRSPEC, we can now compute the efficiency of each
dither position for a target at a given location. For each target, we
then take the mean over all dither positions. For lambda=2mu,
WFE=180nm and the segmented mirror PSF, we get for the average
efficiencies of 41, 43 and 46% for the three panels of figure 1.  The
mean efficiencies for any intermediate position is 44%, and the
variation var as defined above is 5.8%. This has to be compared to the
case where we do not dither at all. In this case, the efficiency for a
target located at the intersection of two gaps is 34%, the maximum
mean throughput of any target is 56%, and the throughput variation is
23%. By construction, the variations in the throughput which translate
into our flux error is smaller for the dithered observations.

Before starting to discuss how expensive the dither pattern it, let us
slightly generalize the treatment by allowing re-configuration of the
MSA for SOME dither positions. The considered strategy is to dither
with the same pattern as above, but re-configure the MSA after every
sub-patter of n_config x n_config positions. For n_config=1, the MSA
is re-configured at every dither position. For n_config=n_dith, no
re-configuring is used. The strategy for the configuring of the facets
is now to always place the center of each sub-pattern within the NPTZ.
This is illustrated for n_dither=4 and n_config=2 in figure 2.  A
different color is used for each sub-pattern.  In this case, the
maximum distance of a target from the edge of the NPTZ is half the
size of the sub-pattern (right-most panel). It is clear that both the
mean throughput for any target position will increase, and the
variation of the throughput decrease.
figure 2
The results for a number of different dither patterns are summarized
in table 1 and 2. Table 1 are the mean average throughputs. They where
computed by first averaging the throughput over all dither position
for every target location. Subsequently, the mean over any random
target positions was computed was computed. Table 1 shows the
variations for each dither strategy. The lesson from the numbers are
that the average throughput for randomly placed targets changes little
no matter whether the observations is dithered or not, but the
variations in throughput changes significantly.



                  table 1
mean average throughput for randomly placed targets in %
       n_dith= 1       2       4       8      16
------------------------------------------------
 n_config= 1  46      46      46      46      46
           2          45      46      46      46
           4                  44      46      46
           8                          44      45
          16                                  44

Notes to table: n_config=1 (first line in table) are the cases
where the MSA is re-configured at every dither position. 
n_config=n_dith (diagonal elements) are the cases without
any re-configuration.




                  table 2
 throughput variations for randomly placed targets in %
       n_dith= 1       2       4       8      16
------------------------------------------------
 n_config= 1  23.3    5.2     0.9     0.2    0.1 
           2          8.5     1.9     0.5    0.2
           4                  5.8     1.4    0.5 
           8                          5.7    1.4
          16                                 5.7



2. Cost of dithering
--------------------

The basic important assumption for the computation of the cost of
dither strategies is that targets are randomly distributed both
spatially and in flux. Therefore, we do NOT have the option of placing
faint targets at favorable positions within the slit.  If we tried
this for one faint target, the other faint targets in the field will
be place at less favorable positions.  The dither and facet-selection
algorithms do not know about the brightness of individual
targets. Therefore, the total exposure time is determined by the
faintest targets located at the least favorable position within the
slit. If we do not dither at all, we have to choose the exposure time
appropriate for a target located at the intersection of gaps between
facets.

The cost, i.e. exposure time + overhead will therefore not be computed
from the mean throughputs listed in table 2, but from the minimum
average throughput. First, the average throughput is computed from all
dither positions for a given target location. Subsequently, the minimum
of all target location is computed. A relative exposure time is
computed as t_exp= 1/f_min^2 and normalized to unity for the the
n_config=n_dith=1 (no dithering) case.  Table 3 shows exposure times
for the different dither strategies. The shortest exposure time is
reached for the largest number of dither points and re-configurations.
The reason is that in this case, the throughput variations are
smallest and therefore the minimum throughput relatively
large. However, in the real world this shorter exposure time has to be
paid for by higher overheads.  This is illustrated in table 4 and 5,
where we computed the total cost of an observation defined as the
exposure time + overhead. For the numbers in table 4, the overheads
for each dither position without re-configuration was assumed to be 1%
of the total exposure time without dithering. The overhead for each
reconfiguration was assumed to be 2% of this exposure time. For table
5, the overheads were assumed to be 1 and 10%.

It can immediately be seen that the dither strategy with the shortest
exposure times leads to the highest cost. The lowest cost strategy for
the small assumed overhead (table 4) is a dither pattern of 4x4
points, with re-configuration every 2x2 points. For the larger assumed
overheads, re-configuration always increases the total cost. However,
even with re-configuration, a strategy which uses the same amount of
real time for the observation as the no-dither strategy can be found.




 
                table 3
   normalized exposure times without overhead
       n_dith= 1         2          4         8       16
-----------------------------------------------------------
n_config= 1 | 1.00      0.63      0.57      0.56      0.55
          2 |           0.72      0.59      0.56      0.56
          4 |                     0.69      0.59      0.56
          8 |                               0.70      0.59
         16 |                                         0.70

                table 4
   cost= exposure time + overheads of 1 and 2%
       n_dith= 1         2          4         8       16
-----------------------------------------------------------
n_config= 1 | 1.00      0.69      0.87      1.82      5.65
          2 |           0.75      0.77      1.34      3.74
          4 |                     0.84      1.25      3.26
          8 |                               1.33      3.17
         16 |                                         3.25 


              table 5
   cost= exposure time + overheads of 1 and 10%
       n_dith= 1         2          4         8       16
-----------------------------------------------------------
n_config= 1 | 1.00      0.93      2.07      6.86     26.05 
          2 |           0.75      1.01      2.54      8.78 
          4 |                     0.84      1.49      4.46
          8 |                               1.33      3.41
         16 |                                         3.25





3. Conclusions
---------------

The Jakobsen Conjecture predicts that the total real time (=cost) for
a given observation increases by a large factor when dithering is used. 
By contrast, we find here:
 - dithering decreases the total real time needed to reach a minimum
   s/n for any randomly located target of  a given  observations. 
   The reason is that without dithering, we have to choose the exposure
   time so that even a target which happens to fall onto the intersection
   of the gaps between facets reach enough s/n. With dithering, these 
   targets reach on average more flux per second exposure time and
   therefore reduce the necessary total exposure time.
 - unless we re-configure at every dither position, we have to accept that 
   at some dither positions, some targets will be outside the "nearest
   pixel trigger zone". However, the loss in average efficiency is small
   and decreases with the number of throughputs.
 - with the current PSF model at lambda=2mu, a 4x4 dither pattern
   seems to be an optimal choice. This lead to a flux error due
   to slit efficiency variations of less than 2%. 
 - Depending on the overheads, four or fewer re-configuration of the 
   MSA might be chosen.