Changeset 1414 in Sophya for trunk/SophyaLib/Manual


Ignore:
Timestamp:
Feb 22, 2001, 4:09:11 PM (25 years ago)
Author:
ansari
Message:

MAJ documentation - Reza 22/2/2001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Manual/sophya.tex

    r1411 r1414  
    456456
    457457The example below shows basic usage of arrays:
     458\index{\tcls{TArray}}
    458459\begin{verbatim}
    459460// Creating and initializing a 1-D array of integers
     
    515516\end{verbatim}
    516517
    517 This module contains also simple Gauss matrix inversion algorithm
     518This module contains basic array and matrix operations
     519such as the Gauss matrix inversion algorithm
    518520which can be used to solve linear systems, as illustrated by the
    519521example below:
     
    540542
    541543\subsection{Working with sub-arrays and Ranges}
     544\index{Range}
    542545A powerful mechanism is included in array classes for working with
    543546sub-arrays. The class {\bf Range} can be used to specify range of array
     
    562565\end{verbatim}
    563566
     567\newpage
    564568\subsection{Memory organisation}
    565569{\tt \tcls{TArray} } can handle numerical arrays with various memory
     
    596600the two matrices have the same sizes (Number of rows and columns).
    597601The following code example and the corresponding output illustrates
    598 these two memory mappings.
     602these two memory mappings. The {\tt \tcls{TMatrix}::TransposeSelf() }
     603method changes effectively the matrix memory mapping, which is also
     604the case of {\tt \tcls{TMatrix}::Transpose() } method without argument.
     605
    599606\begin{verbatim}
    600607TArray<r_4> X(4,2);
     
    606613cout << "Matrix X_F (FortranMemoryMapping) = " << X_F << endl;
    607614\end{verbatim}
     615\newpage
    608616This code would produce the following output (X\_F = Transpose(X\_C)) :
    609617\begin{verbatim}
     
    644652
    645653\subsection{1D Histograms}
    646 
     654\index{Histo}
    647655For 1D histograms, various numerical methods are provided such as
    648656computing means and sigmas, finding maxima, fitting, rebinning,
     
    664672
    665673\subsection{2D Histograms}
    666 
     674\index{Histo2D}
    667675Much of these operations are also valid for 2D histograms. 1D projection
    668676or slices can be set~:
     
    670678#include "histos2.h"
    671679// ...
    672 Histo H2(-1.,1.,100,0.,60.,50);
     680Histo2D H2(-1.,1.,100,0.,60.,50);
    673681H2.SetProjX(); // create the 1D histo for X projection
    674682H2.SetBandX(25.,35.); // create 1D histo  projection for 25.<y<35.
     
    684692
    685693\subsection{Profile Histograms}
    686 
    687 Profiles histograms contains the mean and the sigma of the distribution
     694\index{HProf}
     695Profiles histograms {\bf HProf} contains the mean and the
     696sigma of the distribution
    688697of the values filled in each bin. The sigma can be changed to
    689698the error on the mean. When filled, the profile histogram looks
     
    691700may be applied onto profile histograms.
    692701
    693 \subsection{Ntuples}
    694 
     702\subsection{NTuples}
     703\index{NTuple}
    695704NTuple are memory resident tables of 32 bits floating values (float).
    696705They are arranged in columns. Each line is often called an event.
     
    716725\end{verbatim}
    717726
    718 XNtuple are sophisticated NTuple : they accept various types
    719 of column values (float,double,int,...) and can be as big as
    720 needed (they used buffers on hard disk).
     727XNTuple are sophisticated NTuple : they accept various types
     728of column values (double,float,int,string,...) and can handle
     729very large data sets, through swap space on disk.
     730\index{XNTuple}
     731In the sample code below we show how to create a XNTuple
     732object with four columns (double, double, int, string).
     733Several entries (lines) are then appended to the table,
     734which is saved to a PPF file.
     735\begin{verbatim}
     736#include "xntuple.h"
     737// ...
     738char * names[4] = {"X", "X2", "XInt","XStr"};
     739// XNTuple (Table) creation with 4 columns, of integer,
     740// double(2) and string type
     741XNTuple  xnt(2,0,1,1, names);
     742// Filling the NTuple
     743r_8 xd[2];
     744int_4 xi[2];
     745char xss[2][32];
     746char * xs[2] = {xss[0], xss[1]} ;
     747for(int i=0; i<50; i++) {
     748   xi[0] = i;  xd[0] = i+0.5;  xd[1] = xd[0]*xd[0];
     749   sprintf(xs[0],"X=%g", xd[0]);
     750   xnt.Fill(xd, NULL, xi, xs);
     751}
     752// Printing table info
     753cout << xnt ;
     754// Saving object into a PPF file
     755POutPersist po("xnt.ppf");
     756po << xnt ;
     757\end{verbatim}
    721758
    722759\subsection{Writing, viewing \dots }
     
    740777all these objects.
    741778
     779\subsection{Fourier transform (FFT)}
     780\index{FFT} \index{FFTServer}
     781
     782\newpage
    742783\section{Module SkyMap}
    743784\begin{figure}[hbt]
     
    751792\subsection {Spherical maps}
    752793There 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) :
     794\index{\tcls{SphereHEALPix}}
    753795
    754796\begin{verbatim}
     
    760802
    761803SphereThetaPhi is used in a similar way with an argument representing number of slices in theta (Euler angle) for an hemisphere.
     804\index{\tcls{SphereThetaPhi}}
     805
    762806\subsection {Local maps}
     807\index{\tcls{LocalMap}}
    763808A 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).
    764809
     
    805850
    806851\subsection{Fitting}
    807 
     852\index{Fitting} \index{Minimization}
    808853Fitting is done with two classes {\tt GeneralFit} and {\tt GeneralFitData}
    809854and is based on the Levenberg-Marquardt method.
     855\index{GeneralFit} \index{GeneralFitData}
    810856GeneralFitData is a class which provide a description of the data
    811857to be fitted. GeneralFit is the fitter class. Parametrized functions
     
    870916
    871917\subsection{Polynomial}
    872 
     918\index{Polynomial} \index{Poly} \index{Poly2}
    873919Polynomials of 1 or 2 variables are supported ({\tt Poly} and {\tt Poly2}).
    874920Various operations are supported~:
     
    909955
    910956\section{Module Samba}
    911 
     957\index{Spherical Harmonics}
     958\index{SphericalTransformServer}
    912959The 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...
    913960\begin{verbatim}
     
    940987\dclsb{FitsOutFile}
    941988\end{figure}
    942 
     989\index{FITS}
    943990This 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 :
    944991\begin{verbatim}
Note: See TracChangeset for help on using the changeset viewer.