Index: /trunk/SophyaLib/Manual/sophya.tex
===================================================================
--- /trunk/SophyaLib/Manual/sophya.tex	(revision 1386)
+++ /trunk/SophyaLib/Manual/sophya.tex	(revision 1387)
@@ -694,4 +694,61 @@
 
 \section{Module SkyMap}
+\begin{figure}[hbt]
+\dclsbb{AnyDataObj}{PixelMap}
+\dclsccc{PixelMap}{Sphericalmap}{SphereHEALPix}
+\dclsc{SphereThetaPhi}
+\dclsb{LocalMap}
+\caption{partial class diagram for pixelization classes  in Sophya}
+\end{figure}
+The {\bf SkyMap} module provides classes for creating, filling, reading pixelized spherical  and 2D-maps. The types of values stored in pixels can be int, float, double , complex etc. according to the specialization of the template type. 
+\subsection {Spherical maps}
+There are two kinds of spherical maps according pixelization algorithms. SphereHEALPix represents spheres pixelized following the HEALPIix algorithm (E. Yvon, K. Gorski), SphereThetaPhi represents spheres pixelized following an algorithm developed at LAL-ORSAY. The example below shows creating and filling of a SphereHEALPix with nside = 8 (it will be 12*8*8= 768 pixels) :
+
+\begin{verbatim}
+#include ``spherehealpix.h''
+// ...
+SphereHEALPix<double> sph(8);
+for (int k=0; k< sph.NbPixels(); k++) sph(k) = (double)(10*k);
+\end{verbatim}
+
+SphereThetaPhi is used in a similar way with an argument representing number of slices in theta (Euler angle) for an hemisphere.
+\subsection {Local maps}
+A local map is a 2 dimensional array, with i as column index and j as row index. The map is supposed to lie on a plan tangent to the celestial sphere in a point whose coordinates are (x0,y0) on the local map and (theta0, phi0) on the sphere. The range of the map is defined by two values of angles covered respectively by all the pixels in x direction and all the pixels in y direction (SetSize()). Default value of (x0, y0) is middle of the map, center of pixel(nx/2, ny/2).
+
+Internally, a map is first defined within this reference plane and tranported until the point (theta0, phi0) in such a way that both axes are kept parallel to meridian and parallel lines of the sphere. The user can define its own map with axes rotated with respect to reference axes (this rotation is characterized by angle between the local parallel line and the wanted x-axis-- method SetOrigin(...))
+
+The example below shows creating and filling of a LocalMap with 4 columns and 5 rows. The origin is set to default. The map covers a sphere portion defined by two angles of 30. degrees (methods \textit{SetOrigin()} and \textit{SetSize()} must be called in order to completely define the map).
+\begin{verbatim}
+#include "localmap.h"  
+//..............       
+  LocalMap<r_4> locmap(4,5);
+  for (int k=0; k<locmap.NbPixels();k++) locmap(k)=10.*k;
+  locmap.SetOrigin();
+  locmap.SetSize(30.,30.);
+\end{verbatim}
+
+\subsection{Writing, viewing \dots }
+
+All these objects have been design to be written to or read from a persistant file.
+The following example shows how to write the previously created objects
+into such a file~:
+\begin{verbatim}
+//-- Writing
+
+#include "fiospherehealpix.h" 
+//................
+
+char *fileout = "myfile.ppf";
+POutPersist outppf(fileout);
+FIO_SphereHEALPix<r_8> outsph(sph);
+outsph.Write(outppf);
+FIO_LocalMap<r_8> outloc(locmap);
+outloc.Write(outppf);
+
+\end{verbatim}
+
+Sophya graphical tools (spiapp) can automatically display and operate
+all these objects.
+
 
 \section{Module NTools}
@@ -806,5 +863,69 @@
 \section{Module Samba}
 
+The module provides several classes for spherical harmonic analysis. The main class is \textit{SphericalTranformServer}. It contains methods for analysis and synthesis of spherical maps. The following example fills a vector of Cl's, generate a spherical map from these Cl's. This map is analyzed back to Cl's...
+\begin{verbatim}
+#include "skymap.h"
+#include "samba.h"
+....................
+
+// Generate input spectra  a + b* l + c * gaussienne(l, 50, 20)
+int lmax = 92;
+Vector clin(lmax);
+for(int l=0; l<lmax; l++) {
+  double xx = (l-50.)/10.;
+  clin(l) = 1.e-2 -1.e-4*l + 0.1*exp(-xx*xx);
+}
+
+// Compute map from spectra
+SphericalTransformServer<r_8> ylmserver;
+int m = 128;  // HealPix pixelisation parameter
+SphereHEALPix<r_8> map(m);
+ylmserver.GenerateFromCl(map, m,  clin, 0.);
+// Compute power spectrum from map
+Vector clout = ylmserver.DecomposeToCl(map, lmax,  0.);
+\end{verbatim}
+
 \section{Module SkyT}
+
+\section{Module FitsIOServer}
+\begin{figure}[hbt]
+\dclsbb{FitsFile}{FitsInFile}
+\dclsb{FitsOutFile}
+\end{figure}
+
+This module provides classes for handling file input-output in FITS format using the cfitsio library. It works like the SOPHYA persistence (see Module SysTools), using delegate objects, but its design is simpler. The following example  writes a matrix (see module TArray) and a spherical map (see module SkyMap)  on a FITS file and reads back from FITS file and creates new objects :
+\begin{verbatim}
+#include "spherehealpix.h"   
+#include "fitsspherehealpix.h" 
+#include "fitstarray.h" 
+#include "tmatrix.h" 
+//...........................
+
+int m=...;
+SphereHEALPix<r_8> sph(m);
+................
+int dim1=...;
+int dim2=...;
+TMatrix<r_8> mat(dim1,dim2);
+............
+
+FITS_SphereHEALPix<r_8> sph_temp(sph);
+FITS_TArray<r_8> mat_temp(mat);
+// writing
+
+FitsOutFile os("myfile.fits");
+sph_temp.Write(os);
+mat_temp.Write(os);
+
+// reading
+FitsInFile is("myfile.fits");
+sph_temp.Read(is);
+mat_temp.Read(is);
+SphereHEALPix<r_8> new_sph=(SphereHEALPix<r_8>)sph_temp;
+TMatrix<r_8> new_mat=(TMatrix<r_8>)mat_temp;
+................ 
+      
+\end{verbatim}
+
 
 
