Changeset 3438 in Sophya for trunk/SophyaLib/Manual


Ignore:
Timestamp:
Dec 12, 2007, 10:34:59 PM (18 years ago)
Author:
ansari
Message:

Ajout aknowledgments ds docs et + chapitre 5 ds piapp.tex (expression plotting) - Reza 12/12/2007

Location:
trunk/SophyaLib/Manual
Files:
4 edited

Legend:

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

    r3402 r3438  
    5656V = 2.0  &   \hspace{10mm}  &  Septembre 2006 - tag CVS \\
    5757V = 2.046  &   \hspace{10mm}  &  Ao\^{u}t 2007 - NO tag  \\
    58 V = 2.1  &   \hspace{10mm}  &  Novemvre 2007 - tag CVS \\
     58V = 2.1  &   \hspace{10mm}  &  Novembre 2007 - tag CVS \\
    5959
    6060\end{tabular}
     
    205205\titre{PI/piapp}
    206206\begin{itemize}
     207\item[\rond] Novembre 2007 {\bf PIext/ProgPI}: \\
     208- Ajout commande de trace d'ellipse d'erreur {\tt errorellipse} \\
     209- Axes en degres (0..360, -90..90) pour la projection molleweide et adaptation de la commande {\tt mollgrid}. Suppression de mollgridsph. \\
     210- Ajout fonctions tetphi2mollX/Y() et longlat2mollX/Y() ds les fichiers d'expressi
     211on ntuple generes par piapp pour trace sur projection de type molleweide. \\
     212- Ajout flag [-s] a openppf . openfits/savefits comme alias de readfits/writefits.
     213- Verification arret thread Reveil avant destruction de l'objet.
    207214\item[\rond] Octobre 2007 {\bf (PI/PIext)}: Ajout methodes de redirection stdout/stderr vers un objet PIConsole,
    208215a travers un fichier disque (fichiers PI/piapplx.h .cc) avec possibilite de recopie sur stdout/stderr
     
    260267pour la prise en charge des objets DVList.
    261268Accs aux variables par {\tt \$\{dvlName.varName\} }
    262 \item Accs ˆ l'objet DVList attachŽ aux TArray, TMatrix, DataTable par \\
     269\item Accs ˆ l'objet DVList attachŽ aux TArray, TMatrix, DataTable et NTuple par \\
    263270\hspace*{5mm}  {\tt \$\{objName.info.varName\} }
    264271\item L'adaptateur de DataTable permet aussi d'accŽder aux lignes de la table par \\
  • trunk/SophyaLib/Manual/piahelp.tex

    r3437 r3438  
    474474- HistoErr: i,x,val,err2,nb,_nl
    475475- Histo2DErr: i,j,x,y,val,err2,nb,_nl
    476 - Vector/Matrix: n,r,c,val,real,imag,mod,phas,_nl
     476- Vector/Matrix/Image: n,r,c,val,real,imag,mod,phas,_nl
    477477- TArray: n,x,y,z,t,u,val,real,imag,mod,phas,_nl
    478 - Image: i,j,x,y,val(=pix),_nl
    479478- GeneralFitData: x0,ex0 x1,ex1 ...  xn,exn   y,ey   ok  ,_nl
    480 - LocalMap/SphereThetaPhi/SphereHEALPix:
     479- SphereThetaPhi/SphereHEALPix/SphereECP/LocalMap:
    481480-         i,k,val,real,imag,mod,phas,teta,phi,_nl
    482481- FITS Binary/ASCII table: fits column names,_nl
     
    11891188o <Ctl>E : Command editing -> Goto the end of line
    11901189o <Ctl>K : Command editing -> Clear to the end of line
    1191 o <Ctl>C : Command editing -> Clear the line
     1190o <Ctl>C : Stop/break command execution by PIACmd/Commander
    11921191o Cursor left,right : Command editing -> Move cursor
    11931192o Cursor Up,Down : recall command from history buffer
  • trunk/SophyaLib/Manual/piapp.tex

    r3437 r3438  
    110110loaded at run time. 
    111111\end{itemize}
     112
     113\subsection{Acknowlegments}
     114Many people have contributed to the development SOPHYA and/or the PI library
     115and (s)piapp interactive analysis tool.
     116we are grateful to the following people:
     117
     118\begin{tabular}{lcl}
     119Reza Ansari & \hspace{5mm} & (LAL-Univ.Paris Sud, Orsay) \\
     120Eric Aubourg & & (DAPNIA-CEA/APC, Saclay) \\
     121Sophie Henrot-Versille & & (LAL-IN2P3/CNRS, Orsay) \\
     122Alex Kim & & (LBL, Berkeley) \\
     123Guy Le Meur & & (LAL-IN2P3/CNRS, Orsay) \\
     124Eric Lesquoy & & (DAPNIA-CEA, Saclay) \\
     125Christophe Magneville & & (DAPNIA-CEA, Saclay) \\
     126Bruno Mansoux & & (LAL-IN2P3/CNRS, Orsay) \\
     127Olivier Perdereau & & (LAL-IN2P3/CNRS, Orsay) \\
     128Nicolas Regnault & & (LPNHE-IN2P3/CNRS, Paris) \\
     129Benoit Revenu & & (APC/Univ.Paris 7, Paris) \\
     130Francois Touze & & (LAL-IN2P3/CNRS, Orsay) \\
     131\end{tabular}
     132
     133We thank also the persons who have helped us by useful suggestions, among others : \\
     134S. Bargot, S. Du, S. Plasczczynski, C. Renault and D. Yvon.
     135
    112136%%%
    113137\begin{figure}[ht!]
     
    9911015%%%%%%%%%%%%%%% Section 5 :   analyse a la paw
    9921016\newpage
    993 \section{Tables and interactive analysis}
     1017\section{Tables and Expression Plotting}
    9941018\label{tableplot}
     1019A powerful data analysis technic available in piapp is
     10202D, 3D plot, and histogramming applied to arbitrary analytical
     1021expression of table columns.
     1022This analysis technic has been introduced by the popular
     1023CERN \href{http://paw.web.cern.ch/paw/}{\bf PAW}
     1024({\bf P}hysics {\bf A}nalysis {\bf Workstation})
     1025\footnote{PAW home page : http://paw.web.cern.ch/paw/ } program
     1026and the underlying HBOOK fortran library.
     1027Compared to PAW, piapp extends in many respects this capability,
     1028piapp offers in particular the possibility to manipulate many
     1029objects as if they where a DataTable, or NTuple.
     1030There are also additional 2D and 3D representations e.g.
     1031{\tt plot2de} \myppageref{plot2de}, 
     1032{\tt plot2dw} \myppageref{plot2dw}, 
     1033{\tt plot2dc} \myppageref{plot2dc} and
     1034{\tt plot3dw} \myppageref{plot3dw}.
     1035
     1036\subsection{How does it work ?}
     1037
     1038The Expression.Plotting commands in piapp operate on objects through the
     1039{\bf NTupleInterface} class methods. Some classes like NTuple or BaseDataTable
     1040inherit from NTupleInterface, while for the other classes, the corresponding
     1041NObjMgrAdapter class exposes an object conforming to NTupleInterface through the
     1042method : \\
     1043\hspace*{5mm} {\tt  NTupleInterface* NObjMgrAdapter::GetNTupleInterface()} \\
     1044A C file (PIATmp\_xxx/expf\_pia\_dl.c) is created by piapp containing the
     1045specified expressions, which should conform to the C-language syntax.
     1046In addition to the functions in {\tt math.h} (sin, cos, log \ldots),
     1047the following functions are defined by piapp and can be used:
     1048\begin{itemize}
     1049\item Flat random number generators: {\tt drand01() , drandpm1() }
     1050\item Gaussian random number generator: {\tt GauRand() }
     1051\item Angle conversion: {\tt deg2rad(double d), rad2deg(double r) }
     1052\item $(\theta,\varphi)$ to Molleweide X,Y projection: \\
     1053\hspace*{5mm}{\tt double tetphi2mollX(double theta, double phi)} \\
     1054\hspace*{5mm}{\tt double tetphi2mollY(double theta)}
     1055\item Longitude(0..360) deg., Latitude(-90..90) deg. conversion to Molleweide X,Y: \\
     1056\hspace*{5mm}{\tt double longlat2mollX(double longit, double lat) } \\
     1057\hspace*{5mm}{\tt double longlat2mollY(double lat) }
     1058\end{itemize}
     1059
     1060The processing steps for an Expression.Plotting in piapp :
     1061\begin{enumerate}
     1062\item Creation of the C-file.
     1063\item On the fly compilation of the generated file.
     1064\item The resulting shared-object is loaded and linked with the application
     1065\item Loop over the NTupleInterface object rows. The created function is called
     1066with the data from each row
     1067\item The return values are used to fill an histogram, or a matrix/vector or
     1068another NTuple or to produce a 2D or 3D graphic display.
     1069\end{enumerate}
     1070
     1071Although rather complex, the efficiency gain during processing data easily compensates
     1072for the overhead of the compilation step.
     1073 
     1074\subsection{Column/variable names}
     1075
     1076When working with real 2-D tables (NTuple, DataTable \ldots), the column names
     1077are the name of the variables which can be used in the C-expressions.
     1078There is an additional variable, called {\tt \_nl}, automatically
     1079provided by piapp, corresponding the table row number, starting from 0.
     1080
     1081For the other objects in piapp, the variable names are listed below:
     1082\begin{itemize}
     1083\item[\rond] For 2D table objects {\bf (NTuple,DataTable,\ldots)}:  ColumnNames,\_nl
     1084\item[\rond] For FITS files opened through {\tt fitsadapt} command: FITSColumnNames,\_nl
     1085\item[\rond] For {\bf Histo1D/HProf} objects : i,x,val,err,nb,\_nl
     1086\item[\rond] For {\bf Histo2D} objects : i,j,x,y,val,err,\_nl
     1087\item[\rond] For {\bf HistoErr} objects : i,x,val,err2,nb,\_nl
     1088\item[\rond] For {\bf Histo2DErr} objects : i,j,x,y,val,err2,nb,\_nl
     1089\item[\rond] For {\bf \tcls{TVector}, \tcls{TMatrix} , \tcls{Image} } objects : \\
     1090 \hspace*{10mm}  n,r,c,val,real,imag,mod,phas,\_nl
     1091\item[\rond] For {\bf \tcls{TArray}} objects : n,x,y,z,t,u,val,real,imag,mod,phas,\_nl
     1092\item[\rond] For {\bf GeneralFitData} objects : x0,ex0 x1,ex1 ...  xn,exn  y,ey ,ok,\_nl
     1093\item[\rond] For {\bf \tcls{SphereHEALPix} , \tcls{SphereThetaPhi} , \tcls{SphereECP}
     1094\tcls{LocalMap} } objects : \hspace{10mm} i,k,val,real,imag,mod,phas,teta,phi,\_nl
     1095\end{itemize} 
    9951096
    9961097%%%%%%%%%%%%%%% Section 6 :  command interpreter
     
    10291130managed by {\bf NamedObjMgr} (See below).
    10301131
     1132\subsubsection{Interpreter/Commander variables}
    10311133\begin{itemize}
    10321134\item[\rond] {\bf Definition and initialisation of variables } 
     
    10871189
    10881190\par
    1089 
    1090 \item[\rond] {\bf Special variables }
     1191\end{itemize}
     1192
     1193\subsubsection{Special variables}
    10911194\begin{itemize}
    10921195\item {\tt \$retval} ou {\tt \$retstr}  :  the string specified in the last {\bf return} statement
     
    10981201\end{itemize}
    10991202
    1100 \item[\rond] {\bf Objects/Application level variables} \\
     1203\subsubsection{Environment variables}
     1204Environment variables can simply be accessed by {\tt \$varenvname}.
     1205However,  the environment variables have the lowest priority during substitution.
     1206Interpreter's variables have the highest priority, followed
     1207by the application level variables.
     1208
     1209\subsubsection{Objects/Application level variables}
    11011210For some classes managed by NamedObjMgr,
    11021211PIACmd provide acces to some of the attributes of the object by
     
    11071216{\tt \${vname} }  is replaced by its value, even if an interpreter variable with the
    11081217same name has been defined.
     1218\begin{itemize}
     1219\item[\rond] Accessing object attributes
    11091220\begin{verbatim}
    11101221# -------- Example with a Vector
     
    11151226#           used to get list of valid attributes
    11161227piapp[3] echo ${va.?}
    1117 TMatrix.Att: rank size/nelts nrow/nrows ncol/ncols sum
     1228TMatrix.Att: rank size/nelts nrow/nrows ncol/ncols sum sumsq norm min ...
    11181229#  Compound names, in the form  name.att must be inclosed in
    11191230#    braces {name.att}
     
    11291240\end{verbatim}
    11301241
    1131 \item[\rond] {\bf Environment variables} can simply be accessed by {\tt \$varenvname}.
    1132 However,  the environment variables have the lowest priority during substitution.
    1133 Interpreter's variables have the highest priority, followed
    1134 by the application level variables.
    1135 
     1242\item[\rond] Accessing object.Info() \\
     1243For objects having an DVList Info() object (TArray/TVector/TMatrix , NTuple, DataTable, SwPPFDataTable, it is possible to access DVList members by the corresponding names : \\
     1244\hspace*{10mm} {\tt \$\{objName.info.varName\} }
     1245\item[\rond] Getting DataTable rows \\
     1246For NTuple and BaseDataTable objects (DataTable, SwPPFDataTable, SwFitsDataTable), it is
     1247possible to get a string representation of a given row, by specifying
     1248\$\{tableName.row\} followed by the row number (starting from 0) : \\
     1249\hspace*{10mm} {\tt \$\{tableName.row.num\} }
    11361250\end{itemize}
     1251
    11371252 
    11381253
     
    12641379\end{itemize}
    12651380
     1381Executing commands in a separate thread is useful for CPU or data intensive
     1382commands. Most {\bf Expr.Plotting}
     1383(plot2d, plot2dw, plot2de, plot3d, ntloop, fillvec, fillmtx \ldots)
     1384and some of the {\bf pawCmd} (n/plot n/proj) are thread safe. However, due to the
     1385current mutex lock management for these Expr.Plotting/pawCmd commands, only one
     1386such command can run concurrently with other piapp threads.
     1387Some of the commands in the {\bf CxxExecutorCmd} (
     1388c++exec, c++execfrf, c++create, c++createfrf, c++compile, c++link) are also thread safe.
     1389The same remark concerning lock management applies to these commands, while
     1390CxxExecutorCmd commands can run in parallel with Expr.Plotting commands.
     1391
     1392
    12661393%%%%%%%%%%%%%%% Section 7 :  c++ execution
    12671394\newpage
  • trunk/SophyaLib/Manual/sophya.tex

    r3419 r3438  
    4343G. Le Meur           &  lemeur@lal.in2p3.fr       \\
    4444C. Magneville        &  cmv@hep.saclay.cea.fr     \\
    45 S. Henrot-Versille   &  versille@in2p3.fr     
    4645}
    4746% \auteursall
     
    102101%%%
    103102%%%
     103\subsection{Acknowlegments}
     104Many people have contributed to the development SOPHYA and/or the PI library
     105and (s)piapp interactive analysis tool.
     106we are grateful to the following people:
     107
     108\begin{tabular}{lcl}
     109Reza Ansari & \hspace{5mm} & (LAL-Univ.Paris Sud, Orsay) \\
     110Eric Aubourg & & (DAPNIA-CEA/APC, Saclay) \\
     111Sophie Henrot-Versille & & (LAL-IN2P3/CNRS, Orsay) \\
     112Alex Kim & & (LBL, Berkeley) \\
     113Guy Le Meur & & (LAL-IN2P3/CNRS, Orsay) \\
     114Eric Lesquoy & & (DAPNIA-CEA, Saclay) \\
     115Christophe Magneville & & (DAPNIA-CEA, Saclay) \\
     116Bruno Mansoux & & (LAL-IN2P3/CNRS, Orsay) \\
     117Olivier Perdereau & & (LAL-IN2P3/CNRS, Orsay) \\
     118Nicolas Regnault & & (LPNHE-IN2P3/CNRS, Paris) \\
     119Benoit Revenu & & (APC/Univ.Paris 7, Paris) \\
     120Francois Touze & & (LAL-IN2P3/CNRS, Orsay) \\
     121\end{tabular}
     122
     123We thank also the persons who have helped us by useful suggestions, among others : \\
     124S. Bargot, S. Du, S. Plasczczynski, C. Renault and D. Yvon.
     125
    104126\subsection{SOPHYA modules}
    105127\label{sopmodules}
     
    17671789in the HTML pages of the Sophya manual.
    17681790
     1791\subsection{Simplex method}
     1792The class {\bf MinZSimplex} implements the simplex method for non linear
     1793optimization / minimization. See the SOPHYA manual for more information.
     1794
    17691795\subsection{Polynomial}
    17701796\index{Polynomial} \index{Poly} \index{Poly2}
     
    20402066%%%
    20412067\subsection {Spherical maps}
    2042 SkyMap module provides three kinds of complete ($4 \pi$) spherical maps according to the
     2068SkyMap module provides three classes for representing data with pixels distributed over complete ($4 \pi$ steradians) spheres. These classes implements the common interface defined
     2069in the base class \tcls{SphericalMap} with three different algorithms or
    20432070pixelization scheme.
    2044 SphereHEALPix represents spheres pixelized following the HEALPIix algorithm (E. Hivon, K. Gorski)
    2045 \footnote{see the HEALPix Homepage: http://www.eso.org/kgorski/healpix/ }
    2046 , 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) :
    2047 \index{\tcls{SphereHEALPix}}
     2071The spherical maps can be instanciated for the followind data types: \\
     2072\hspace*{5mm} int\_4 , r\_4 (float) , r\_8 (double) , complex$<$r\_4$>$ , complex$<$r\_8$>$. \\
     2073The SphereHEALPix can in addition be instanciated for T=uint\_2.
     2074
     2075\begin{enumerate}
     2076\item \index{\tcls{SphereHEALPix}}
     2077{\bf \tcls{SphereHEALPix}} implements the HEALPix
     2078({\bf H}ierarchical {\bf E}qual {\bf A}rea iso{\bf L}atitude {\bf Pix}elization) scheme,
     2079developped originaly by K. Gorski \& E. Hivon. Refer to
     2080\href{http://healpix.jpl.nasa.gov/}{HEALPix home page} for
     2081detailed information about this pixelisation scheme and related software
     2082\footnote{HEALPix home page: http://healpix.jpl.nasa.gov/ }.
     2083FITS read/write for SphereHEALPix objects is handled by the \tcls{FITS\_SphereHEALPix}
     2084class in module FitsIOServer.
     2085\item \index{\tcls{SphereThetaPhi}}
     2086{\bf \tcls{SphereThetaPhi}} represents spheres pixelized following an algorithm
     2087developed at LAL-ORSAY, for SOPHYA.
     2088The sphere is divided into a number of rings or slices
     2089along the parallels, corresponding to different values of the angle $\theta$.
     2090Each slice is then divided into a number of pixels, with an aspect ratio close
     2091to one (square pixels). Pixels are exactly iso-latitude and very uniform in surface,
     2092over the sphere.
     2093
     2094\item \index{\tcls{SphereECP}}
     2095
     2096The {\bf \tcls{SphereECP}} class correspond to the cylindrical projection.
     2097Like SphereThetaPhi class, the sphere is divided into a number of rings
     2098or slices, and each ring is divided into a constant number of pixels
     2099along the $\varphi$ direction. Although the \tcls{SphereECP} does not have
     2100equal area pixels when used for complete spheres, it can be used for
     2101representing partial or full spherical maps.
     2102\end{enumerate}
     2103
     2104The example below shows creating and filling of a
     2105SphereHEALPix with nside = 8
     2106(The sphere will have $12 \times 8 \times 8= 768$ pixels) :
    20482107
    20492108\begin{verbatim}
     
    20542113\end{verbatim}
    20552114
    2056 SphereThetaPhi is used in a similar way with an argument representing number of slices in theta (Euler angle) for an hemisphere.
     2115Pixels at an angular posistion can be directly accessed through the operator \\
     2116\hspace*{15mm} T \tcls{SphericalMap}::operator()($\theta, \varphi$) :
     2117\begin{verbatim}
     2118#include "vector3d.h"
     2119#include "spherethetaphi.h"
     2120...
     2121// Create a sphere with 40 arcmin resolution
     2122int M = SphereThetaPhi<r_4>::ResolToSizeIndex(
     2123        Angle(40., Angle::ArcMin).ToRadian() );
     2124SphereThetaPhi<r_4> sphtp(M);
     2125double tet, phi;
     2126for (int k=0; k< sphtp.NbPixels(); k++) {
     2127  sphtp.PixThetaPhi(k, tet, phi);
     2128  sphtp(k) = cos(5.*tet)*sin(7.*phi);
     2129}
     2130cout << sphtp;
     2131// To save sphtp to file sphtp (if executed through runcxx)
     2132KeepObj(sphtp);
     2133\end{verbatim}
     2134
    20572135\index{\tcls{SphereThetaPhi}}
    2058 The SphereECP class correspond to the cylindrical projection and can be used for representing
    2059 partial or full spherical maps. However, it has the disadvantage of having non uniform pixel
    2060 size.
    2061 \index{\tcls{SphereECP}}
    20622136
    20632137\subsection {Local maps}
Note: See TracChangeset for help on using the changeset viewer.