**Step #1: Initialization**- Initialize the values of , , , , , , , , , , , , , etc...
**Step #2: User input**- Get the telescope time (
), the number
of sources (
) and the elevation (
). For mapping, get the
map sizes. There are two cases:
**EKH restoration**- The following checks and computations must be done.

(29) (30) (31) (32)

**Shift-and-add restoration**- The following checks and computations must be done.
- is set to the minimum of the empirical increasing function of because this restoration algorithm assumes that the restored sources are almost point-like.
- with .
- If
, then

(33) (34) (35)

- Else

(36) (37) (38)

We note that in this case, is not here a real number of source but more a number of submap: It does not need to be an integer.

**Step #3: Computation of and**-

(39) (40)

If , then return the following error message: ``The telescope time must at least be .'' **Step #4: Computation of , and**-
**OnOff**-

(41) (42)

**Mapping**-

(43) (44) (45) (46)

**Step #5: Computation of , and**-

(47) (48) (49)

**Step #6: Computation of (Mapping only)**-

(50) (51) (52) (53)

**Step #7: Computation of actual and (Mapping only)**-

(54) (55)

**Step #8: Computation of**-
**OnOff**-

(56) (57)

**Mapping**-

(58)

**Step #9: Computation of the actual , and**- We note that 1) the actual number of scan is
when
and
when
and 2) the true
elapsed telescope time might be smaller than the user input.

(59) (60) (61)