# Map Generation

A crucial step in CMB data analysis is the conversion of time-ordered observations of the sky into a map. Where by map we mean a mosaic of discrete pixels representing the microwave emission from the sky. This requires knowledge of where the detector was pointing for each observation and adopting a particular pixelization fo the sky. (The standard for Planck is HEALpix; but there is still a choice of coordinates, e.g. galactic vs. ecliptic, and other choices of area and azimuthal symmetry.)

Generating the map maybe accomplished by several different alogrithms. These generally start from
the minimization of chi-squared of the observations to the selected map realization or determining the maximum likelihood set of pixel values corresponding to the observations. Both of these lead to a
relatively simple linear matrix equation for the value of the map pixels M.
M = (AT N-1 A) -1 AT N-1 D
where A is the pointing matrix, N is the noise correlation matrix, and D is the set of data observations.
A similar linear algebra matrix equation provides the pixel-pixel error correlation matrix Y.
Y = (AT N-1 A) -1

The generation of the map is can then be done by a bruet force solution of these equations. However, when one gets to data streams and maps which are quite large, the computational costs are quite large.
The solution to the two linear equations is broken into three steps.
Given an original data stream with Nt  time ordered observations to generate an Np-pixel map of the sky temperature M=[\Deltap] and a measure of the pixel-pixel correlations in the noise Y=[Npq] requires the following the computational resources and time:
 Calculation Disk RAM Flops Serial CPU Time  MAXIMA Serial CPU Time  MAP Serial CPU Time  PLANCK Y=[Npq] 4 Nt2 16 Nt 2 NpNt2 14 years 2.6 x 108 yrs 4 x 1010 yrs Z=AT N-1 D 4 Nt2 16 Nt 2 Nt2 4 hours 260 years 4,130 yrs M=(Y-1)-1D 4 Np2 8 Np2 8/3  Np3 37 hours 150 years 1.4 x 105 yrs Brute Force Solution
assuming that

1. all the necessary matrices are simultaneously stored on disc in single (4-byte) precision.
2. matrices are loaded into memory no more than two at a time in double (8-byte) precision.
A short paper outlining the implementation of algorithms for generating sky temperature map can be found here and at here for more details.

# Timing with Pixel and Observation Noise Properties Defined

1. If we can make approximations that exploit symmetry, pixel approximations, and use knowledge of the time-ordered
2. noise autocorrelation properties we can shorten the time and resources required.
The first major assumption it that the pointing matrix A can be simplified to be generally zero - i.e. zero for all pixels not being
directly observed and 1 for the pixel being most directly observed. This is an approximation to the true response which is a convolution of the beam pattern on the sky. If the pixels are small enough, then the deconvolution could be performed after the map was generated. This will be an approximation and a trade-off, since simplifying the pointing matrix can be exploited to save
time and storage greatly but later the larger number of pixels required as a result will require vastly greater computing time
and space. We may have to solve, fix, and then coarsen for the next stage of data analysis.

The second major assumption is that the noise autocorrelation function effectively goes to zero (actually it is treated formally this way) outside of a time tau which is much shorter than the data stream time ttotal.

 Calculation Disk RAM Flops Serial CPU Time  MAXIMA Serial CPU Time  MAP Serial CPU Time  PLANCK Y=[Npq] 4 Np2 8 Np2 2 tau Nt 12 hours 4.5 months 3 years Z=AT N-1 D 4 Np2 8 Np2 4 tau  Nt 20 hours 9 months 6 years M=(Y-1)-1D 4 Np2 8 Np2 8/3  Np3 37 hours 150 years 1.4 x 105 yrs Solution Small Pixel Finite Noise Correrlation Time dominated by data transfer 0.5 hours few days few days
assuming that tau is of order a few hours