Changeset 3037 in Sophya for trunk/SophyaLib/Manual
- Timestamp:
- Jul 18, 2006, 12:28:30 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Manual/sophya.tex
r3034 r3037 162 162 Information on Xephem can be found at : \\ 163 163 \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} 165 166 166 167 \end{itemize} … … 270 271 271 272 \subsection{the runcxx program} 272 \index{runcxx} 273 \index{runcxx} \label{runcxx} 273 274 {\bf runcxx} is a simple program which can be used to compile, link 274 275 and run simple C++ programs. It handles the creation of a … … 306 307 307 308 \subsection{the scanppf program} 309 \index{scanppf} \label{scanppf} 308 310 {\bf scanppf} is a simple SOPHYA application which can be used to check 309 311 PPF files and list their contents. It can also provide the list of all registered … … 323 325 \end{verbatim} 324 326 325 \subsection{the scanppf program} 327 \subsection{the scanfits program} 328 \index{scanfits} \label{scanfits} 326 329 {\bf scanfits} is a SOPHYA program using the FitsIOServer 327 330 \footnote{FitsIOServer module uses the cfitsio library. scanfits has to be linked with … … 333 336 \begin{verbatim} 334 337 csh> scanfits -h 335 SophyaInitiator::SophyaInitiator() BaseTools Init336 338 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)339 SOPHYA Version 2.0 Revision 0 (V_Jul2006) -- Jul 17 2006 14:13:27 cxx 338 340 Usage: scanfits [flags] filename 339 341 flags = -V1 -lh -rd -header … … 582 584 583 585 \subsection{\tcls{SegDataBlock} , \tcls{SwSegDataBlock}} 586 \index{\tcls{SegDataBlock}} \index{\tcls{SwSegDataBlock}} 587 %% 584 588 \begin{figure}[hbt] 585 589 \dclsccc{AnyDataObj}{\tcls{SegDBInterface}}{ \tcls{SegDataBlock} } … … 705 709 \end{verbatim} 706 710 711 \subsection{Arithmetic operations} 712 The four usual arithmetic operators ({\bf + \, - \, * \, / }) are defined 713 to perform constant addition, subtraction, multiplication and division. 714 The three operators ({\bf + \, - \, / }) between two arrays of the same type 715 are defined to perform element by element addition, subtraction 716 and division. In order to avoid confusion with matrix multiplication, 717 element by element multiplication is defined by overloading the 718 operator {\bf \, \&\& \, }, as shown in the example below: 719 \begin{verbatim} 720 TArray<int_4> a(4,3), b(4,3), c , d, e; 721 a = RegularSequence(1.,1.); 722 b = RegularSequence(10.,10.); 723 cout << a << b ; 724 c = a && b; 725 d = c / a; 726 e = (c / b) - a; 727 cout << c << d << e; 728 \end{verbatim} 729 707 730 \subsection{Matrices and vectors} 708 731 \index{\tcls{TMatrix}} \index{\tcls{TVector}} … … 849 872 as well as to files in FITS format. 850 873 FITS format input/output is provided through the classes in 851 {\bf FitsIOServer} module. On nly arrays with data types874 {\bf FitsIOServer} module. Only arrays with data types 852 875 supported by the FITS standard can be handled during 853 876 I/O operations to and from FITS streams (See the FitsIOServer section … … 1197 1220 #include "datatable.h" 1198 1221 // ... 1222 { 1199 1223 DataTable dt(64); 1200 1224 dt.AddFloatColumn("X0_f"); … … 1211 1235 POutPersist po("dtable.ppf"); 1212 1236 po << dt ; 1213 1237 } 1214 1238 \end{verbatim} 1215 1239 … … 1503 1527 \subsection{Resource usage (CPU, memory \ldots) } 1504 1528 The class {\bf ResourceUsage} \index{ResourceUsage} 1505 and {\bf Timer} {\index{Timer} provides access to information1529 and {\bf Timer} \index{Timer} provides access to information 1506 1530 about various resource usage (memory, CPU, ...). 1507 The class {\bf Timer} {\index{time (CPU, elapsed)} and c-functions1531 The class {\bf Timer} \index{time (CPU, elapsed)} and c-functions 1508 1532 {\tt InitTim() , PrtTim(const char * Comm) } can be used to print 1509 1533 the amount of CPU and elapsed time in programs. … … 1521 1545 1522 1546 \subsection{Thread management classes} 1523 A basic interface to POSIX threads \index{thread} is also provided 1547 \index{ZThread} \index{ZMutex} 1548 A basic interface to POSIX threads is also provided 1524 1549 through the \index{threads} {\bf ZThread}, {\bf ZMutex} and {\bf ZSync} 1525 1550 classes. The best way to use thread management classes is by inheriting … … 1708 1733 1709 1734 \subsection{Module SkyT} 1710 \index{RadSpectra} \index{SpectralResponse} \index1735 \index{RadSpectra} \index{SpectralResponse} 1711 1736 The SkyT module is composed of two types of classes: 1712 1737 \begin{itemize} … … 1743 1768 \newpage 1744 1769 \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 FITSformat using the cfitsio library. Its1770 This module provides classes for handling file input-output in FITS 1771 \footnote{http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html} 1772 format using the cfitsio library. Its 1748 1773 design is similar to the SOPHYA persistence (see Module BaseTools). 1749 1774 Delegate classes or handlers perform the actual read/write from/to fits files. 1775 \par 1750 1776 Compared to the SOPHYA native persistence (PPF format), 1751 1777 FITS format has the advantage of being used extensively, and handled … … 1755 1781 many SOPHYA objects can be saved in FITS files, FITS persistence has 1756 1782 some limitations. For example, FITS does not currently handle complex arrays. 1757 \par 1783 \subsection{FITS streams} 1784 \index{FITS} \index{FitsInOutFile} 1785 %% 1758 1786 The class {\bf FitsInOutFile} can be seen as a wrapper class for the cfitsio library functions. 1759 1787 This class has been introduced in 2005 (V=1.9), when the module has been 1760 1788 extensively changed. In order to keep backward compatibility, the old fits wrapper 1761 classes ({\bf FitsFile, FitsInFile, FitsOutFile} has been changed to inherit from1789 classes ({\bf FitsFile, FitsInFile, FitsOutFile}) has been changed to inherit from 1762 1790 {\bf FitsInOutFile}. The use of class FitsFile and specific services of these old classes 1763 1791 should be avoided, but FitsInFile, FitsOutFile can be safely considered a specialisation 1764 1792 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). 1765 1797 The diagram below shows the class hierarchy for cfitsio wrapper classes. 1766 1798 \begin{figure}[hbt] … … 1771 1803 %%%% 1772 1804 \subsection{FITS handlers} 1805 \index{FitsManager} 1773 1806 Handlers classes inheriting from {\bf FitsHandlerInterface} perform write/read operations 1774 1807 for AnyDataObj objects to/from FitsInOutFile streams. The {\bf FitsManager} class provides 1775 1808 top 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 tables1809 \par In most cases, 1810 \hspace{5mm} {\tt FitsInOutFile\& $<<$ } \, and \, {\tt FitsInOutFile\& $>>$ } \hspace{5mm} 1811 operators can be used to write and read objects. 1812 \par 1813 The two main types of fits data structures, images and tables 1781 1814 {\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 1783 1817 A number of more specific handlers are also available, in particular for NTuple, 1784 1818 \tcls{SphereHealPix} and \tcls{SphereThetaPhi}. \\[2mm] … … 1788 1822 through the {\bf FitsManager} class. \\[2mm] 1789 1823 %%% 1790 The examples below illustrates the usage of FitsIOServer classes. 1824 The examples below illustrates the usage of FitsIOServer classes. They can be compiled 1825 and executed using runcxx, without the {\tt include} lines: \\[1mm] 1826 \hspace*{5mm} {\tt csh> runcxx -import SkyMap -import FitsIOServer -inc fiosinit.h } 1827 %%% 1791 1828 \begin{enumerate} 1792 1829 \item Saving an array and a HealPix map to a Fits file … … 1794 1831 #include "fitsioserver.h" 1795 1832 #include "fiosinit.h" 1796 1797 1833 // .... 1798 1834 { … … 1809 1845 sph = 48.3; 1810 1846 FitsManager::Write(fos, sph); 1847 // --- The << operator could have been used instead : fos << sph; 1811 1848 } 1812 1849 \end{verbatim} … … 1834 1871 SphereHEALPix<r_8> sph; 1835 1872 FitsManager::Read(fis, sph); 1836 fis.MoveAbsToHDU(2);1873 // --- The >> operator could have been used instead : fis >> sph; 1837 1874 sph.Show(); 1838 1875 } … … 1842 1879 \item DataTable objects can be read from and written to FITS files as ASCII or 1843 1880 binary 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} 1881 in section \ref{datatables} from a PPF file and saving it to a fits file. 1882 \begin{verbatim} 1883 #include "swfitsdtable.h" 1884 // .... 1846 1885 { 1847 FitsIOServerInit(); // Initialisation 1848 FitsInOutFile fos("dtable.fits", FitsInOutFile ::Fits_Create); 1886 FitsIOServerInit(); // FitsIOServer Initialisation 1887 //--- Reading in DataTable object from PPF file 1888 PInPersist pin("dtable.ppf"); 1889 DataTable dt; 1890 pin >> dt; 1891 dt.Show(); 1892 //--- Saving table to FITS 1893 FitsInOutFile fos("!dtable.fits", FitsInOutFile ::Fits_Create); 1894 fos << dt; 1849 1895 } 1850 1896 \end{verbatim} 1851 1897 %%%% 1852 1898 \end{enumerate} 1853 1854 1899 %%% 1855 1900 A partial class diagram of FITS persistence handling classes is shown below. The 1856 1901 class {\tt FitsIOhandler} conforms to the old FitsIOServer module design and … … 1865 1910 1866 1911 \subsection{SwFitsDataTable and other classes} 1867 1868 \subsection{scanfits} 1869 1912 \index{SwFitsDataTable} 1913 The {\bf SwFitsDataTable} class implements the BaseDataTable interface 1914 using a FITS file as swap space. Compared to SwPPFDataTable, they can be 1915 used in R/W mode (reading from the table, when it is being created / filled). 1916 They can be used in a way similar to DataTable and SwPPFDataTable. 1917 When creating the table, a {\tt FitsInOutFile } stream, opened for writing has 1918 to be passed to the creator. No further operation is needed. 1919 \begin{verbatim} 1920 // .... 1921 FitsInOutFile so("!myswtable.fits", FitsInOutFile::Fits_Create); 1922 SwFitsDataTable dt(so, 16); 1923 // define table columns 1924 dt.AddIntegerColumn("X0_i"); 1925 dt.AddFloatColumn("X1_f"); 1926 // ... Fill the table 1927 r_8 x[5]; 1928 for(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} 1933 The class {\bf FitsBTNtuIntf } provide an alternative tool to read FITS tables. 1934 {\bf FitsABTColRd} , {\bf FitsABTWriter } and {\bf FitsImg2DWriter } can also 1935 be used to manipulate FITS files. 1936 \par 1937 The {\bf scanfits} program can be used to check FITS files and analyse their 1938 content (See \ref{scanfits}). 1939 1940 %%%% 1870 1941 \newpage 1871 1942 \section{LinAlg and IFFTW modules} … … 1931 2002 {\bf FitsIOServer} is the example of such a module, where the {\tt libcfitsio.a} 1932 2003 is used. 1933 par2004 \par 1934 2005 The object files from a given Sophya module are grouped in an archive library 1935 2006 with the module's name ({\tt libmodulename.a}). All Sophya modules … … 1940 2011 Alternatively, it is possible to group all modules in a single shared 1941 2012 library {\tt libAsophyaextPI.so}. 2013 \par 2014 Each library module has a {\tt Makefile} which compiles the source files 2015 and build the correspond static (archive) library using the compilation 2016 rules and flags defined in {\tt \$SOPHYABASE/include/sophyamake.inc}. 2017 Each program module has a {\tt Makefile} which compiles and link the 2018 corresponding programs using the compilation rules and libraries 2019 defined in {\$SOPHYABASE/include/sophyamake.inc}. 2020 The top level Makefile in BuildMgr/ compiles each library modules 2021 and builds shared libraries. 2022 \par 2023 The series of Makefiles use the link to {\tt sophyamake.inc} in BuildMgr. 2024 There are also the {\tt smakefile} series which uses the explicit path, using 2025 {\tt \$SOPHYABASE} environment variable. 1942 2026 1943 2027 \subsection{Installation} … … 2050 2134 \end{verbatim} 2051 2135 2052 \subsection{Platform specific notes } 2136 If no further modification or update of source files is foreseen, it is possible 2137 to remove all .o files: 2138 \begin{verbatim} 2139 # To clean $SOPHYABASE/obj directory : 2140 csh> make cleanobj 2141 \end{verbatim} 2142 2143 2144 \subsection{Notes} 2053 2145 \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 2155 library, 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 2158 optionaly be installed {\bf (-lcxlm) }. On our system, this libray contained Lapack V2. 2159 So we used the LAPACK, as compiled from the public sources, and linked with 2160 the Tru64 native BLAS. 2161 \item[{\bf IRIX64}] We used the math library with LAPACK V2 and BLAS 2162 from SGI : {\bf -lcomplib.sgimath} 2054 2163 \item[{\bf AIX}] There seem to be a problem on AIX when several shared 2055 2164 libraries are used. We have been able to run SOPHYA programs either 2056 2165 using static libraries, or a single shared library (libAsophyaextPI.so) 2057 2166 if extlibs and PI are needed, in addition to stand alone SOPHYA modules. 2167 It has not been possible to link SOPHYA with fortran libraries 2168 \item[{\bf Mgr}] This module contains makefiles and build scripts 2169 that were used in SOPHYA up to version 1.7 (2004) : OBSOLETE. 2058 2170 \end{itemize} 2059 2171 … … 2077 2189 \end{itemize} 2078 2190 2079 \noindent {\large \bf NOTE} \hspace{5mm}2080 The {\bf Mgr} module contains makefiles and build scripts2081 whih were used in SOPHYA up to version 1.7 (2004).2082 It should not be used anymore.2083 2191 2084 2192
Note:
See TracChangeset
for help on using the changeset viewer.