- Timestamp:
- Feb 22, 2001, 4:09:11 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Manual/sophya.tex
r1411 r1414 456 456 457 457 The example below shows basic usage of arrays: 458 \index{\tcls{TArray}} 458 459 \begin{verbatim} 459 460 // Creating and initializing a 1-D array of integers … … 515 516 \end{verbatim} 516 517 517 This module contains also simple Gauss matrix inversion algorithm 518 This module contains basic array and matrix operations 519 such as the Gauss matrix inversion algorithm 518 520 which can be used to solve linear systems, as illustrated by the 519 521 example below: … … 540 542 541 543 \subsection{Working with sub-arrays and Ranges} 544 \index{Range} 542 545 A powerful mechanism is included in array classes for working with 543 546 sub-arrays. The class {\bf Range} can be used to specify range of array … … 562 565 \end{verbatim} 563 566 567 \newpage 564 568 \subsection{Memory organisation} 565 569 {\tt \tcls{TArray} } can handle numerical arrays with various memory … … 596 600 the two matrices have the same sizes (Number of rows and columns). 597 601 The following code example and the corresponding output illustrates 598 these two memory mappings. 602 these two memory mappings. The {\tt \tcls{TMatrix}::TransposeSelf() } 603 method changes effectively the matrix memory mapping, which is also 604 the case of {\tt \tcls{TMatrix}::Transpose() } method without argument. 605 599 606 \begin{verbatim} 600 607 TArray<r_4> X(4,2); … … 606 613 cout << "Matrix X_F (FortranMemoryMapping) = " << X_F << endl; 607 614 \end{verbatim} 615 \newpage 608 616 This code would produce the following output (X\_F = Transpose(X\_C)) : 609 617 \begin{verbatim} … … 644 652 645 653 \subsection{1D Histograms} 646 654 \index{Histo} 647 655 For 1D histograms, various numerical methods are provided such as 648 656 computing means and sigmas, finding maxima, fitting, rebinning, … … 664 672 665 673 \subsection{2D Histograms} 666 674 \index{Histo2D} 667 675 Much of these operations are also valid for 2D histograms. 1D projection 668 676 or slices can be set~: … … 670 678 #include "histos2.h" 671 679 // ... 672 Histo H2(-1.,1.,100,0.,60.,50);680 Histo2D H2(-1.,1.,100,0.,60.,50); 673 681 H2.SetProjX(); // create the 1D histo for X projection 674 682 H2.SetBandX(25.,35.); // create 1D histo projection for 25.<y<35. … … 684 692 685 693 \subsection{Profile Histograms} 686 687 Profiles histograms contains the mean and the sigma of the distribution 694 \index{HProf} 695 Profiles histograms {\bf HProf} contains the mean and the 696 sigma of the distribution 688 697 of the values filled in each bin. The sigma can be changed to 689 698 the error on the mean. When filled, the profile histogram looks … … 691 700 may be applied onto profile histograms. 692 701 693 \subsection{N tuples}694 702 \subsection{NTuples} 703 \index{NTuple} 695 704 NTuple are memory resident tables of 32 bits floating values (float). 696 705 They are arranged in columns. Each line is often called an event. … … 716 725 \end{verbatim} 717 726 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). 727 XNTuple are sophisticated NTuple : they accept various types 728 of column values (double,float,int,string,...) and can handle 729 very large data sets, through swap space on disk. 730 \index{XNTuple} 731 In the sample code below we show how to create a XNTuple 732 object with four columns (double, double, int, string). 733 Several entries (lines) are then appended to the table, 734 which is saved to a PPF file. 735 \begin{verbatim} 736 #include "xntuple.h" 737 // ... 738 char * names[4] = {"X", "X2", "XInt","XStr"}; 739 // XNTuple (Table) creation with 4 columns, of integer, 740 // double(2) and string type 741 XNTuple xnt(2,0,1,1, names); 742 // Filling the NTuple 743 r_8 xd[2]; 744 int_4 xi[2]; 745 char xss[2][32]; 746 char * xs[2] = {xss[0], xss[1]} ; 747 for(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 753 cout << xnt ; 754 // Saving object into a PPF file 755 POutPersist po("xnt.ppf"); 756 po << xnt ; 757 \end{verbatim} 721 758 722 759 \subsection{Writing, viewing \dots } … … 740 777 all these objects. 741 778 779 \subsection{Fourier transform (FFT)} 780 \index{FFT} \index{FFTServer} 781 782 \newpage 742 783 \section{Module SkyMap} 743 784 \begin{figure}[hbt] … … 751 792 \subsection {Spherical maps} 752 793 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) : 794 \index{\tcls{SphereHEALPix}} 753 795 754 796 \begin{verbatim} … … 760 802 761 803 SphereThetaPhi 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 762 806 \subsection {Local maps} 807 \index{\tcls{LocalMap}} 763 808 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). 764 809 … … 805 850 806 851 \subsection{Fitting} 807 852 \index{Fitting} \index{Minimization} 808 853 Fitting is done with two classes {\tt GeneralFit} and {\tt GeneralFitData} 809 854 and is based on the Levenberg-Marquardt method. 855 \index{GeneralFit} \index{GeneralFitData} 810 856 GeneralFitData is a class which provide a description of the data 811 857 to be fitted. GeneralFit is the fitter class. Parametrized functions … … 870 916 871 917 \subsection{Polynomial} 872 918 \index{Polynomial} \index{Poly} \index{Poly2} 873 919 Polynomials of 1 or 2 variables are supported ({\tt Poly} and {\tt Poly2}). 874 920 Various operations are supported~: … … 909 955 910 956 \section{Module Samba} 911 957 \index{Spherical Harmonics} 958 \index{SphericalTransformServer} 912 959 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... 913 960 \begin{verbatim} … … 940 987 \dclsb{FitsOutFile} 941 988 \end{figure} 942 989 \index{FITS} 943 990 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 : 944 991 \begin{verbatim}
Note:
See TracChangeset
for help on using the changeset viewer.