| [3041] | 1 | \documentclass[twoside,10pt]{article} | 
|---|
| [2384] | 2 | % \usepackage[latin1]{inputenc} | 
|---|
|  | 3 | % \usepackage[T1]{fontenc} | 
|---|
| [2171] | 4 | \usepackage[francais]{babel} | 
|---|
|  | 5 | \usepackage{graphicx} | 
|---|
|  | 6 |  | 
|---|
| [2384] | 7 | \usepackage{amsmath} | 
|---|
|  | 8 | \usepackage{amssymb} | 
|---|
|  | 9 | \usepackage{latexsym} | 
|---|
|  | 10 |  | 
|---|
| [2171] | 11 | \usepackage{palatino} | 
|---|
|  | 12 |  | 
|---|
|  | 13 | %  Definition pour Docs Sophya | 
|---|
|  | 14 | \usepackage{defsophya} | 
|---|
|  | 15 |  | 
|---|
|  | 16 | \usepackage{makeidx} | 
|---|
|  | 17 |  | 
|---|
|  | 18 | \usepackage[ps2pdf,bookmarks,bookmarksnumbered,% | 
|---|
|  | 19 | urlcolor=blue,citecolor=blue,linkcolor=blue,% | 
|---|
|  | 20 | pagecolor=blue,%hyperindex,% | 
|---|
|  | 21 | colorlinks=true,hyperfigures=true,hyperindex=true | 
|---|
|  | 22 | ]{hyperref} | 
|---|
|  | 23 |  | 
|---|
|  | 24 | \setlength{\textwidth}{17cm} | 
|---|
|  | 25 | \setlength{\textheight}{21.5cm} | 
|---|
|  | 26 | \setlength{\topmargin}{0.5cm} | 
|---|
|  | 27 | \setlength{\oddsidemargin}{0.cm} | 
|---|
|  | 28 | \setlength{\evensidemargin}{0.cm} | 
|---|
|  | 29 | \setlength{\unitlength}{1mm} | 
|---|
|  | 30 |  | 
|---|
| [2384] | 31 | % \newcommand{\piacommand}[1]{ | 
|---|
|  | 32 | %  \framebox{\bf \Large #1 } \index{#1} % (Command) | 
|---|
|  | 33 | %} | 
|---|
|  | 34 | % \newcommand{\piahelpitem}[1]{ | 
|---|
|  | 35 | %  \framebox{\bf \Large #1 } \index{#1} (Help item) | 
|---|
|  | 36 | %} | 
|---|
|  | 37 |  | 
|---|
| [3041] | 38 | \newcommand{\rond}{$\bullet \ $} | 
|---|
|  | 39 | \newcommand{\etoile}{$\star \ $} | 
|---|
|  | 40 | \newcommand{\cercle}{$\circ \ $} | 
|---|
|  | 41 | \newcommand{\carre}{$\Box \ $} | 
|---|
|  | 42 |  | 
|---|
|  | 43 | %%%% Definition des commandes pour l'aide en ligne | 
|---|
| [2171] | 44 | \newcommand{\piacommand}[1]{ | 
|---|
| [2384] | 45 | $\blacksquare$ \hspace{3mm} {\bf \Large #1 } \index{#1} % (Command) | 
|---|
| [2171] | 46 | } | 
|---|
|  | 47 | \newcommand{\piahelpitem}[1]{ | 
|---|
| [2384] | 48 | $\square$ \hspace{3mm} {\bf \Large #1 } \index{#1} (Help item) | 
|---|
| [2171] | 49 | } | 
|---|
|  | 50 |  | 
|---|
| [3041] | 51 | \newcommand{\menubar}[1]{\hspace{1mm} \framebox{\it MenuBar::#1} \hspace{1mm}} | 
|---|
|  | 52 |  | 
|---|
| [2171] | 53 | \newcommand{\myppageref}[1]{ (p. \pageref{#1} ) } | 
|---|
|  | 54 |  | 
|---|
|  | 55 | \makeindex     %  Constitution d'index | 
|---|
|  | 56 |  | 
|---|
|  | 57 | \begin{document} | 
|---|
|  | 58 | \begin{titlepage} | 
|---|
|  | 59 | %  The title page - top of the page with the title of the paper | 
|---|
|  | 60 | \titrehp{piapp \\ An interactive data analysis tool} | 
|---|
|  | 61 | %  Authors list | 
|---|
|  | 62 | \auteurs{ | 
|---|
|  | 63 | R. Ansari            &  ansari@lal.in2p3.fr       \\ | 
|---|
|  | 64 | E. Aubourg           &  aubourg@hep.saclay.cea.fr \\ | 
|---|
|  | 65 | C. Magneville        &  cmv@hep.saclay.cea.fr     \\ | 
|---|
|  | 66 | O. Perdereau         &  perderos@lal.in2p3.fr     \\ | 
|---|
|  | 67 | } | 
|---|
|  | 68 | % \author{R. Ansari {\tt ansari@lal.in2p3.fr} \\ | 
|---|
|  | 69 | % E. Aubourg {\tt aubourg@hep.saclay.cea.fr} \\ | 
|---|
|  | 70 | % C. Magneville {\tt cmv@hep.saclay.cea.fr} | 
|---|
|  | 71 | % } | 
|---|
|  | 72 | \vspace{1cm} | 
|---|
|  | 73 | \begin{center} | 
|---|
| [3302] | 74 | {\bf \Large piapp Version: 4.1 (V\_Aug2007) } | 
|---|
| [2171] | 75 | \end{center} | 
|---|
|  | 76 | \titrebp{5} | 
|---|
|  | 77 |  | 
|---|
|  | 78 | \end{titlepage} | 
|---|
|  | 79 |  | 
|---|
|  | 80 | \newpage | 
|---|
|  | 81 | \tableofcontents | 
|---|
|  | 82 | \newpage | 
|---|
|  | 83 |  | 
|---|
|  | 84 | \section{Introduction} | 
|---|
|  | 85 | \index{piapp} | 
|---|
|  | 86 | {\bf piapp} (or {\bf spiapp}) is an interactive data analysis | 
|---|
|  | 87 | and visualization  program. It is based on the {\bf PI} GUI library | 
|---|
| [3041] | 88 | and the {\bf SOPHYA} \footnote{see http://www.sophya.org} | 
|---|
|  | 89 | (or {\bf PEIDA++} \footnote{PEIDA++ has been used in EROS software. | 
|---|
|  | 90 | (http://eros.in2p3.fr). It is not maintained anymore.}) | 
|---|
|  | 91 | C++ data analysis class library. | 
|---|
|  | 92 | \par | 
|---|
|  | 93 | {\bf piapp} is a powerful command oriented tool for visualising and analysing data. | 
|---|
|  | 94 | Its main features are summarised below: | 
|---|
|  | 95 | \begin{itemize} | 
|---|
|  | 96 | \item[\rond] Image, multiple 2D and few 3D representations | 
|---|
|  | 97 | \item[\rond] Highly interactive graphics, with postscript as export format | 
|---|
|  | 98 | \item[\rond] Capability to handle large data sets. Data can be imported and | 
|---|
|  | 99 | exported in different formats: ASCII, PPF and FITS. | 
|---|
|  | 100 | \item[\rond] Interactive analysis: 2D/3D distributions, histograms, FFT \ldots | 
|---|
|  | 101 | \item[\rond] Flexible c-shell inspired command interpreter. | 
|---|
|  | 102 | \item[\rond] Possibility to perform more complex operations in C++, on objects | 
|---|
|  | 103 | managed by the application through the on-the-fly compilation and execution | 
|---|
|  | 104 | of c++ code fragments in piapp. | 
|---|
|  | 105 | \item[\rond] piapp is a multi-threaded program with separate threads for graphics | 
|---|
|  | 106 | and command execution, ensuring interactive response, even while heavy | 
|---|
|  | 107 | computation is being performed. In addition, thread safe commands can be executed | 
|---|
|  | 108 | in separate threads, for taking advantage of multi CPU (or CPU-cores) workstations. | 
|---|
|  | 109 | \item[\rond] The application can be easily extended through modules which can be | 
|---|
|  | 110 | loaded at run time. | 
|---|
|  | 111 | \end{itemize} | 
|---|
|  | 112 | %%% | 
|---|
|  | 113 | \vspace*{5mm} | 
|---|
|  | 114 | \par | 
|---|
|  | 115 | {\bf piapp} can simply be started on the command line in a terminal window | 
|---|
|  | 116 | once the SOPHYA/piapp  environment has been initialised. | 
|---|
|  | 117 | The environment variables {\tt SOPHYABASE} should contain the directory | 
|---|
|  | 118 | where SOPHYA/piapp has been installed. the shared library path | 
|---|
|  | 119 | {\tt LD\_LIBRARY\_PATH} must contain {\tt \$SOPHYABASE /slb} and the | 
|---|
|  | 120 | current directory {\tt .} and the executable search path {\tt PATH} must | 
|---|
|  | 121 | contain {\tt \$SOPHYABASE /exe}. Refer to the SOPHYA overview manual | 
|---|
|  | 122 | for more information on SOPHYA directory structure. \\ | 
|---|
|  | 123 | It might also be necessary to define the environment variable | 
|---|
|  | 124 | {\bf PIXKBMOMASK}, used by the libPI.a to map correctly | 
|---|
|  | 125 | the {\tt <Alt>} key with some X servers (in particular with | 
|---|
|  | 126 | X11 on MacOS X). \\ | 
|---|
|  | 127 | {\tt csh> setenv PIXKBMODMASK 2 } | 
|---|
|  | 128 | \par | 
|---|
|  | 129 | {\tt (s)piapp -h} provides a brief help of the command line | 
|---|
| [2171] | 130 | arguments. Xtoolkit options can also be specified as command line | 
|---|
| [3041] | 131 | arguments. {\bf spiapp} is the name of SOPHYA/piapp executable, | 
|---|
|  | 132 | in order to distinguish it from PEIDA/piapp. | 
|---|
| [2171] | 133 | \begin{verbatim} | 
|---|
|  | 134 | csh> spiapp -h | 
|---|
| [3041] | 135 | SophyaInitiator::SophyaInitiator() BaseTools Init | 
|---|
|  | 136 | PIOPersist::Initialize() Starting Sophya Persistence management service | 
|---|
|  | 137 | SOPHYA Version  2.0 Revision 0 (V_Jul2006) -- Jul 18 2006 12:35:58 gcc 3.3 20030304 (Apple Computer, Inc. build 1495) | 
|---|
| [2171] | 138 |  | 
|---|
| [3041] | 139 | piapp: Interactive data analysis and visualisation program | 
|---|
|  | 140 | Usage: piapp [-nored] [-termread] [-term] [-hidezswin] [-small] | 
|---|
|  | 141 | [-nosig] [-nosigfpe] [-nosigsegv] | 
|---|
|  | 142 | [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]] | 
|---|
|  | 143 | -nored : Don't redirect stdout/stderr to piapp console | 
|---|
|  | 144 | -termread : Read commands on terminal (stdin) | 
|---|
|  | 145 | -term : equivalent to -nored -termread -small | 
|---|
|  | 146 | -hidezswin : Hide Zoom/Stat/ColMap window | 
|---|
|  | 147 | -small : Create small size main piapp window | 
|---|
|  | 148 | -nosig : Don't catch SigFPE, SigSEGV | 
|---|
|  | 149 | -nosigfpe -nosigsegv: Don t catch SigFPE / SigSEGV | 
|---|
|  | 150 | -tmpdir TmpDirectory: defines TMDIR for temporary files | 
|---|
| [2171] | 151 | -help2tex: Create a LaTeX help file (piahelp.tex) | 
|---|
| [3041] | 152 | -exec file [args] : Execute command file (last option) | 
|---|
| [2171] | 153 | \end{verbatim} | 
|---|
| [3041] | 154 | Once {\bf piapp} is started, the main piapp window appears. | 
|---|
|  | 155 | It contains the menu bar, an upper part with the zoom and colormap | 
|---|
|  | 156 | widgets for  image displays, memory and CPU usage and a terminal like | 
|---|
|  | 157 | widget (piapp console, see {\bf PIConsole} \myppageref{PIConsole}) | 
|---|
|  | 158 | in the lower part. The figure \ref{figmainwin} | 
|---|
| [2171] | 159 | shows an image of the piapp main window. | 
|---|
| [3041] | 160 | {\tt stdout/cout, stderr/cerr} are redirected to the piapp console and | 
|---|
|  | 161 | commands can be entered in this widget. It is also possible to keep | 
|---|
|  | 162 | the terminal where piapp was started  for {\tt stdout/stderr} (flag {\tt -nored}). | 
|---|
|  | 163 | It is also possible to have a command reader on  the terminal | 
|---|
|  | 164 | ({\tt stdin}), using the flag {\tt -term}. \\[1mm] | 
|---|
|  | 165 | % | 
|---|
|  | 166 | {\bf Warning:} The output redirection uses unix pipes. On Linux, with commands | 
|---|
|  | 167 | producing long outputs, the application may block because of incorrect management | 
|---|
|  | 168 | of pipes. If this happens, use piapp with  {\tt -nored} flag. | 
|---|
| [2171] | 169 |  | 
|---|
| [3041] | 170 | \par | 
|---|
|  | 171 | In section 2, we present  a quick tour of {\bf piapp}. | 
|---|
|  | 172 | a brief overview of piapp graphics, supported data formats, interactive | 
|---|
|  | 173 | analysis possibilities, the command interpreter and c++ execution | 
|---|
|  | 174 | are presented in the following sections. | 
|---|
|  | 175 | Section \ref{piappcmdref} contains a brief description of all piapp commands | 
|---|
|  | 176 | and help items. Various interactive control windows are described in appendix. | 
|---|
| [2171] | 177 |  | 
|---|
|  | 178 | \vspace*{10mm} | 
|---|
|  | 179 | \begin{figure}[ht!] | 
|---|
|  | 180 | \begin{center} | 
|---|
|  | 181 | \includegraphics[width=16cm]{piapp_mainwin.eps} | 
|---|
|  | 182 | \caption{piapp main window} | 
|---|
|  | 183 | \label{figmainwin} | 
|---|
|  | 184 | \end{center} | 
|---|
|  | 185 | \end{figure} | 
|---|
|  | 186 |  | 
|---|
|  | 187 |  | 
|---|
|  | 188 | \newpage | 
|---|
|  | 189 | \section{A Tour of piapp} | 
|---|
| [3041] | 190 | \subsection{Interacting with piapp, getting help} | 
|---|
|  | 191 | Users interact with piapp through commands entered in the piapp-console | 
|---|
|  | 192 | (or the unix terminal), and through the different menus. | 
|---|
|  | 193 | Some of the possibilities of the piapp-console are described | 
|---|
|  | 194 | in {\bf PIConsole} help item, in the command reference section \myppageref{PIConsole}. | 
|---|
|  | 195 | The description | 
|---|
|  | 196 | of the commands in available online using the help command. | 
|---|
|  | 197 | An online help window can be displayed by \menubar{File / Help}. | 
|---|
|  | 198 | Commands and help items are grouped in categories which can be | 
|---|
|  | 199 | selected using the OptionMenu in the Help window. | 
|---|
|  | 200 | \begin{verbatim} | 
|---|
|  | 201 | Cmd> help func | 
|---|
|  | 202 | Displays a function y=f(x) (Fills a vector with function values) | 
|---|
|  | 203 | Usage: func f(x) xmin xmax [npt graphic_attributes] | 
|---|
|  | 204 | Related commands: funcff func2d func2dff | 
|---|
|  | 205 | Cmd> func sin(x)/x 0.1 10 100 'red line=solid,2' | 
|---|
|  | 206 | ---> Graphic display of the function | 
|---|
|  | 207 | \end{verbatim} | 
|---|
|  | 208 | The directory {\tt DemoPIApp} contains a number of example | 
|---|
|  | 209 | command script and sample data files. | 
|---|
|  | 210 |  | 
|---|
| [2171] | 211 | \subsection{the Object Manager (NamedObjMgr)} | 
|---|
|  | 212 | The {\bf piapp} application is built around an object manager | 
|---|
|  | 213 | (class {\tt NamedObjMgr}) and a graphic application | 
|---|
|  | 214 | (class {\tt PIStdImgApp}). Objects inheriting from | 
|---|
|  | 215 | the class {\tt AnyDataObj} can be managed through adapter | 
|---|
|  | 216 | classes (classes inheriting from {\tt NObjMgrAdapter}) by | 
|---|
|  | 217 | the object manager. | 
|---|
|  | 218 | \par | 
|---|
|  | 219 | User sees the objects (such as Sophya objects Histo, NTuple, | 
|---|
|  | 220 | Arrays, Images, SkyMaps, \ldots) kept in memory, organized | 
|---|
|  | 221 | in a single level tree structure. Four memory directories | 
|---|
|  | 222 | are automatically created and can not be removed: \\ | 
|---|
|  | 223 | \centerline{\bf /home \hspace{10mm} /old \hspace{10mm} /tmp \hspace{10mm} /autoc} | 
|---|
|  | 224 | The default working directory (in memory) is {\bf /home}. | 
|---|
|  | 225 | Other directories can be created by the user. | 
|---|
|  | 226 | \begin{center} | 
|---|
|  | 227 | {\bf Warning:} These are only the directory | 
|---|
|  | 228 | structure managed by the piapp application and do not | 
|---|
|  | 229 | correspond to the file system directories | 
|---|
|  | 230 | \end{center} | 
|---|
|  | 231 | The window {\bf ObjMgr} shown in figure \ref{figobjmgrw} | 
|---|
|  | 232 | can be used to navigate in the memory directories and | 
|---|
| [3041] | 233 | execute simple operations on objects. \\ | 
|---|
|  | 234 | This window can be displayed using the menu command | 
|---|
|  | 235 | \menubar{Objects / ObjectManager}. | 
|---|
| [2171] | 236 | The button \framebox{\small \bf SetCurObj} can be used to set the value | 
|---|
|  | 237 | of the interpreter's variable {\tt cobj} to the selected | 
|---|
|  | 238 | object name. | 
|---|
|  | 239 | Refer to the commands in group {\bf Object Management} | 
|---|
|  | 240 | for more information. | 
|---|
|  | 241 |  | 
|---|
|  | 242 | \vspace*{5mm} | 
|---|
|  | 243 | \begin{figure}[ht!] | 
|---|
|  | 244 | \begin{center} | 
|---|
|  | 245 | \includegraphics[width=10cm]{piapp_objmgr.eps} | 
|---|
|  | 246 | \caption{The interactive object management window} | 
|---|
|  | 247 | \label{figobjmgrw} | 
|---|
|  | 248 | \end{center} | 
|---|
|  | 249 | \end{figure} | 
|---|
|  | 250 |  | 
|---|
|  | 251 | \subsection{command language} | 
|---|
| [3041] | 252 | A basic command interpreter ({\bf PIACmd/Commander}) is included in {\bf piapp} and | 
|---|
| [2171] | 253 | other command interpreters can be inserted in the application | 
|---|
|  | 254 | framework. | 
|---|
| [3041] | 255 | This interpreter ({\bf Commander} \myppageref{Commander}) | 
|---|
| [2171] | 256 | synthax is close to the c-shell | 
|---|
|  | 257 | (csh) shell script. It is possible to define and use variables | 
|---|
|  | 258 | ({\tt set} command, {\tt \$varname}), and execute loops | 
|---|
|  | 259 | ({\tt foreach,for}), as well as simple tests | 
|---|
|  | 260 | ({\tt if test then ... else ... endif}). | 
|---|
|  | 261 | Commands from a file (default extension .pic) can be executed | 
|---|
|  | 262 | using the {\tt exec} command. | 
|---|
|  | 263 | Long commands can be put on several lines, by ending a line | 
|---|
|  | 264 | by the backslash \\ caracter, to signal that the command | 
|---|
|  | 265 | continues on the next line. | 
|---|
|  | 266 |  | 
|---|
|  | 267 | The command macro below shows a sample piapp session, where | 
|---|
|  | 268 | data from the file {\tt demo.ppf} are displayed. | 
|---|
|  | 269 | \begin{verbatim} | 
|---|
|  | 270 | #  Trace mode -> On | 
|---|
|  | 271 | traceon | 
|---|
|  | 272 | #  Deleting all objects in the current directory | 
|---|
|  | 273 | delobjs * | 
|---|
|  | 274 | #  Opening the PPF file demo.ppf | 
|---|
|  | 275 | openppf demo.ppf | 
|---|
|  | 276 | # Various displays in a graphic window, divided into 2x2 zones | 
|---|
|  | 277 | zone 2 2 | 
|---|
|  | 278 | #  1D histogram display | 
|---|
|  | 279 | disp h1d blue | 
|---|
|  | 280 | #  2D histogram display | 
|---|
|  | 281 | disp h2d | 
|---|
|  | 282 | #  Function display | 
|---|
|  | 283 | func sin(x)/x 0.1 10. 200 gold | 
|---|
|  | 284 | #  Surface representation of a matrix | 
|---|
|  | 285 | surf mtx1 colbr32 | 
|---|
| [2253] | 286 | # Contour representation of a matrix | 
|---|
|  | 287 | contour mtx1 'colrj32 normalline ncont=7' | 
|---|
| [2171] | 288 | #  3D representation of points using a PAW like command | 
|---|
|  | 289 | n/plot nt31.z%y%x ! ! win | 
|---|
|  | 290 | #  3D points superimposed on the previous display | 
|---|
|  | 291 | nt3d nt32 x y  z ex ey ez - - 'same fcirclemarker7 red' | 
|---|
|  | 292 | \end{verbatim} | 
|---|
|  | 293 |  | 
|---|
|  | 294 | \subsection{NTuple vue / PAW like commands} | 
|---|
|  | 295 | It is possible to plot various expressions of objects, seen as | 
|---|
|  | 296 | a 2D table, with named columns. This possibility exist not only | 
|---|
|  | 297 | for NTuples, but also for most objects (from SOPHYA) handled | 
|---|
|  | 298 | by piapp. See command groups {\bf Expr.Plotting} and | 
|---|
|  | 299 | {\bf pawCmd} | 
|---|
|  | 300 |  | 
|---|
|  | 301 | \subsection{C++ execution inside piapp} | 
|---|
|  | 302 | For more complex processings, where the full power of C++ | 
|---|
|  | 303 | and the class libraries are necessary, {\bf piapp} provide | 
|---|
|  | 304 | the possibility of executing C++ code, without the burden | 
|---|
|  | 305 | of having to write a complete program. The objects | 
|---|
|  | 306 | present in the current directory are automatically | 
|---|
|  | 307 | declared. The communication with the piapp application | 
|---|
|  | 308 | is done by the {\bf NamedObjMgr} class. | 
|---|
|  | 309 | Two macros {\tt KeepObj()} and {\tt DisplayObj()} | 
|---|
|  | 310 | simplify the task of keeping newly created objects. | 
|---|
|  | 311 | In the example below, we first create a noisy signal | 
|---|
|  | 312 | in a vector, and we keep it in the application | 
|---|
|  | 313 | (Notice the use of multiline command) : | 
|---|
|  | 314 |  | 
|---|
|  | 315 | \begin{verbatim} | 
|---|
|  | 316 | Cmd> c++exec c++exec Vector in(1024); \ | 
|---|
| [3041] | 317 | ...? in = RandomSequence(RandomSequence::Gaussian, 0., 1.); \ | 
|---|
|  | 318 | ...? for(int kk=0; kk<in.Size(); kk++) \ | 
|---|
|  | 319 | ...? in(kk) += 2*sin(kk*0.05); \ | 
|---|
|  | 320 | ...? KeepObj(in); | 
|---|
| [2171] | 321 | \end{verbatim} | 
|---|
|  | 322 | We can of course display the resulting vector: | 
|---|
|  | 323 | \begin{verbatim} | 
|---|
|  | 324 | Cmd> disp in | 
|---|
|  | 325 | \end{verbatim} | 
|---|
|  | 326 |  | 
|---|
|  | 327 | And, at a subsequent stage, make a low pass filter | 
|---|
|  | 328 | on the vector in: | 
|---|
|  | 329 | \begin{verbatim} | 
|---|
|  | 330 | Cmd> c++exec Vector out(1024); \ | 
|---|
| [3041] | 331 | ...? int w = 2; \ | 
|---|
|  | 332 | ...? for(int k=w; k<in.Size()-w; k++) \ | 
|---|
|  | 333 | ...?   out(k) = in(Range(k-w, k+w)).Sum()/(2.*w+1.); \ | 
|---|
|  | 334 | ...? KeepObj(out); | 
|---|
| [2171] | 335 | \end{verbatim} | 
|---|
|  | 336 |  | 
|---|
|  | 337 | We can display the new vector {\tt out} overlayed | 
|---|
|  | 338 | on the previously displayed vector: | 
|---|
|  | 339 | \begin{verbatim} | 
|---|
|  | 340 | Cmd> disp out 'red same' | 
|---|
|  | 341 | \end{verbatim} | 
|---|
|  | 342 |  | 
|---|
|  | 343 | See command group {\bf CxxExecutorCmd} for more information, | 
|---|
|  | 344 | and the option window activated by the menu: | 
|---|
|  | 345 | {\bf Special/CxxExecOption}. | 
|---|
|  | 346 |  | 
|---|
|  | 347 | \subsection{Extending the application} | 
|---|
|  | 348 | The {\bf piapp} application can easily be extended by the user. | 
|---|
|  | 349 | This is done through shared libraries which can be opened | 
|---|
|  | 350 | and used by the application. | 
|---|
|  | 351 | Two main methods can be used (see  command group | 
|---|
|  | 352 | {\bf ExternalModules}) : | 
|---|
|  | 353 | \begin{itemize} | 
|---|
|  | 354 | \item Creation of user functions. A shared library containing | 
|---|
|  | 355 | at least one user function with the following prototype | 
|---|
|  | 356 | should be created: | 
|---|
|  | 357 | \begin{verbatim} | 
|---|
|  | 358 | extern "C" { | 
|---|
|  | 359 | void myfonction(vector<string>& args); | 
|---|
|  | 360 | } | 
|---|
|  | 361 | \end{verbatim} | 
|---|
|  | 362 | The class {\bf NameObjMgr} should be used to communicate with the | 
|---|
|  | 363 | application. The {\tt link} \myppageref{link} and {\tt call} \myppageref{call} | 
|---|
|  | 364 | should be used to load and execute user functions. An example of | 
|---|
|  | 365 | user function can be found in DemoPIApp/user.cc exlink.pic. | 
|---|
|  | 366 |  | 
|---|
|  | 367 | \item Creation of loadable modules: Loadable modules can be | 
|---|
|  | 368 | used to extend the application possibilities in a way totally | 
|---|
|  | 369 | transparent to the user. It is possible to define new commands, | 
|---|
|  | 370 | handling of new object types, additional graphic functionalities | 
|---|
|  | 371 | in a loadable module. | 
|---|
|  | 372 |  | 
|---|
|  | 373 | The class {\bf CmdExecutor} is the base class for extending piapp. | 
|---|
|  | 374 | A shared library should be built, containing two functions,for | 
|---|
|  | 375 | the activation and deactivation of the module, with the following | 
|---|
|  | 376 | prototype (where {\tt mymodule} is the module's name. | 
|---|
|  | 377 | \begin{verbatim} | 
|---|
|  | 378 | extern "C" { | 
|---|
|  | 379 | void mymodule_init(); | 
|---|
|  | 380 | void mymodule_end(); | 
|---|
|  | 381 | } | 
|---|
|  | 382 | \end{verbatim} | 
|---|
|  | 383 |  | 
|---|
|  | 384 | \end{itemize} | 
|---|
|  | 385 |  | 
|---|
| [3041] | 386 | %%%%%%%%%% Section 3: Graphiques | 
|---|
| [2171] | 387 | \newpage | 
|---|
| [3043] | 388 | \section{Interactive graphics} | 
|---|
|  | 389 | %%% | 
|---|
|  | 390 | \subsection{Display commands} | 
|---|
|  | 391 | Many objects managed by piapp have a default graphic representation. The | 
|---|
|  | 392 | {\bf disp} command  \myppageref{disp} can be used to display the object, while | 
|---|
|  | 393 | other commands like {\bf surf} \myppageref{surf} , {\bf imag} | 
|---|
|  | 394 | or {\bf contour} \myppageref{contour} will try to force a given graphic representation. \\ | 
|---|
|  | 395 | Data from table like objects can be plotted using commands like {\bf nt2d} | 
|---|
|  | 396 | \myppageref{nt2d} or {\bf nt3d} \myppageref{nt3d}. Most objects in piapp | 
|---|
|  | 397 | can also be manipulated like table for plotting purposes, using commands | 
|---|
|  | 398 | like  {\bf plot2d} \myppageref{plot2d} , {\bf plot3d} \myppageref{plot3d} | 
|---|
|  | 399 | or {\bf n/plot}  \myppageref{nZplot}. These commands are described in section | 
|---|
|  | 400 | \ref{tableplot}. \\ | 
|---|
|  | 401 | Commands producing a graphic output have usually an optional argument called | 
|---|
|  | 402 | {\tt graphic\_attributes} or {\tt gr\_att}. This argument provide a flexible and easy | 
|---|
|  | 403 | way to change and customise the output graphic, as discussed in the paragraph below. | 
|---|
|  | 404 | The piapp graphics can be exported in postscript (.ps) or encapsulated postscript | 
|---|
|  | 405 | (.eps) format. The commands {\bf w2ps} \myppageref{w2ps} and | 
|---|
|  | 406 | {\bf w2eps} \myppageref{w2eps} as well the menu  \menubar{PostScript} can | 
|---|
|  | 407 | be used to export graphics. \\[1mm] | 
|---|
|  | 408 | The examples below illustrates the usage of some piapp graphic commands. | 
|---|
|  | 409 | \begin{enumerate} | 
|---|
|  | 410 | \item Image display | 
|---|
|  | 411 | \begin{verbatim} | 
|---|
|  | 412 | #  Open a PPF file containing topographic data for france | 
|---|
|  | 413 | #  as a TMatrix<short> 1332x1548 | 
|---|
|  | 414 | openppf francetopo.ppf | 
|---|
|  | 415 | #  Display the matrix, whit a zoom factor, lut and color map | 
|---|
|  | 416 | disp francetopo 'zoom/3 lut=lin,-700,800 colbr128 win' | 
|---|
|  | 417 | w2eps francetopo.eps | 
|---|
|  | 418 | \end{verbatim} | 
|---|
|  | 419 | \begin{center} | 
|---|
|  | 420 | \includegraphics[width=13cm]{francetopo.eps} | 
|---|
|  | 421 | \end{center} | 
|---|
| [2171] | 422 |  | 
|---|
| [3043] | 423 | \item Simple 2D graphics with vector displays | 
|---|
|  | 424 | \begin{verbatim} | 
|---|
|  | 425 | #  Create and initialize two vectors - prevent display : nodisp | 
|---|
|  | 426 | Cmd> newvec vva 100 sin(x/10.+0.7)+cos(x/7.+1.4)*1.26 nodisp | 
|---|
|  | 427 | Cmd> newvec vvb 100 sin(x/10.)+cos(x/7.)*1.34 nodisp | 
|---|
|  | 428 | #  Set axe drawing options | 
|---|
|  | 429 | Cmd> setaxesatt 'font=times,bold,16 minorticks tickslen=0.02,0.012' | 
|---|
|  | 430 | #  Display the two vectors, with different graphic attributes | 
|---|
|  | 431 | Cmd> disp vva 'red line=solid,2 notitle' | 
|---|
|  | 432 | #  Define a title for the graphic | 
|---|
|  | 433 | Cmd> settitle 'Example-1: 2 vectors'  ' ' 'font=times,bolditalic,18' | 
|---|
|  | 434 | Cmd> disp vvb 'blue marker=box,7 same' | 
|---|
|  | 435 | #  Save the graphic into an eps file | 
|---|
|  | 436 | Cmd> w2eps gr2vec.eps | 
|---|
|  | 437 | \end{verbatim} | 
|---|
|  | 438 | % \begin{figure}[ht!] | 
|---|
|  | 439 | \begin{center} | 
|---|
|  | 440 | \includegraphics[width=12cm]{gr2vec.eps} | 
|---|
|  | 441 | % \label{g22vec} | 
|---|
|  | 442 | \end{center} | 
|---|
|  | 443 | %%% | 
|---|
|  | 444 | \item Creating a comparison chart using {\bf bargraph} | 
|---|
|  | 445 | \begin{verbatim} | 
|---|
|  | 446 | #  Representation du PNB (en $, 2003) pour quelques pays | 
|---|
|  | 447 | set pays ( Allemagne Espagne France Italie Pays-Bas Suisse UK USA ) | 
|---|
|  | 448 | set pnbh ( 22670 14430 22010 18960 23960 37930 25250 35060 ) | 
|---|
|  | 449 | setaxesatt 'font=times,bold,16' | 
|---|
|  | 450 | bargraph pnbh pays - 'blue horizontalbars nofill packfrac=0.65 font=helvetica,bold,14' | 
|---|
|  | 451 | setaxelabels 'PNB / Hab , $ 2003' ' ' 'font=times,bold,16' | 
|---|
|  | 452 | w2eps pnbargraph.eps | 
|---|
|  | 453 | \end{verbatim} | 
|---|
|  | 454 | \begin{center} | 
|---|
|  | 455 | \includegraphics[width=12cm]{pnbbargraph.eps} | 
|---|
|  | 456 | \end{center} | 
|---|
|  | 457 | %%% | 
|---|
|  | 458 | \item Displaying a matrix as a surface | 
|---|
|  | 459 | \begin{verbatim} | 
|---|
|  | 460 | openppf demo.ppf mtx1 | 
|---|
|  | 461 | setaxesatt 'font=time,bold,16' | 
|---|
|  | 462 | surf mtx1 'colbr128 line=solid,1 grey' | 
|---|
|  | 463 | w2eps surfcol.eps | 
|---|
|  | 464 | \end{verbatim} | 
|---|
|  | 465 | \begin{center} | 
|---|
|  | 466 | \includegraphics[width=13cm]{surfcol.eps} | 
|---|
|  | 467 | \end{center} | 
|---|
|  | 468 |  | 
|---|
|  | 469 | \end{enumerate} | 
|---|
|  | 470 |  | 
|---|
|  | 471 | %%%%%%%%%% | 
|---|
|  | 472 | \subsection{Graphic objects in piapp} | 
|---|
|  | 473 | The piapp graphics is handled by the {\bf PI} \footnote {http://www.sophya.org/PI} library, | 
|---|
|  | 474 | which provide a large variety of 2D representations, | 
|---|
|  | 475 | few 3D graphics and powerful image display. \\ | 
|---|
|  | 476 | Currently, all graphic representations, except for image displays, are handled | 
|---|
|  | 477 | through {\bf PIDrawers} which are managed by a viewer. A viewer can | 
|---|
|  | 478 | manage several {\bf PIDrawers} objects which correspond then to a multilayer | 
|---|
|  | 479 | graphic display. The viewers are also responsible for managing user | 
|---|
|  | 480 | interactions. \\ | 
|---|
|  | 481 | Image displays are handled through a specific viewer | 
|---|
|  | 482 | {\bf  PIImage} which is also capable of managing PIDrawer objects | 
|---|
|  | 483 | for multi-layer 2D overlay vector graphics. \\[2mm] | 
|---|
|  | 484 | %% | 
|---|
|  | 485 | Main piapp/PI graphic viewers, windows and drawer objects: | 
|---|
| [2171] | 486 | \begin{itemize} | 
|---|
| [3043] | 487 | \item[\bul]  The {\bf PIScDrawWdg} handles a set of  of 2-D drawers, managing | 
|---|
|  | 488 | the 2D coordinate  system and interactive zoom. The axes drawing is | 
|---|
|  | 489 | handled by a specialised drawer, number 0, which also manages various added | 
|---|
|  | 490 | graphic elements (text \ldots). The list of various mouse and | 
|---|
|  | 491 | keyboard actions is described in the reference section, under {\bf PIScDrawWdg} \myppageref{PIScDrawWdg} title. In particular, mouse-button-2 can be used | 
|---|
|  | 492 | to zoom on a particular part, {\tt $<$Alt$>$A} activates the coordinates | 
|---|
|  | 493 | and axes manipulation window ({\bf PIAxesTools}) and   {\tt $<$Alt$>$G} | 
|---|
|  | 494 | activates the PIDrawer graphic attributes control window ({\bf PIDrawerTools}). | 
|---|
|  | 495 | %%% | 
|---|
|  | 496 | \item[\bul] The {\bf PIDraw3DWdg}  handles a set of of 3-D drawers, managing | 
|---|
|  | 497 | interactive camera/object rotation (mouse-button-2) and zoom (mouse-button-2). | 
|---|
|  | 498 | {\tt $<$Alt$>$G} to display/activate  the PIDrawer graphic attributes | 
|---|
|  | 499 | control window ({\bf PIDrawerTools}). | 
|---|
|  | 500 | See {\bf PIDraw3DWdg} \myppageref{PIDraw3DWdg} for a complete list of mouse | 
|---|
|  | 501 | and keyboard actions. | 
|---|
|  | 502 | Drawer 0 handles axes drawing and graphic elements. | 
|---|
|  | 503 | %%% | 
|---|
|  | 504 | \item[\bul] The display of 2-D arrays $A(i,j)$ as an image is managed by | 
|---|
|  | 505 | the {\bf PIImage} viewer/widget. The PI library interface  {\bf P2DArrayAdapter} is used | 
|---|
|  | 506 | to represent a generic 2-D array. The array values are converted into an index, converted | 
|---|
|  | 507 | itself into a color by the use of a color-map or color-table {\bf PIColorMap}. | 
|---|
|  | 508 | $$ \mathrm{LUT:} A(i,j) \longrightarrow idx(i,j) \hspace{5mm} \mathrm{ColorMap:} | 
|---|
|  | 509 | idx(i,j) \longrightarrow col(i,j) $$ | 
|---|
|  | 510 | Currently index range is 0...255 with color-map having 32 or 128 distinct colors. | 
|---|
|  | 511 | PIImage viewers  controls a zoom widget, as well as a global image view widget, and | 
|---|
|  | 512 | a color map view widget. A specific image control window can be activated using | 
|---|
|  | 513 | {\tt $<$Alt$>$O}.  See {\bf PIImage} \myppageref{PIImage} for | 
|---|
|  | 514 | a complete list of mouse and keyboard actions. A base drawer (number 0) can handle | 
|---|
|  | 515 | axes drawing and added graphic elements. | 
|---|
|  | 516 | %%% | 
|---|
|  | 517 | \item[\bul] {\bf Windows} | 
|---|
|  | 518 | The viewers described above are displayed in differnt kind of windows. | 
|---|
|  | 519 | The graphic option {\tt next,win,same,stack} can be used to control the way the | 
|---|
|  | 520 | type of windows used. Graphic windows can be divided into several zones | 
|---|
|  | 521 | (Command {\bf zone} \myppageref{zone}). | 
|---|
| [2172] | 522 | Refer to the command reference section on windows ({\bf Windows} | 
|---|
|  | 523 | \myppageref{Windows}) | 
|---|
| [2171] | 524 | for information on the different type of windows used by piapp | 
|---|
|  | 525 | and their properties. | 
|---|
| [3043] | 526 | %%% | 
|---|
|  | 527 | \item[\bul] {\bf PIDrawer} Graphical representation of most objects in piapp is | 
|---|
|  | 528 | handled through objects inheriting from the PIDrawer class. A base drawer | 
|---|
|  | 529 | (PIElDrawer, number 0) associated to all three above viewers manages the axes drawing | 
|---|
|  | 530 | as well as the added graphic elements (text, arrow, \ldots). A drawer management menu | 
|---|
|  | 531 | can be activated using {\tt $<$Alt$>$D}. This menu can be used to move and resize | 
|---|
|  | 532 | drawers, or to display a window for changing drawers graphic attributes. | 
|---|
|  | 533 | \end{itemize} | 
|---|
| [2171] | 534 |  | 
|---|
| [2172] | 535 | \par | 
|---|
| [2171] | 536 | In addition, a number of control windows can be used to examine and | 
|---|
|  | 537 | change view properties of differents viewers and drawers. | 
|---|
|  | 538 | \begin{itemize} | 
|---|
| [3043] | 539 | \item[] {\bf PIDrawerTools} activated using {\tt $<$Alt$>$G} or | 
|---|
|  | 540 | \menubar{Tools/Show DrawerTools} on any viewer (see page \myppageref{secdrwtools}) | 
|---|
|  | 541 | \item[] {\bf PIAxesTools} activated using {\tt $<$Alt$>$A} or | 
|---|
|  | 542 | \menubar{Tools/Show AxeTools} on PIScDrawWdg (see page \myppageref{secaxestools}) | 
|---|
|  | 543 | \item[] {\bf PIImageTools} activated using {\tt $<$Alt$>$O} or | 
|---|
|  | 544 | \menubar{Tools/Show ImageTools} on PIImage | 
|---|
|  | 545 | (see page \myppageref{secimagetools}) | 
|---|
|  | 546 | \item[] {\bf PIHisto2DTools} activated using {\tt $<$Alt$>$O} or through the PIDrawerTools | 
|---|
|  | 547 | for an active PIHisto2D drawer. (see page \myppageref{sech2dtools}) | 
|---|
|  | 548 | \item[] {\bf PIContourTools}  activated using {\tt $<$Alt$>$O} or through the PIDrawerTools | 
|---|
|  | 549 | for an active PIContourDrawer  drawer.  (see page \myppageref{secconttools}) | 
|---|
| [2171] | 550 | \end{itemize} | 
|---|
| [3043] | 551 | These control tools are briefly described in appendix. | 
|---|
| [2171] | 552 |  | 
|---|
| [3043] | 553 | %%%%%%%%%% | 
|---|
|  | 554 | \subsection{Graphic attributes} | 
|---|
|  | 555 | Graphic attributes are specified as a set of space separated strings. Use | 
|---|
|  | 556 | quotes to group them into a single argument parsed by the command | 
|---|
|  | 557 | interpreter. The options are decoded by the different objects handling the | 
|---|
|  | 558 | graphic (viewer widget, drawer, axe drawer). \\ | 
|---|
|  | 559 | The complex decoding scheme | 
|---|
|  | 560 | is usually transparent for piapp users. However, there is an ambiguity when | 
|---|
|  | 561 | specifying some of the axes attributes, such as color or the font used for | 
|---|
|  | 562 | drawing the axes. The command {\bf setaxesatt}  (\myppageref{setaxesatt}) | 
|---|
|  | 563 | should thus be used to specify generic graphic attributes (color, font, line type). \\ | 
|---|
|  | 564 | for axes. | 
|---|
|  | 565 | \begin{itemize} | 
|---|
|  | 566 | \item[\bul]  The {\bf PIScDrawWdg} viewer options: \\ | 
|---|
|  | 567 | \begin{verbatim} | 
|---|
|  | 568 | >> To define the 2D axes limits (in user coordinates) | 
|---|
|  | 569 | xylimits=xmin,xmax,ymin,ymax | 
|---|
|  | 570 | >>  To define the default drawing rectangle, in fraction of widget size | 
|---|
|  | 571 | defdrrect=x1,x2,y1,y2  (default: x1=y1=0.1  x2=y2=0.9) | 
|---|
|  | 572 | >> Axes flags : | 
|---|
|  | 573 | linx  logx  liny logy | 
|---|
|  | 574 | >> To change the background color (default=white) | 
|---|
|  | 575 | wbgcol=colname | 
|---|
|  | 576 |  | 
|---|
|  | 577 | \end{verbatim} | 
|---|
|  | 578 | %%% | 
|---|
|  | 579 | \item[\bul]  The {\bf PIDraw3DWdg} viewer options: \\ | 
|---|
|  | 580 | \begin{verbatim} | 
|---|
|  | 581 | >> To define the 3D box limits : | 
|---|
|  | 582 | xyzlimits=xmin,xmax,ymin,ymax,zmin,zmax | 
|---|
|  | 583 | limit3dbox=xmin,xmax,ymin,ymax,zmin,zmax | 
|---|
|  | 584 | >> Autoscaling flags (rescaling of X/Y or X/Y/Z axes) | 
|---|
|  | 585 | autoscale3dbox  / noautoscale3dbox | 
|---|
|  | 586 | autoscalexy3dbox / noautoscalexy3dbox | 
|---|
|  | 587 | autoscalez3dbox / noautoscalez3dbox | 
|---|
|  | 588 | >> To change the background color (default=white) | 
|---|
|  | 589 | wbgcol=colname | 
|---|
|  | 590 |  | 
|---|
|  | 591 | \end{verbatim} | 
|---|
|  | 592 | %%% | 
|---|
|  | 593 | \item[\bul]  The {\bf PIImage} viewer options: \\ | 
|---|
|  | 594 | \begin{verbatim} | 
|---|
|  | 595 | >> Define display zoomfactor | 
|---|
|  | 596 | zoomxFact     (zoomx2 zoomx3 ... zoomx9 ...) | 
|---|
|  | 597 | zoom/Fact  (zoom/2 zoom/3 ... ) | 
|---|
|  | 598 | >> LUT (look-up table) definition (pixel value to index conversion) | 
|---|
|  | 599 | lut=type,min,max   (type=lin/log/sqrt/square) | 
|---|
| [3294] | 600 | >> AutoLut selector : define the method for automatic determination | 
|---|
|  | 601 | of LUT limits (min/max) | 
|---|
|  | 602 | autolut=alt[,ns[,minp,maxp]] (minp<=pixels<=maxp) | 
|---|
|  | 603 | - autolut=minmax[,Frac] 0<=Frac<=1 | 
|---|
|  | 604 | - autolut=meansig[,ns] --> mean +/- ns*sigma | 
|---|
|  | 605 | - autolut=hispeak[,ns] --> around the peak of pixel values histogram | 
|---|
|  | 606 | - autolut=histail[,ns] --> the tail of pixel values histogram | 
|---|
| [3043] | 607 | >> Define color table and reversing color indexing flag | 
|---|
|  | 608 | ColTableName     revcmap | 
|---|
|  | 609 | ==> Standard tables with 32 distinct colors: | 
|---|
|  | 610 | grey32  invgrey32 colrj32  colbr32  colrv32 | 
|---|
|  | 611 | ==> Standard tables with 128 distinct colors: | 
|---|
|  | 612 | grey128  invgrey128  colrj128  colbr128 | 
|---|
|  | 613 | ==> Shades of red/green/blue ... | 
|---|
|  | 614 | red32cm  green32cm  blue32cm  yellow32cm | 
|---|
|  | 615 | orange32cm cyan32cm violet32cm | 
|---|
|  | 616 | ==> Some of MIDAS color tables : | 
|---|
|  | 617 | midas_pastel  midas_heat  midas_rainbow3 | 
|---|
|  | 618 | midas_bluered  midas_bluewhite  midas_stairs8 | 
|---|
|  | 619 | midas_stairs9 midas_staircase midas_color | 
|---|
|  | 620 | midas_manycol  midas_idl14  midas_idl15 | 
|---|
|  | 621 | ==> Other tables | 
|---|
|  | 622 | multicol16 multicol64 | 
|---|
|  | 623 | >> Viewed center position (image/array coordinates) | 
|---|
|  | 624 | imagecenter=xc,yc | 
|---|
|  | 625 | >> Array axes to window axes mapping flags | 
|---|
|  | 626 | invx  invy  exchxy | 
|---|
|  | 627 | >> To change the background color (default=black) | 
|---|
|  | 628 | wbgcol=colname | 
|---|
|  | 629 |  | 
|---|
|  | 630 | \end{verbatim} | 
|---|
|  | 631 | %%% | 
|---|
|  | 632 | \item[\bul]  The {\bf PIGraphicAtt} Generic graphic attributes (color/font/line \ldots) | 
|---|
|  | 633 | decoded by all drawers: \\ | 
|---|
|  | 634 | \begin{verbatim} | 
|---|
|  | 635 | >>> color=ColorName - fgcolor=ColorName - bgcolor=ColorName | 
|---|
|  | 636 | ColorName: black white grey red blue green yellow | 
|---|
|  | 637 | magenta cyan turquoise navyblue orange | 
|---|
|  | 638 | siennared purple  limegreen gold violet | 
|---|
|  | 639 | violetred blueviolet darkviolet skyblue | 
|---|
|  | 640 | royalblue forestgreen orangered brown | 
|---|
|  | 641 | >>> line=DashType,LineWidth | 
|---|
|  | 642 | DashType: solid, dash, dotted, dashdotted   Width: 1,2,... | 
|---|
|  | 643 | >>> font=FontName,FontAtt,FontSize | 
|---|
|  | 644 | FontName: courier, helvetica, times, symbol | 
|---|
|  | 645 | FontAtt: roman, bold, italic, bolditalic | 
|---|
|  | 646 | FontSize: 6,8,10,12... (pts) - integer | 
|---|
|  | 647 | >>> marker=MarkerType,MarkerSize (MarkerSize: integer 3,5,7... | 
|---|
|  | 648 | MarkerType: dot, plus, cross, circle, fcircle, box, fbox | 
|---|
|  | 649 | triangle, ftriangle, star, fstar | 
|---|
|  | 650 | >>> arrow=ArrowType,ArrowSize (ArrowSize: integer 3,5,7... | 
|---|
|  | 651 | ArrowType: basic, triangle, ftriangle, | 
|---|
|  | 652 | arrowshaped, farrowshaped | 
|---|
|  | 653 | >>> ColorTables: defcmap  grey32  invgrey32  colrj32  colbr32 | 
|---|
|  | 654 | grey128  invgrey128  colrj128  colbr128 | 
|---|
|  | 655 | red32cm  green32cm  blue32cm  yellow32cm | 
|---|
|  | 656 | orange32cm cyan32cm violet32cm | 
|---|
|  | 657 | midas_pastel midas_heat midas_rainbow3 midas_bluered | 
|---|
|  | 658 | midas_bluewhite midas_redwhite | 
|---|
|  | 659 | multicol16 multicol64 | 
|---|
|  | 660 | >   revcmap : This flag reverses ColorMap indexing | 
|---|
|  | 661 | ------- Old style graphic att ---------- | 
|---|
|  | 662 | >> Lines:  defline normalline thinline thickline dashedline thindashedline | 
|---|
|  | 663 | thickdashedline dottedline thindottedline thickdottedline | 
|---|
|  | 664 | >> Font Att: deffontatt normalfont boldfont italicfont bolditalicfont | 
|---|
|  | 665 | smallfont smallboldfont smallitalicfont smallbolditalicfont | 
|---|
|  | 666 | bigfont bigboldfont bigitalicfont bigbolditalicfont | 
|---|
|  | 667 | hugefont  hugeboldfont hugeitalicfont hugebolditalicfont | 
|---|
|  | 668 | >> Font Names: deffont courierfont helveticafont timesfont symbolfont | 
|---|
|  | 669 | >> Marker: dotmarker<S>  plusmarker<S>  crossmarker<S> circlemarker <S> | 
|---|
|  | 670 | fcirclemarker<S> boxmarker<S> fboxmarker<S> trianglemarker<S> | 
|---|
|  | 671 | ftrianglemarker<S>  starmarker<S>  fstarmarker<S> | 
|---|
|  | 672 | with <S> = 1 3 5 7 9 , Example fboxmarker5 , plusmarker9 ... | 
|---|
|  | 673 |  | 
|---|
|  | 674 | \end{verbatim} | 
|---|
|  | 675 | %%%% | 
|---|
|  | 676 | \item[\bul]  The {\bf PIElDrawer} decodes axe drawing attributes: \\ | 
|---|
|  | 677 | \begin{verbatim} | 
|---|
|  | 678 | >> Axe and grid configuration flags: | 
|---|
|  | 679 | axesnone  stdaxes defaxes | 
|---|
|  | 680 | boxaxes boxaxesgrid fineaxes fineaxesgrid | 
|---|
|  | 681 | centeredaxes finecenteredaxes centeredaxesgrid | 
|---|
|  | 682 | finecenteredaxesgrid  grid/nogrid | 
|---|
|  | 683 | >> Centered axes position: axescenter=xc,yc | 
|---|
|  | 684 | >> Axe ticks/labels (h=horizontal/x, v=vertical/y): | 
|---|
|  | 685 | labels/nolabels  hlabels/nohlabels vlabels/novlabels | 
|---|
|  | 686 | ticks/noticks minorticks/nominorticks | 
|---|
|  | 687 | extticks/intticks/extintticks nbticks=X_NbTicks,Y_NbTicks | 
|---|
|  | 688 | tickslen=MajorTickLenFrac,MinorTickLenFraC | 
|---|
|  | 689 | >> Axe label font size: | 
|---|
|  | 690 | autofontsize=FontSizeFrac fixedfontsize | 
|---|
|  | 691 | >> Up/Down title: title tit notitle notit | 
|---|
|  | 692 | ... Color/Font/line attributes : | 
|---|
|  | 693 |  | 
|---|
|  | 694 | \end{verbatim} | 
|---|
|  | 695 | \item[\bul]  The {\bf PINTuple} handles most 2D plotting : \\ | 
|---|
|  | 696 | \begin{verbatim} | 
|---|
|  | 697 | sta,stat,stats:            activate   statistic display | 
|---|
|  | 698 | nsta,nstat,nostat,nostats: deactivate statistic display | 
|---|
|  | 699 | statposoff=OffsetX,OffsetY : Position offset for Stats drawing | 
|---|
|  | 700 | as a fraction of total size | 
|---|
|  | 701 | connectpoints: The points are connected by a line | 
|---|
|  | 702 | noconnectpoints (this is the default) | 
|---|
|  | 703 | colorscale/nocolorscale (Use color scale for weight) | 
|---|
|  | 704 | sizescale/sizescale=nbins/nosizescale (Use marker size for weight) | 
|---|
|  | 705 | (and usual color/line/marker/... attribute decoding) | 
|---|
|  | 706 |  | 
|---|
|  | 707 | \end{verbatim} | 
|---|
|  | 708 | %%% | 
|---|
|  | 709 | \item[\bul]  {\bf PIHisto} and {\bf PIHisto2D} handle1D and 2D histograms display. \\ | 
|---|
|  | 710 | The following options are recognised by PIHisto: \\ | 
|---|
|  | 711 | \begin{verbatim} | 
|---|
| [3138] | 712 | ---- PIHisto options help info : | 
|---|
| [3043] | 713 | sta,stat,stats:            activate   statistic display | 
|---|
|  | 714 | nsta,nstat,nostat,nostats: deactivate statistic display | 
|---|
|  | 715 | err / noerr,nerr : draw, do not draw error bars | 
|---|
|  | 716 | autoerr : draw error bars if Marker drawing requested OR Profile histo | 
|---|
|  | 717 | fill / nofill,nfill : fill, do not fill bars with selected color | 
|---|
|  | 718 | statposoff=OffsetX,OffsetY : Position offset for Stats drawing | 
|---|
|  | 719 | as a fraction of total size | 
|---|
| [3151] | 720 | ---- HistoWrapper options : | 
|---|
|  | 721 | hbincont: select bin content as Y value for display (default) | 
|---|
|  | 722 | hbinerr: select bin error as Y value for display | 
|---|
|  | 723 | hbinent: select bin entries as Y value for display | 
|---|
|  | 724 | hscale=value : multiplicative factor for Y value | 
|---|
|  | 725 | hoffset=value : additive coefficient for Y value | 
|---|
|  | 726 | hs1: set hscale=1 hoffset=0  (default) | 
|---|
|  | 727 | hscale=value  : multiplicative factor (in Y) | 
|---|
| [3138] | 728 |  | 
|---|
| [3043] | 729 | \end{verbatim} | 
|---|
|  | 730 | The following options are recognised by PIHisto2D: \\ | 
|---|
|  | 731 | \begin{verbatim} | 
|---|
|  | 732 | - sta,stat,stats:            activate   statistic display | 
|---|
|  | 733 | nsta,nstat,nostat,nostats: deactivate statistic display | 
|---|
|  | 734 | - h2disp=typ[,fracpts]: choose display type | 
|---|
|  | 735 | typ=var: variable size boxes | 
|---|
|  | 736 | typ=hbk: "a la hbook2" | 
|---|
|  | 737 | typ=img: image like (use "h2col" for color map) | 
|---|
|  | 738 | typ=pts: point clouds (fracpts=max possible fraction | 
|---|
|  | 739 | of used pixels per bin [0,1]) | 
|---|
|  | 740 | - h2scale=lin/log[,logscale]: choose linear or logarithmic scale | 
|---|
|  | 741 | - h2dyn=[hmin][,hmax]: choose histogramme range for display | 
|---|
|  | 742 | - use general key to define color table (ex: grey32,midas_heat,...) | 
|---|
|  | 743 | (see general graphicatt description) | 
|---|
|  | 744 | - use key "revcmap" to reverse color table | 
|---|
|  | 745 | - h2frac=[fmin][,fmax]: choose sub-range display [0,1] | 
|---|
| [3151] | 746 | ---- HistoWrapper options : (see HistoWrapper above) | 
|---|
| [3043] | 747 |  | 
|---|
|  | 748 | \end{verbatim} | 
|---|
|  | 749 | %%%% | 
|---|
|  | 750 | \item[\bul]  The {\bf PINTuple3D} and {\bf PISurfaceDrawer} | 
|---|
|  | 751 | handles basic 3D plotting and can decode the common 3D box options: \\ | 
|---|
|  | 752 | \begin{verbatim} | 
|---|
|  | 753 | X/Y,Z axis rescaling option (-> cubic 3D box) | 
|---|
|  | 754 | rescale=autoscale/ norescale=noautoscale : X/Y and Z axis | 
|---|
|  | 755 | rescalexy=autoscalexy / norescalexy=noautoscalexy : X/Y  axis | 
|---|
|  | 756 | rescalexy=autoscalexy / norescalexy=noautoscalexy : Z axis | 
|---|
|  | 757 | \end{verbatim} | 
|---|
|  | 758 | The  PINTuple3D decodes in addition the following options: | 
|---|
|  | 759 | \begin{verbatim} | 
|---|
|  | 760 | connectpoints: The points are connected by a line | 
|---|
|  | 761 | noconnectpoints (this is the default) | 
|---|
|  | 762 | colorscale/nocolorscale (Use color scale for weight) | 
|---|
|  | 763 | sizescale/sizescale=nbins/nosizescale (Use marker size for weight) | 
|---|
|  | 764 |  | 
|---|
|  | 765 | \end{verbatim} | 
|---|
|  | 766 | \item[\bul]  {\bf PIBarGraph} options : \\ | 
|---|
|  | 767 | \begin{verbatim} | 
|---|
|  | 768 | ---- PIBarGraph options help info : | 
|---|
|  | 769 | fill/nofill: set bar fill option | 
|---|
|  | 770 | horizontalbars/verticalbars: set bar orientation | 
|---|
|  | 771 | packfrac=value : set bar packing fraction (0..1) | 
|---|
|  | 772 | barvaluelabel/nobarvaluelabel: Use/Don't use bar value as labels | 
|---|
|  | 773 | --- + Usual colr/line/font  attribute decoding ... | 
|---|
|  | 774 | \end{verbatim} | 
|---|
|  | 775 | \end{itemize} | 
|---|
|  | 776 |  | 
|---|
|  | 777 |  | 
|---|
| [3041] | 778 | %%%%%%%%%%%%%%% Section 4 :   I/O | 
|---|
|  | 779 | \newpage | 
|---|
| [3302] | 780 | \section{Data formats and input-output (I/O)} | 
|---|
|  | 781 | The data file formats recognized by piapp are the ones supported by the | 
|---|
|  | 782 | SOPHYA library or its extension. | 
|---|
| [3041] | 783 | \begin{itemize} | 
|---|
| [3302] | 784 | \item[\bul] ASCII files - Data can be imported from ascii (text) files as | 
|---|
|  | 785 | datatables or arrays. These objects can also be exported as text files. | 
|---|
|  | 786 | \item[\bul] FITS files - FITS is a popular format used in particular in astronomy. | 
|---|
|  | 787 | \href{http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html} | 
|---|
|  | 788 | Data is usually read from FITS files as vectors, images, cubes or tables. | 
|---|
|  | 789 | A subset of SOPHYA objects can be exported in FITS format. | 
|---|
|  | 790 | \item[\bul] PPF (Portable Persistence file Format) is the native SOPHYA | 
|---|
|  | 791 | data format. | 
|---|
|  | 792 | \item[\bul] PostScript - All graphic output produced by piapp can be exported | 
|---|
|  | 793 | as postscript (.ps) or encapsulated postscript (.eps) files. | 
|---|
|  | 794 | \end{itemize} | 
|---|
|  | 795 |  | 
|---|
|  | 796 | \subsection{text files} | 
|---|
|  | 797 | ASCII files (see {\tt ntfrascii} \myppageref{ntfrascii} and | 
|---|
| [3041] | 798 | {\tt newnt} \myppageref{newnt} command) | 
|---|
| [3302] | 799 | \subsection{FITS and PPF} | 
|---|
|  | 800 | FITS format files, through \menubar{File/Open-Fits}. | 
|---|
| [3041] | 801 | (see also (see {\tt openfits} \myppageref{openfits}) command. | 
|---|
| [3302] | 802 | PPF (Portable Persistence file Format) files through | 
|---|
| [3041] | 803 | menu \menubar{File/Open-PPF}. PPF files are the native persistence | 
|---|
| [3302] | 804 | format in Sophya | 
|---|
|  | 805 | \subsection{Graphic export in postscript} | 
|---|
|  | 806 | See the menu under \menubar{PostScript} | 
|---|
| [2171] | 807 |  | 
|---|
| [3041] | 808 | %%%%%%%%%%%%%%% Section 5 :   analyse a la paw | 
|---|
| [2171] | 809 | \newpage | 
|---|
| [3041] | 810 | \section{Tables and interactive analysis} | 
|---|
| [3043] | 811 | \label{tableplot} | 
|---|
| [3041] | 812 |  | 
|---|
|  | 813 | %%%%%%%%%%%%%%% Section 6 :  command interpreter | 
|---|
|  | 814 | \newpage | 
|---|
|  | 815 | \section{Command interpreter} | 
|---|
|  | 816 | piapp uses the class {\bf PIACmd} which extends slightly the | 
|---|
|  | 817 | SOPHYA class {\bf Commander} as the command interpreter. | 
|---|
|  | 818 | {\bf Commander} is a  c-shell inspired, string oriented command | 
|---|
|  | 819 | interpreter.  Although it has many limitations compared to | 
|---|
|  | 820 | c-shell, or Tcl , it provides some interesting possibilities: | 
|---|
|  | 821 | \begin{itemize} | 
|---|
|  | 822 | \item Extended arithmetic operations (c-like and RPN) | 
|---|
|  | 823 | \item Simple and vector variables | 
|---|
|  | 824 | \item Script definition | 
|---|
|  | 825 | \item Command execution in separate threads | 
|---|
|  | 826 | \item Dynamic Load | 
|---|
|  | 827 | \end{itemize} | 
|---|
|  | 828 |  | 
|---|
|  | 829 | We describe below  the {\bf Commander} possibilities, | 
|---|
|  | 830 | as well as the few {\bf PIACmd} extensions. | 
|---|
|  | 831 |  | 
|---|
|  | 832 | \subsection{Variables} | 
|---|
|  | 833 | The SOPHYA::Commander interpreter manages non typed set of variables. | 
|---|
|  | 834 | Environment variables are also accessible through | 
|---|
|  | 835 | the usual {\tt \$varenvname}, unless shadowed by a Commander | 
|---|
|  | 836 | variable. All Commander variables are vector of strings, and are | 
|---|
|  | 837 | extended as necessary.  {\tt \$varname} is the string formed by all | 
|---|
|  | 838 | the vector elements. Except when performing arithmetic operations, | 
|---|
|  | 839 | variables are treated  as strings. | 
|---|
|  | 840 | \par | 
|---|
|  | 841 | An application level set of variables is also managed | 
|---|
|  | 842 | by Commander, through redefinition of \\ | 
|---|
| [3043] | 843 | {\tt Commander::GetVarApp() / GetVarApp() \ldots } methods.  \\ | 
|---|
| [3041] | 844 | The {\bf PIACmd} in piapp redefines the {\tt GetVarApp() } | 
|---|
|  | 845 | in order to provide an easy access to some of objects attributes or methods, | 
|---|
| [3043] | 846 | managed by {\bf NamedObjMgr} (See below). | 
|---|
| [3041] | 847 |  | 
|---|
|  | 848 | \begin{itemize} | 
|---|
|  | 849 | \item[\rond] {\bf Definition and initialisation of variables } | 
|---|
|  | 850 | \begin{verbatim} | 
|---|
|  | 851 | # Notice that the set command has no = sign | 
|---|
|  | 852 | Cmd> set sv StringValue | 
|---|
|  | 853 | # Clearing/removing  of a variable : unset or clearvar | 
|---|
|  | 854 | Cmd> unset sv | 
|---|
|  | 855 |  | 
|---|
|  | 856 | # Definition of a multi element variable (vector type) | 
|---|
|  | 857 | # Notice that spaces before / after '(' and ')' are mandatory | 
|---|
|  | 858 | Cmd> set vecv ( mot1 mot2 mot3 mot4 mot5 ) | 
|---|
| [3046] | 859 | # Arithmetic  expression : C language syntax - spaces before/after '=' are mandatory | 
|---|
|  | 860 | Cmd> a = 2+3*sqrt(4) | 
|---|
| [3041] | 861 | # The '=' operator can also be used to initialize a variable with a string | 
|---|
|  | 862 | Cmd> a = 'Bonjour Madame' | 
|---|
|  | 863 | # A vector element can be specified in the left hand side | 
|---|
|  | 864 | Cmd> vecv[2] = 'coucou' | 
|---|
|  | 865 | # Or using an interpreter variable as index : | 
|---|
|  | 866 | Cmd> i = 3 | 
|---|
|  | 867 | Cmd> vecv[i] = 'Ooohhh' | 
|---|
|  | 868 | \end{verbatim} | 
|---|
|  | 869 |  | 
|---|
|  | 870 | On the right hand side, the value of a variable should be accessed using | 
|---|
|  | 871 | the \$ character.  \\ | 
|---|
|  | 872 | A string can be parsed  into words using {\tt  var2words} | 
|---|
|  | 873 | \begin{verbatim} | 
|---|
|  | 874 | Cmd> var2words varname wordvarname [separateur] | 
|---|
|  | 875 | \end{verbatim} | 
|---|
|  | 876 |  | 
|---|
|  | 877 | \item[\rond] {\bf Accessing variable contents } \\ | 
|---|
|  | 878 | The \$ character is used to access the content of a variable {\tt \$varname} . | 
|---|
|  | 879 | Substitution rules : | 
|---|
|  | 880 | The {\tt \$xxx} is replaced by the value of  variable xxx. | 
|---|
|  | 881 | No substitution is performed for strings enclosed in simple quotes {\tt ' ... \$xxx '}, | 
|---|
|  | 882 | but substitution is done in strings enclosed in double quotes. | 
|---|
|  | 883 | Parenthesis or brackets can be used to specify the variable name, inside a string | 
|---|
|  | 884 | without white space: {\tt \${vname} } ou {\tt \$(vname)}. | 
|---|
|  | 885 | \begin{verbatim} | 
|---|
|  | 886 | Cmd> x = 'Hello' | 
|---|
|  | 887 | Cmd> echo $x | 
|---|
|  | 888 | # Size of a vector variable : $#vname | 
|---|
|  | 889 | Cmd> set vx ( 111 2222 3333 444444 ) | 
|---|
|  | 890 | Cmd> echo $#vx | 
|---|
|  | 891 | # Accessing vector elements | 
|---|
|  | 892 | Cmd> echo $vx[0] $vx[1] | 
|---|
|  | 893 | #  or using an interpreter variable as index : | 
|---|
|  | 894 | Cmd> i = 2 | 
|---|
|  | 895 | Cmd> echo $vx[i] | 
|---|
|  | 896 | # Special syntax:  $[vname] is replaced by the content | 
|---|
|  | 897 | # of a  variable whose name is $vname | 
|---|
|  | 898 | Cmd> zzz = 'Commander' | 
|---|
|  | 899 | Cmd> xxx = 'zzz' | 
|---|
|  | 900 | Cmd> echo '---> $[xxx]= '  $[xxx] | 
|---|
|  | 901 | ---> $[xxx]= Commander | 
|---|
|  | 902 | \end{verbatim} | 
|---|
|  | 903 |  | 
|---|
|  | 904 | \par | 
|---|
|  | 905 |  | 
|---|
|  | 906 | \item[\rond] {\bf Special variables } | 
|---|
|  | 907 | \begin{itemize} | 
|---|
|  | 908 | \item {\tt \$retval} ou {\tt \$retstr}  :  the string specified in the last {\bf return} statement | 
|---|
|  | 909 | \item {\tt \$status} : Return code from the last executed command. | 
|---|
|  | 910 | Arguments of scripts (see below) or file executed through {\bf exec} command. | 
|---|
|  | 911 | \item {\tt \$\# } : number of arguments, except \$0 | 
|---|
|  | 912 | \item {\tt \$0}  : Script or file name | 
|---|
|  | 913 | \item {\tt \$1 \$2 \$3} ....  : Arguments  (for scripts and .pic files (exec)) | 
|---|
|  | 914 | \end{itemize} | 
|---|
| [3043] | 915 |  | 
|---|
|  | 916 | \item[\rond] {\bf Objects/Application level variables} \\ | 
|---|
|  | 917 | For some classes managed by NamedObjMgr, | 
|---|
|  | 918 | PIACmd provide acces to some of the attributes of the object by | 
|---|
|  | 919 | {\tt \${objname.attname} }. This mechanism has been implemented in particular for | 
|---|
|  | 920 | TArrays, TMatrix/TVector, Histograms, NTuples and DataTables. | 
|---|
|  | 921 | In addition, when brackets  are used ($\${vname}$), the priority level between interpreter variables | 
|---|
|  | 922 | and application level variable is changed. If {\tt vname} exist at the application level, | 
|---|
|  | 923 | {\tt \${vname} }  is replaced by its value, even if an interpreter variable with the | 
|---|
|  | 924 | same name has been defined. | 
|---|
|  | 925 | \begin{verbatim} | 
|---|
|  | 926 | # -------- Example with a Vector | 
|---|
|  | 927 | piapp[1] newvec va 12 | 
|---|
|  | 928 | piapp[2] echo $va | 
|---|
|  | 929 | TVector<d>(12) (nr=12, nc=1) | 
|---|
|  | 930 | # ------- An undefined attribute, such as ? might be | 
|---|
|  | 931 | #           used to get list of valid attributes | 
|---|
|  | 932 | piapp[3] echo ${va.?} | 
|---|
|  | 933 | TMatrix.Att: rank size/nelts nrow/nrows ncol/ncols sum | 
|---|
|  | 934 | #  Compound names, in the form  name.att must be inclosed in braces {name.att} | 
|---|
|  | 935 | piapp[4] echo ${va.size} | 
|---|
|  | 936 | 12 | 
|---|
|  | 937 | # -------- Example with an histogram | 
|---|
|  | 938 | piapp[8] newh1d his 0. 20. 40 | 
|---|
|  | 939 | piapp[10] echo ${his.?} | 
|---|
|  | 940 | Histo1D: nbin binw mean sigma over under nentries ndata | 
|---|
|  | 941 | xmin xmax vmin vmax imin imax | 
|---|
|  | 942 | piapp[11] echo ${his.nbin} | 
|---|
|  | 943 | 40 | 
|---|
|  | 944 | \end{verbatim} | 
|---|
|  | 945 |  | 
|---|
|  | 946 | \item[\rond] {\bf Environment variables} can simply be accessed by {\tt \$varenvname}. | 
|---|
|  | 947 | However,  the environment variables have the lowest priority during substitution. | 
|---|
|  | 948 | Interpreter's variables have the highest priority, followed | 
|---|
|  | 949 | by the application level variables. | 
|---|
|  | 950 |  | 
|---|
| [3041] | 951 | \end{itemize} | 
|---|
|  | 952 |  | 
|---|
| [3043] | 953 |  | 
|---|
| [3041] | 954 | \subsection{Control structures} | 
|---|
|  | 955 |  | 
|---|
|  | 956 | \begin{itemize} | 
|---|
|  | 957 | \item[\rond] Enumerated loop: | 
|---|
|  | 958 | \begin{verbatim} | 
|---|
|  | 959 | foreach f ( w1 w2 w3 ... ) | 
|---|
|  | 960 | ... | 
|---|
|  | 961 | echo $f | 
|---|
|  | 962 | end | 
|---|
|  | 963 | \end{verbatim} | 
|---|
|  | 964 |  | 
|---|
|  | 965 | Note that spaces before/after  '(' et and  ')' are mandatory. | 
|---|
|  | 966 | An alternative form uses a vector variable name : | 
|---|
|  | 967 | \begin{verbatim} | 
|---|
|  | 968 | foreach v vecname | 
|---|
|  | 969 | ... | 
|---|
|  | 970 | echo $v | 
|---|
|  | 971 | end | 
|---|
|  | 972 | \end{verbatim} | 
|---|
|  | 973 |  | 
|---|
|  | 974 | \item[\rond] Integer type loop: | 
|---|
|  | 975 | \begin{verbatim} | 
|---|
|  | 976 | for i  startInt:endInt[:stepInt] | 
|---|
|  | 977 | .... | 
|---|
|  | 978 | echo $i | 
|---|
|  | 979 | end | 
|---|
|  | 980 | \end{verbatim} | 
|---|
|  | 981 |  | 
|---|
|  | 982 | \item[\rond] Integer type loop: | 
|---|
|  | 983 | \begin{verbatim} | 
|---|
|  | 984 | for f  startFloat:endFloat[:stepFloat] | 
|---|
|  | 985 | .... | 
|---|
|  | 986 | echo $f | 
|---|
|  | 987 | end | 
|---|
|  | 988 | \end{verbatim} | 
|---|
|  | 989 |  | 
|---|
|  | 990 | \item[\rond] Loop over lines of a file | 
|---|
|  | 991 | \begin{verbatim} | 
|---|
|  | 992 | forinfile line FileName | 
|---|
|  | 993 | ... | 
|---|
|  | 994 | echo $line | 
|---|
|  | 995 | end | 
|---|
|  | 996 | \end{verbatim} | 
|---|
|  | 997 |  | 
|---|
|  | 998 | \item[\rond] The {\tt break} instruction can be used to exit from a loop | 
|---|
|  | 999 |  | 
|---|
|  | 1000 | \item[\rond] {\bf if then else} Conditional execution: | 
|---|
|  | 1001 | \begin{verbatim} | 
|---|
|  | 1002 | if ( test ) then | 
|---|
|  | 1003 | endif | 
|---|
|  | 1004 |  | 
|---|
|  | 1005 | if ( test ) then | 
|---|
|  | 1006 | .... | 
|---|
|  | 1007 | else | 
|---|
|  | 1008 | .... | 
|---|
|  | 1009 | endif | 
|---|
|  | 1010 | \end{verbatim} | 
|---|
|  | 1011 | Note that spaces before/after  '(' et and  ')' are mandatory. | 
|---|
|  | 1012 |  | 
|---|
|  | 1013 | test is in the form {\tt a == b} OR {\tt a != b} OR {\tt a < b}  OR {\tt a > b} | 
|---|
|  | 1014 | OR {\tt a <= b} OR {\tt a >= b}. Comparison operators should be delimited | 
|---|
|  | 1015 | by spaces. | 
|---|
|  | 1016 | {\tt ==} et {\tt !=}  make a string comparison, while | 
|---|
|  | 1017 | {\tt < , > , <= , >=} compare the values obtained after string to double conversion. | 
|---|
|  | 1018 | \end{itemize} | 
|---|
|  | 1019 |  | 
|---|
|  | 1020 | \subsection{Script definition} | 
|---|
|  | 1021 | A script is a sequence of commands. It is very similar to the execution of commands | 
|---|
|  | 1022 | from a file ({\bf exec filename}). Once a script has been defined, it can be called specifying | 
|---|
|  | 1023 | specifying the script name followed by its arguments. | 
|---|
|  | 1024 | \begin{verbatim} | 
|---|
|  | 1025 | #  Script definition : | 
|---|
|  | 1026 | defscript scriptname  [description ] | 
|---|
|  | 1027 | .... | 
|---|
|  | 1028 | endscript | 
|---|
|  | 1029 |  | 
|---|
|  | 1030 | #  Executing the script | 
|---|
|  | 1031 | Cmd> scriptname arg1 arg2 arg3 .... | 
|---|
|  | 1032 | \end{verbatim} | 
|---|
|  | 1033 |  | 
|---|
|  | 1034 | The {\tt return} instruction stops the execution and returns from a script, or from a command | 
|---|
|  | 1035 | file called through {\bf exec}. \\ | 
|---|
|  | 1036 | The commands  {\bf listscript } and  {\bf clearscript scriptname} can be used | 
|---|
|  | 1037 | to obtain the list of already defined script, or to clear a script definition. | 
|---|
|  | 1038 |  | 
|---|
|  | 1039 | \subsection{Other built-in commands} | 
|---|
|  | 1040 | \begin{itemize} | 
|---|
|  | 1041 | \item[\rond] Instruction {\bf echo } to write the line to cout/stdout | 
|---|
|  | 1042 | \item[\rond] Instruction {\bf echo2file} to write (append) the line to file ({\tt echo2file filename ....}) | 
|---|
|  | 1043 | \item[\rond] Instruction {\bf sleep nsec} wait for {\tt nsec}  seconds | 
|---|
|  | 1044 | \item[\rond] Instructions {\bf timingon , timingoff , traceon , traceoff } \\ | 
|---|
|  | 1045 | % | 
|---|
|  | 1046 | \item[\rond] {\bf exec filename [arg1 arg2 ... ] } to execute command from | 
|---|
|  | 1047 | the file named {\tt filename}. {\tt .pic} is the default extension for the interpreter | 
|---|
|  | 1048 | command files. | 
|---|
|  | 1049 | \item[\rond]  {\bf help} and {help keyword/commandname } | 
|---|
|  | 1050 | \item[\rond]  {\bf listvars , listcommands } to print the list of defined variables and known | 
|---|
|  | 1051 | commands | 
|---|
|  | 1052 | \item[\rond]  An alias for a command by {\bf alias aliasname 'string ' }. Alias substitution | 
|---|
|  | 1053 | occurs for the first word in a command line. {\bf  listalias} prints the list of all | 
|---|
|  | 1054 | defined aliases. | 
|---|
|  | 1055 | \item[\rond] Execution control (piapp/PIACmd extension): | 
|---|
|  | 1056 | It is possible to stop the interpreter execution in a loop, a script or | 
|---|
|  | 1057 | a command file by the {\bf stop} command, or using | 
|---|
|  | 1058 | {\tt <Cntrl C>} in the piapp console (PIConsole) \\ | 
|---|
|  | 1059 | \end{itemize} | 
|---|
|  | 1060 |  | 
|---|
|  | 1061 | \subsection {Command execution in separate threads} | 
|---|
|  | 1062 | It is possible to create new threads to execute commands | 
|---|
|  | 1063 | ( for non built-in interpreter commands). The syntax is similar | 
|---|
|  | 1064 | to unix shell background tasks: an {\&} should be added at the end | 
|---|
|  | 1065 | of the command line.  A new thread is then created for the | 
|---|
|  | 1066 | execution of the command, if declared as thread safe \\ | 
|---|
|  | 1067 | (see {\tt CmdExecutor::IsThreadable() }. | 
|---|
|  | 1068 | \par | 
|---|
|  | 1069 | Thread management commands: | 
|---|
|  | 1070 | \begin{itemize} | 
|---|
|  | 1071 | \item[\rond] {\bf thrlist }Print current list of threads, with the associated command | 
|---|
|  | 1072 | the thread identifier (integer ThrId) and its status. | 
|---|
|  | 1073 | \item[\rond] {\bf cleanthrlist } Removes all finished threads from the list. | 
|---|
|  | 1074 | An automatic cleanup is performed periodically. | 
|---|
|  | 1075 | \item[\rond] {\bf cancelthr ThId } / {\bf killthr ThId } Stops/kills the thread with | 
|---|
|  | 1076 | the identifier ThId. Avoid using theses commands as the cleanup does | 
|---|
|  | 1077 | not release some resources associated with | 
|---|
|  | 1078 | the thread (memory, mutex \ldots). | 
|---|
|  | 1079 | \end{itemize} | 
|---|
|  | 1080 |  | 
|---|
|  | 1081 | %%%%%%%%%%%%%%% Section 7 :  c++ execution | 
|---|
|  | 1082 | \newpage | 
|---|
|  | 1083 | \section{On the fly C++ execution} | 
|---|
|  | 1084 |  | 
|---|
|  | 1085 | %%%%%%%%%%%%%%% Section 8 :  command reference | 
|---|
|  | 1086 | \newpage | 
|---|
| [2171] | 1087 | \section{piapp command reference} | 
|---|
| [2253] | 1088 | \label{piappcmdref} | 
|---|
| [2171] | 1089 | This section contains the description of piapp commands. This information | 
|---|
|  | 1090 | is available on-line, through the help command, or through a graphic | 
|---|
| [3041] | 1091 | window, accessible  by \menubar{File / Help}. | 
|---|
| [2171] | 1092 | The help items and command are divided into different sections, | 
|---|
|  | 1093 | where related commands are grouped. \\[10mm] | 
|---|
|  | 1094 |  | 
|---|
|  | 1095 | % \include{piahelp} | 
|---|
|  | 1096 | \input{piahelp.tex} | 
|---|
|  | 1097 |  | 
|---|
|  | 1098 | %  La partie des appendix | 
|---|
|  | 1099 | \appendix | 
|---|
|  | 1100 | \newpage | 
|---|
| [3041] | 1101 | \section{Interactive control windows} | 
|---|
|  | 1102 | \subsection{DrawerTools} \index{DrawerTools} | 
|---|
| [2171] | 1103 | \label{secdrwtools} | 
|---|
|  | 1104 | The {\bf PIDrawerTools}, shown in the figure \ref{figdrwtools} can be | 
|---|
|  | 1105 | used to change the graphic attributes (color, font, marker, \ldots) | 
|---|
|  | 1106 | of the Drawers displayed in 2D displays | 
|---|
|  | 1107 | ({\bf PIScDrawWdg} \myppageref{PIScDrawWdg}) or 3D displays | 
|---|
|  | 1108 | ({\bf PIDraw3DWdg} \myppageref{PIDraw3DWdg}), as well in image displays | 
|---|
|  | 1109 | {\bf PIImage} (\myppageref{PIImage}). The PIDrawerTools can be activated | 
|---|
|  | 1110 | either using {\tt Alt<G>} on a PIScDrawWdg,PIDraw3DWdg,PIImage, | 
|---|
| [3043] | 1111 | or through the \menubar{Tools/Show DrawerTools}. | 
|---|
|  | 1112 | A given drawer can be selected through the DrawerId selector (+ / - buttons) | 
|---|
| [2171] | 1113 |  | 
|---|
| [3041] | 1114 | \vspace*{5mm} | 
|---|
| [2171] | 1115 | \begin{figure}[ht!] | 
|---|
|  | 1116 | \begin{center} | 
|---|
| [3043] | 1117 | \includegraphics[width=8cm]{piapp_drwtools.eps} | 
|---|
| [2171] | 1118 | \caption{PIDrawerTools} | 
|---|
|  | 1119 | \label{figdrwtools} | 
|---|
|  | 1120 | \end{center} | 
|---|
|  | 1121 | \end{figure} | 
|---|
| [3041] | 1122 | %%%% | 
|---|
|  | 1123 | \subsection{AxesTools} \index{AxesTools} | 
|---|
| [2171] | 1124 | \label{secaxestools} | 
|---|
|  | 1125 | The {\bf PIAxesTools}, shown in the figure \ref{figaxestools} can be used to | 
|---|
|  | 1126 | control and change the setting of axes on 2D displays | 
|---|
|  | 1127 | ({\bf PIScDrawWdg} \myppageref{PIScDrawWdg}). | 
|---|
|  | 1128 | The PIAxesTools can be activated | 
|---|
|  | 1129 | either using {\tt Alt<A>} on a PIScDrawWdg or through | 
|---|
| [3043] | 1130 | the \menubar{Tools/Show AxesTools}. | 
|---|
| [2171] | 1131 |  | 
|---|
| [3041] | 1132 | \vspace*{5mm} | 
|---|
| [2171] | 1133 | \begin{figure}[ht!] | 
|---|
|  | 1134 | \begin{center} | 
|---|
|  | 1135 | \includegraphics[width=8cm]{piapp_axestools.eps} | 
|---|
|  | 1136 | \caption{PIAxesTools} | 
|---|
|  | 1137 | \label{figaxestools} | 
|---|
|  | 1138 | \end{center} | 
|---|
|  | 1139 | \end{figure} | 
|---|
| [3041] | 1140 | %%%%% | 
|---|
| [3043] | 1141 | \subsection{ImageTools} \index{ImageTools} | 
|---|
| [2171] | 1142 | \label{secimagetools} | 
|---|
|  | 1143 | The {\bf PIImageTools}, shown in the figure \ref{figimgtools} can be used to | 
|---|
|  | 1144 | manipulate a display of type image. Image display are handled by the | 
|---|
|  | 1145 | {\bf PIImage} (\myppageref{PIImage}). The PIImageTools can be activated | 
|---|
| [3043] | 1146 | either using {\tt Alt<O>} on a PIImage, or through the | 
|---|
|  | 1147 | \menubar{Tools/Show ImageTools}. | 
|---|
| [2171] | 1148 |  | 
|---|
| [3041] | 1149 | \vspace*{5mm} | 
|---|
| [2171] | 1150 | \begin{figure}[ht!] | 
|---|
|  | 1151 | \begin{center} | 
|---|
|  | 1152 | \includegraphics[width=8cm]{piapp_imgtools.eps} | 
|---|
|  | 1153 | \caption{PIImageTools} | 
|---|
|  | 1154 | \label{figimgtools} | 
|---|
|  | 1155 | \end{center} | 
|---|
|  | 1156 | \end{figure} | 
|---|
|  | 1157 |  | 
|---|
| [3041] | 1158 | \subsection{Histo2DTools} \index{Histo2DTools} | 
|---|
| [2171] | 1159 | \label{sech2dtools} | 
|---|
|  | 1160 | The {\bf PIHisto2DTools}, shown in the figure \ref{figh2dtools} can be | 
|---|
|  | 1161 | used to control and change the display caracteristics of 2D histograms. | 
|---|
| [2253] | 1162 | PIHisto2DTools can be activated | 
|---|
| [2171] | 1163 | either using {\tt Alt<O>} on a PIScDrawWdg, when the active | 
|---|
|  | 1164 | drawer is a PIHisto2DDrawer, or through the generic drawer tool | 
|---|
|  | 1165 | PIDrawerTools. | 
|---|
|  | 1166 |  | 
|---|
| [3041] | 1167 | \vspace*{5mm} | 
|---|
| [2171] | 1168 | \begin{figure}[ht!] | 
|---|
|  | 1169 | \begin{center} | 
|---|
|  | 1170 | \includegraphics[width=8cm]{piapp_h2dtools.eps} | 
|---|
|  | 1171 | \caption{PIHisto2DTools} | 
|---|
|  | 1172 | \label{figh2dtools} | 
|---|
|  | 1173 | \end{center} | 
|---|
|  | 1174 | \end{figure} | 
|---|
|  | 1175 |  | 
|---|
| [3041] | 1176 | \subsection{ContourTools} \index{ContourTools} | 
|---|
| [2171] | 1177 | \label{secconttools} | 
|---|
|  | 1178 | The {\bf PIContourTools}, shown in the figure \ref{figconttools} can be | 
|---|
|  | 1179 | used to control and change the caracteristics of contour displays. | 
|---|
| [2253] | 1180 | PIContourTools can be activated | 
|---|
| [2171] | 1181 | either using {\tt Alt<O>} on a PIScDrawWdg, when the active | 
|---|
|  | 1182 | drawer is a PIContDrawer, or through the generic drawer tool | 
|---|
|  | 1183 | PIDrawerTools. | 
|---|
|  | 1184 |  | 
|---|
|  | 1185 | \vspace*{10mm} | 
|---|
|  | 1186 | \begin{figure}[ht!] | 
|---|
|  | 1187 | \begin{center} | 
|---|
|  | 1188 | \includegraphics[width=11cm]{piapp_conttools.eps} | 
|---|
|  | 1189 | \caption{PIContourTools} | 
|---|
|  | 1190 | \label{figconttools} | 
|---|
|  | 1191 | \end{center} | 
|---|
|  | 1192 | \end{figure} | 
|---|
|  | 1193 |  | 
|---|
|  | 1194 |  | 
|---|
| [2253] | 1195 |  | 
|---|
|  | 1196 | Both drawing options  (e.g. color, line type, fonts...) and contour | 
|---|
|  | 1197 | determination parameters (e.g. contour number and levels) are controlled | 
|---|
|  | 1198 | by {\bf PIContourTools}. | 
|---|
|  | 1199 |  | 
|---|
| [3041] | 1200 | \subsubsection{Drawing options} | 
|---|
| [2253] | 1201 | The top choices in {\bf PIContourTools} | 
|---|
|  | 1202 | concern the color map (left choice) or color (right choice) of the contours. | 
|---|
|  | 1203 | If a color map has been chosen, it is used to give each contour a color | 
|---|
|  | 1204 | (according to its level). If no color map has been chosen, contours may be | 
|---|
|  | 1205 | given a color using the left choice box. | 
|---|
|  | 1206 |  | 
|---|
|  | 1207 | Contour are by default traced by lines. | 
|---|
|  | 1208 | Alternatively (or in addition) the user may ask to trace them by markers | 
|---|
|  | 1209 | or to put numeric labels (with the contour's level) aside the contour. | 
|---|
|  | 1210 | These options are enabled/disabled by the {\tt LineON}, {\tt MarkerON} and {\tt LabelON} | 
|---|
|  | 1211 | buttons from {\bf PIContourTools}. | 
|---|
|  | 1212 |  | 
|---|
|  | 1213 | Options may be recovered ({\tt GetAtt}) or set ({\tt SetAtt}) | 
|---|
|  | 1214 | from/to a drawer. Setting an option which adds to the screen will be immediately visible | 
|---|
|  | 1215 | whereas unsetting it requires a {\tt Refresh} to be visible. | 
|---|
|  | 1216 |  | 
|---|
|  | 1217 |  | 
|---|
| [3041] | 1218 | \subsubsection{Contour options} | 
|---|
| [2253] | 1219 | The contouring routines in {\tt spiapp} are based on a hack of the {\tt GNUPlot} | 
|---|
|  | 1220 | routines. Contours are determined from a grid of values | 
|---|
|  | 1221 | using an interpolation scheme. Three schemes may be used | 
|---|
|  | 1222 | (selected by the left menu) : | 
|---|
|  | 1223 | \begin{enumerate} | 
|---|
|  | 1224 | \item Linear interpolation (default), selected by the  {\tt Int. Lin.} option | 
|---|
|  | 1225 | \item A cubic spline algorithm, selected by the  {\tt CubicSpl} option | 
|---|
|  | 1226 | \item A 2d BSpline algorihm, selected by the  {\tt B-Spline} option | 
|---|
|  | 1227 | \end{enumerate} | 
|---|
|  | 1228 |  | 
|---|
|  | 1229 | Contour levels and number are automatically | 
|---|
|  | 1230 | determined by the program.  They may be specified differently, | 
|---|
|  | 1231 | through command-line options | 
|---|
|  | 1232 | (see section \ref{piappcmdref} for the help of the contour/ntcont commands) | 
|---|
|  | 1233 | or the lower part of the {\bf PIContourTools} window. | 
|---|
|  | 1234 |  | 
|---|
|  | 1235 | The user may specify one  of the following alternatives : | 
|---|
|  | 1236 | \begin{enumerate} | 
|---|
|  | 1237 | \item the number of contour (their level beeing automatically set). | 
|---|
|  | 1238 | To do this, select {\tt LevelNum} in the right menu and enter the contour number | 
|---|
|  | 1239 | in the left box below. | 
|---|
|  | 1240 | \item the levels of the contours, through an array of numerical values | 
|---|
|  | 1241 | (e.g. 1,4,6,9,27,4.5 will result in 6 contour lines being drawn, if possible and necessary). | 
|---|
|  | 1242 | To do this, select {\tt LevelDisc} and enter the contour number (left box) | 
|---|
|  | 1243 | and the values (right box) separated by ``{\tt ,}''. | 
|---|
|  | 1244 | \item the levels of the contours through an initial (lower) value and an increment. | 
|---|
|  | 1245 | For this, select {\tt LevelInc} and enter the contour number (left box) | 
|---|
|  | 1246 | and the initial value and increment in the right box, as above. | 
|---|
|  | 1247 | \item come back to the default situation, by choosing {\tt LevelAuto} | 
|---|
|  | 1248 | \end{enumerate} | 
|---|
|  | 1249 |  | 
|---|
|  | 1250 | Once these options are set, it is necessary the the program recomputes | 
|---|
|  | 1251 | the contour lines. This is commanded by the {\tt SetParm} button. | 
|---|
|  | 1252 |  | 
|---|
|  | 1253 |  | 
|---|
| [2171] | 1254 | \newpage | 
|---|
|  | 1255 | \addcontentsline{toc}{section}{Index} | 
|---|
|  | 1256 | \printindex | 
|---|
|  | 1257 |  | 
|---|
|  | 1258 | \end{document} | 
|---|