Changeset 3037 in Sophya for trunk/SophyaLib/Manual


Ignore:
Timestamp:
Jul 18, 2006, 12:28:30 PM (19 years ago)
Author:
ansari
Message:

doc SophyaOverview complete en vue du tag V2 , Reza 18/7/2006

File:
1 edited

Legend:

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

    r3034 r3037  
    162162Information on Xephem can be found at : \\
    163163\href{http://www.clearskyinstitute.com/xephem/}{http://www.clearskyinstitute.com/xephem/}
    164 \item[] {\bf MinuitAdapt/} Wrapper classes to CERN minimization routines (Minuit).
     164\item[] {\bf MinuitAdapt/} Wrapper classes to CERN minimization routines (Minuit).  \\
     165\href{http://wwwinfo.cern.ch/asdoc/minuit/minmain.html}{http://wwwinfo.cern.ch/asdoc/minuit/minmain.html}
    165166
    166167\end{itemize}
     
    270271
    271272\subsection{the runcxx program}
    272 \index{runcxx}
     273\index{runcxx} \label{runcxx}
    273274{\bf runcxx} is a simple program which can be used to compile, link
    274275and run simple C++ programs. It handles the creation of a
     
    306307
    307308\subsection{the scanppf program}
     309\index{scanppf} \label{scanppf}
    308310{\bf scanppf} is a simple SOPHYA application which can be used to check
    309311PPF files and list their contents. It can also provide the list of all registered
     
    323325\end{verbatim}
    324326
    325 \subsection{the scanppf program}
     327\subsection{the scanfits program}
     328\index{scanfits} \label{scanfits}
    326329{\bf scanfits} is a SOPHYA program using the FitsIOServer
    327330\footnote{FitsIOServer module uses the cfitsio library. scanfits has to be linked with
     
    333336\begin{verbatim}
    334337csh> scanfits -h
    335  SophyaInitiator::SophyaInitiator() BaseTools Init
    336338 PIOPersist::Initialize() Starting Sophya Persistence management service
    337 SOPHYA Version  1.9 Revision 33 (V_Mar2006) -- Apr  3 2006 14:04:07 gcc 3.3 20030304 (Apple Computer, Inc. build 1495)
     339SOPHYA Version  2.0 Revision 0 (V_Jul2006) -- Jul 17 2006 14:13:27 cxx
    338340 Usage: scanfits [flags] filename
    339341 flags = -V1 -lh -rd -header
     
    582584
    583585\subsection{\tcls{SegDataBlock} , \tcls{SwSegDataBlock}}
     586\index{\tcls{SegDataBlock}}  \index{\tcls{SwSegDataBlock}}
     587%%
    584588\begin{figure}[hbt]
    585589\dclsccc{AnyDataObj}{\tcls{SegDBInterface}}{ \tcls{SegDataBlock} }
     
    705709\end{verbatim}
    706710
     711\subsection{Arithmetic operations}
     712The four usual arithmetic operators ({\bf  + \, - \, * \, / }) are defined
     713to perform constant addition, subtraction, multiplication and division.
     714The three operators ({\bf  + \, - \, / }) between two arrays of the same type
     715are defined to perform element by element addition, subtraction
     716and division. In order to avoid confusion with matrix multiplication,
     717element by element multiplication is defined by overloading the
     718operator {\bf \, \&\& \, }, as shown in the example below:
     719\begin{verbatim}
     720TArray<int_4> a(4,3), b(4,3), c , d, e;
     721a = RegularSequence(1.,1.);
     722b = RegularSequence(10.,10.);
     723cout << a << b ;
     724c = a && b;
     725d = c / a;
     726e = (c / b) - a;
     727cout << c << d << e;
     728\end{verbatim}
     729
    707730\subsection{Matrices and vectors}
    708731\index{\tcls{TMatrix}}  \index{\tcls{TVector}}
     
    849872as well as to files in FITS format.
    850873FITS format input/output is provided through the classes in
    851 {\bf FitsIOServer} module. Onnly arrays with data types
     874{\bf FitsIOServer} module. Only arrays with data types
    852875supported by the FITS standard can be handled during
    853876I/O operations to and from FITS streams (See the FitsIOServer section
     
    11971220   #include "datatable.h"
    11981221   // ...
     1222   {
    11991223   DataTable dt(64);
    12001224   dt.AddFloatColumn("X0_f");
     
    12111235   POutPersist po("dtable.ppf");
    12121236   po << dt ;
    1213 
     1237   }
    12141238\end{verbatim}
    12151239
     
    15031527\subsection{Resource usage (CPU, memory \ldots) }
    15041528 The class {\bf ResourceUsage} \index{ResourceUsage}
    1505 and {\bf Timer} {\index{Timer} provides access to information
     1529and {\bf Timer} \index{Timer} provides access to information
    15061530about various resource usage (memory, CPU, ...).
    1507 The class {\bf Timer} {\index{time (CPU, elapsed)} and c-functions
     1531The class {\bf Timer} \index{time (CPU, elapsed)} and c-functions
    15081532{\tt InitTim() , PrtTim(const char * Comm) } can be used to print
    15091533the amount of CPU and elapsed time in programs.
     
    15211545
    15221546\subsection{Thread management classes}
    1523 A basic interface to POSIX threads \index{thread} is also provided
     1547\index{ZThread} \index{ZMutex}
     1548A basic interface to POSIX threads is also provided
    15241549through the \index{threads} {\bf ZThread}, {\bf ZMutex} and {\bf ZSync}
    15251550classes. The best way to use thread management classes is by inheriting
     
    17081733
    17091734\subsection{Module SkyT}
    1710 \index{RadSpectra} \index{SpectralResponse} \index
     1735\index{RadSpectra} \index{SpectralResponse}
    17111736The SkyT module is composed of two types of classes:
    17121737\begin{itemize}
     
    17431768\newpage
    17441769\section{Module FitsIOServer}
    1745 \subsection{FITS streams}
    1746 \index{FITS} \index{FitsInFile} \index{FitsOutFile}
    1747 This module provides classes for handling file input-output in FITS format using the cfitsio library. Its
     1770This module provides classes for handling file input-output in FITS
     1771\footnote{http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html}
     1772format using the cfitsio library. Its
    17481773design is similar to  the SOPHYA persistence (see Module BaseTools).
    17491774Delegate classes or handlers perform the actual read/write from/to fits files.
     1775\par
    17501776Compared to the SOPHYA native persistence (PPF format),
    17511777FITS format has the advantage of being used extensively, and handled
     
    17551781many SOPHYA objects can be saved in FITS files, FITS persistence has
    17561782some limitations. For example, FITS does not currently handle complex arrays.
    1757 \par
     1783\subsection{FITS streams}
     1784\index{FITS} \index{FitsInOutFile}
     1785%%
    17581786The class {\bf FitsInOutFile} can be seen as a wrapper class for the cfitsio library functions. 
    17591787This class has been introduced in 2005 (V=1.9), when the module has been
    17601788extensively  changed. In order to keep backward compatibility, the old fits wrapper
    1761 classes ({\bf  FitsFile, FitsInFile, FitsOutFile} has been changed to inherit from
     1789classes ({\bf  FitsFile, FitsInFile, FitsOutFile}) has been changed to inherit from
    17621790 {\bf FitsInOutFile}.  The use of class FitsFile and specific services of these old classes
    17631791 should  be avoided, but FitsInFile, FitsOutFile can be safely considered a specialisation
    17641792 of FitsInOutFile for read/input and write/output operations respectively.
     1793 Most c-fitsio errors are converted to an exception: {\bf FitsIOException}.
     1794 \par
     1795 File names are passed to cfitsio library. It is thus possible to use cfitsio file name conventions,
     1796 such as {\bf ! } as the first character, for overwriting existing files (when creating files).
    17651797 The diagram below shows the class hierarchy for cfitsio wrapper classes.
    17661798\begin{figure}[hbt]
     
    17711803%%%%
    17721804\subsection{FITS handlers}
     1805\index{FitsManager}
    17731806Handlers classes inheriting from {\bf FitsHandlerInterface} perform write/read operations
    17741807for AnyDataObj objects to/from FitsInOutFile streams. The {\bf FitsManager} class provides
    17751808top level services for object read/write in FITS files.
    1776 In most cases, \\
    1777 {\tt FitsInOutFile\& $<<$ } and  {\tt FitsInOutFile\& $>>$ } or  \\
    1778  {\tt FitsOutFile\& $<<$ } and  {\tt FitsInFile\& $>>$ }  \\
    1779  operators can be used
    1780 write and read objects.  The two main types of fits data structures, images and tables
     1809\par  In most cases,
     1810\hspace{5mm} {\tt FitsInOutFile\& $<<$ } \, and \,  {\tt FitsInOutFile\& $>>$ } \hspace{5mm}
     1811operators can be used to write and read objects. 
     1812\par
     1813The two main types of fits data structures, images and tables
    17811814{\tt (IMAGE\_HDU , BINARY\_TBL , ASCII\_TBL)} are handled by the generic handlers: \\
    1782 {\bf \tcls{FitsArrayHandler}}  and {\bf FitsHandler$<$BaseDataTable$>$}.  \\
     1815{\bf \tcls{FitsArrayHandler}}  and {\bf FitsHandler$<$BaseDataTable$>$}. 
     1816\par
    17831817A number of more specific handlers are also available, in particular for NTuple,
    17841818\tcls{SphereHealPix} and \tcls{SphereThetaPhi}.  \\[2mm]
     
    17881822through the {\bf FitsManager} class. \\[2mm]
    17891823%%%
    1790 The examples below illustrates the usage of FitsIOServer classes.
     1824The examples below illustrates the usage of FitsIOServer classes. They can be compiled
     1825and executed using runcxx, without the {\tt include} lines: \\[1mm]
     1826\hspace*{5mm} {\tt csh> runcxx -import SkyMap -import FitsIOServer -inc fiosinit.h }
     1827%%%
    17911828\begin{enumerate}
    17921829\item Saving an array and a HealPix map to a Fits file
     
    17941831#include "fitsioserver.h"
    17951832#include "fiosinit.h"
    1796 
    17971833// ....
    17981834{
     
    18091845sph = 48.3;
    18101846FitsManager::Write(fos, sph);
     1847// --- The << operator could have been used instead :    fos << sph;
    18111848}
    18121849\end{verbatim}
     
    18341871SphereHEALPix<r_8> sph;
    18351872FitsManager::Read(fis, sph);
    1836 fis.MoveAbsToHDU(2);
     1873// --- The >> operator could have been used instead :    fis >> sph;
    18371874sph.Show();
    18381875}
     
    18421879\item DataTable objects can be read from and written to FITS files as ASCII or
    18431880binary tables. The example belo show reading the DataTable created in the example
    1844 in section \ref{datatables} from a PPF file and saving it to a fits file;
    1845 \begin{verbatim}
     1881in section \ref{datatables} from a PPF file and saving it to a fits file.
     1882\begin{verbatim}
     1883#include "swfitsdtable.h"
     1884// ....
    18461885{
    1847 FitsIOServerInit();   //  Initialisation
    1848 FitsInOutFile fos("dtable.fits", FitsInOutFile ::Fits_Create);
     1886FitsIOServerInit();   //  FitsIOServer Initialisation
     1887//--- Reading in DataTable object from PPF file
     1888PInPersist pin("dtable.ppf");
     1889DataTable dt;
     1890pin >> dt;
     1891dt.Show();
     1892//--- Saving table to FITS
     1893FitsInOutFile fos("!dtable.fits", FitsInOutFile ::Fits_Create);
     1894fos << dt;
    18491895}
    18501896\end{verbatim}
    18511897%%%%
    18521898\end{enumerate}
    1853 
    1854 
     1899%%%
    18551900A partial class diagram of FITS persistence handling classes is shown below. The
    18561901class {\tt FitsIOhandler} conforms to the old FitsIOServer module design and
     
    18651910
    18661911\subsection{SwFitsDataTable and other classes}
    1867 
    1868 \subsection{scanfits}
    1869 
     1912\index{SwFitsDataTable}
     1913The {\bf SwFitsDataTable} class implements the BaseDataTable interface
     1914using a FITS file as swap space. Compared to SwPPFDataTable, they can be
     1915used in R/W mode (reading from the table, when it is being created / filled).
     1916They can be used in a way similar to DataTable and SwPPFDataTable.
     1917When creating the table, a {\tt FitsInOutFile } stream, opened for writing has
     1918to be passed to the creator. No further operation is needed.
     1919\begin{verbatim}
     1920// ....
     1921FitsInOutFile so("!myswtable.fits", FitsInOutFile::Fits_Create);
     1922SwFitsDataTable dt(so, 16);
     1923// define table columns
     1924dt.AddIntegerColumn("X0_i");
     1925dt.AddFloatColumn("X1_f");
     1926// ... Fill the table
     1927r_8 x[5];
     1928for(int i=0; i<63; i++) {
     1929    x[0] = (i%9)-4.;  x[1] = (i/9)-3.; 
     1930    dt.AddLine(x);
     1931}
     1932\end{verbatim}
     1933The class {\bf FitsBTNtuIntf } provide an alternative tool to read FITS tables.
     1934{\bf FitsABTColRd} , {\bf FitsABTWriter } and {\bf FitsImg2DWriter } can also
     1935be used to manipulate FITS files.
     1936\par
     1937The {\bf scanfits} program can be used to check FITS files and analyse their
     1938content (See \ref{scanfits}).
     1939
     1940%%%%   
    18701941\newpage
    18711942\section{LinAlg and IFFTW modules}
     
    19312002{\bf FitsIOServer} is the example of such a module, where the {\tt libcfitsio.a}
    19322003is used.
    1933 par
     2004\par
    19342005The object files from a given Sophya module are grouped in an archive library
    19352006with the module's name ({\tt libmodulename.a}). All Sophya modules
     
    19402011Alternatively, it is possible to group all modules in a single shared
    19412012library {\tt libAsophyaextPI.so}.
     2013\par
     2014Each library module has a {\tt Makefile} which compiles the source files
     2015and build the correspond static (archive) library using the compilation
     2016rules and flags defined in {\tt \$SOPHYABASE/include/sophyamake.inc}.
     2017Each program module has a {\tt Makefile} which compiles and link the
     2018corresponding programs using the compilation rules and libraries
     2019defined in {\$SOPHYABASE/include/sophyamake.inc}.
     2020The top level Makefile in BuildMgr/ compiles each library modules
     2021and builds shared libraries.
     2022\par
     2023The series of Makefiles use the link to {\tt sophyamake.inc} in BuildMgr.
     2024There are also the {\tt smakefile} series which uses the explicit path, using
     2025{\tt \$SOPHYABASE} environment variable.
    19422026
    19432027\subsection{Installation}
     
    20502134\end{verbatim}
    20512135
    2052 \subsection{Platform specific notes }
     2136If no further modification or update of source files is foreseen, it is possible
     2137to remove all .o files:
     2138\begin{verbatim}
     2139#  To clean $SOPHYABASE/obj directory :
     2140csh> make cleanobj
     2141\end{verbatim}
     2142
     2143
     2144\subsection{Notes}
    20532145\begin{itemize}
     2146\item[{\bf Makefile}] List of top level Makefile build targets
     2147\begin{verbatim}
     2148> libs extlibs PI = all
     2149> slb slbext slbpi = slball    (OR = slballinone)
     2150> clean  cleanobj
     2151> tests prgutil prgmap progpi = prgall
     2152> basetests piapp (ou progpi)  pmixer
     2153\end{verbatim}
     2154\item[{\bf MacOS X}] A high performance mathematic and signal processing
     2155library, including LAPACK and BLAS is packaged in Darwin/MacOS X (10.3, 10.4) : \\
     2156\hspace*{5mm} {\bf -framework Accelerate}
     2157\item[{\bf Tru64/OSF}] An optimised math library with LAPACK and BLAS might
     2158optionaly be installed {\bf (-lcxlm) }. On our system, this libray contained Lapack V2.
     2159So we used the LAPACK, as compiled from the public sources, and linked with
     2160the Tru64 native BLAS.
     2161\item[{\bf  IRIX64}] We used the math library with LAPACK V2 and BLAS
     2162from SGI : {\bf -lcomplib.sgimath}
    20542163\item[{\bf AIX}] There seem to be a problem on AIX when several shared
    20552164libraries are used. We have been able to run SOPHYA programs either
    20562165using static libraries, or a single shared library (libAsophyaextPI.so)
    20572166if extlibs and PI are needed, in addition to stand alone SOPHYA modules.
     2167It has not been possible to link SOPHYA with fortran libraries
     2168\item[{\bf Mgr}] This module contains makefiles and build scripts
     2169that were used in SOPHYA up to version 1.7 (2004) : OBSOLETE.
    20582170\end{itemize}
    20592171
     
    20772189\end{itemize}
    20782190
    2079 \noindent {\large \bf NOTE}  \hspace{5mm}
    2080 The {\bf Mgr} module contains makefiles and build scripts
    2081 whih were used in SOPHYA up to version 1.7 (2004).
    2082 It should not be used anymore.
    20832191
    20842192
Note: See TracChangeset for help on using the changeset viewer.