source: Sophya/trunk/SophyaLib/Manual/piapp.tex@ 2280

Last change on this file since 2280 was 2280, checked in by ansari, 23 years ago

Suite MAJ doc sophya.tex - Pb pdf - Reza 26/11/2002

File size: 18.8 KB
Line 
1\documentclass[twoside,11pt]{article}
2\usepackage[latin1]{inputenc}
3\usepackage[T1]{fontenc}
4\usepackage[francais]{babel}
5\usepackage{graphicx}
6
7\usepackage{palatino}
8
9% Definition pour Docs Sophya
10\usepackage{defsophya}
11
12\usepackage{makeidx}
13
14\usepackage[ps2pdf,bookmarks,bookmarksnumbered,%
15 urlcolor=blue,citecolor=blue,linkcolor=blue,%
16 pagecolor=blue,%hyperindex,%
17 colorlinks=true,hyperfigures=true,hyperindex=true
18 ]{hyperref}
19
20\setlength{\textwidth}{17cm}
21\setlength{\textheight}{21.5cm}
22\setlength{\topmargin}{0.5cm}
23\setlength{\oddsidemargin}{0.cm}
24\setlength{\evensidemargin}{0.cm}
25\setlength{\unitlength}{1mm}
26
27\newcommand{\piacommand}[1]{
28 \framebox{\bf \Large #1 } \index{#1} % (Command)
29}
30
31\newcommand{\piahelpitem}[1]{
32 \framebox{\bf \Large #1 } \index{#1} (Help item)
33}
34
35\newcommand{\myppageref}[1]{ (p. \pageref{#1} ) }
36
37\makeindex % Constitution d'index
38
39\begin{document}
40\begin{titlepage}
41% The title page - top of the page with the title of the paper
42\titrehp{piapp \\ An interactive data analysis tool}
43% Authors list
44\auteurs{
45R. Ansari & ansari@lal.in2p3.fr \\
46E. Aubourg & aubourg@hep.saclay.cea.fr \\
47C. Magneville & cmv@hep.saclay.cea.fr \\
48O. Perdereau & perderos@lal.in2p3.fr \\
49}
50% \author{R. Ansari {\tt ansari@lal.in2p3.fr} \\
51% E. Aubourg {\tt aubourg@hep.saclay.cea.fr} \\
52% C. Magneville {\tt cmv@hep.saclay.cea.fr}
53% }
54\vspace{1cm}
55\begin{center}
56{\bf \Large piapp Version: 3.55 (V\_Jul2002) }
57\end{center}
58\titrebp{5}
59
60\end{titlepage}
61
62\newpage
63\tableofcontents
64\newpage
65
66\section{Introduction}
67\index{piapp}
68{\bf piapp} (or {\bf spiapp}) is an interactive data analysis
69and visualization program. It is based on the {\bf PI} GUI library
70and the {\bf SOPHYA}
71(or {\bf PEIDA++}) C++ data analysis class library
72\footnote{see http://www.sophya.org}.
73This document contains an overview of piapp possibilities as well as
74a copy of the on-line help (accessible through the menu {\tt File/Help}).
75Once the SOPHYA/piapp (or PEIDA++/piapp) environment
76\footnote{ The environment variables {\tt DPCBASEREP} (or {\tt EROSBASEREP}),
77{\tt EROSCXX} (compiler selector), the shared library path
78{\tt LD\_LIBRARY\_PATH} and the executable search path {\tt PATH} must
79be defined}
80has been initialized, {\bf piapp} can simply be started on the command
81line. {\tt (s)piapp -h} provides a brief help of the command line
82arguments. Xtoolkit options can also be specified as command line
83arguments.
84\begin{verbatim}
85csh> spiapp -h
86 PIOPersist::Initialize() Starting Sophya Persistence management service
87SOPHYA Version 1.3 Revision 76 (V_Jun2002) -- Jul 31 2002 12:26:37 cxx
88
89 piapp: Interactive data analysis and visualisation program
90 Usage: piapp [-nored] [-nosig] [-nosigfpe] [-nosigsegv] [-hidezswin]
91 [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]]
92 -nored : NoRedirect StdOut/StdErr
93 -nosig : Don't catch SigFPE, SigSEGV
94 -nosigfpe -nosigsegv: Don t catch SigFPE / SigSEGV
95 -hidezswin : Hide Zoom/Stat/ColMap window
96 -tmpdir TmpDirectory: defines TMDIR for temporary files
97 -help2tex: Create a LaTeX help file (piahelp.tex)
98 -exec file [args] : Execute command file
99\end{verbatim}
100Once {\bf piapp} is started, a main window, containing the menu bar,
101an upper part containing the zoom and colormap window for
102image displays, memory and CPU usage and a terminal like
103window in the lower part appears. The figure \ref{figmainwin}
104shows an image of the piapp main window.
105\begin{verbatim}
106csh> spiapp
107 PIOPersist::Initialize() Starting Sophya Persistence management service
108SOPHYA Version 1.3 Revision 76 (V_Jun2002) -- Jul 31 2002 12:26:37 cxx
109>>>>> Starting piapp <<<<<
110SOPHYA Version 1.3 Revision 76 (V_Jun2002) -- Jul 31 2002 12:26:37 cxx
111Version: piapp=3.55 PI=3.8 SOPHYA=1.376
112 --piapp: Creating Tmp Directory: ./PIATmp_aadrPa/
113 PIColorMap::PIColorMap(CMapId id) Allocating ColorMap Grey32 ...
114 PIColorMap::PIColorMap(CMapId id) Allocating ColorMap InvGrey32 ...
115 PIColorMap::PIColorMap(CMapId id) Allocating ColorMap ColRJ32 ...
116 registration of contour commands
117 registration of flow chart commands
118SOPHYA Version 1.3 Revision 76 (V_Jun2002) -- Jul 31 2002 12:26:37 cxx
119 NamedObjMgr::SetTmpDir()+XNTuple::SetSwapPath() ./PIATmp_aadrPa/
120\end{verbatim}
121
122C++ code can be executed within the piapp application, easing the
123development and analysis task.
124piapp can handle input data in different formats:
125\begin{itemize}
126\item[\bul] ASCII files (see {\tt ntfrascii} \myppageref{ntfrascii} and
127{\tt newnt} \myppageref{newnt} command)
128\item[\bul] FITS format files, through menu {\bf File/Open-Fits}.
129(see also (see {\tt openfits} \myppageref{openfits}) command.
130\item[\bul] PPF (Portable Persistence file Format) files through
131menu {\bf File/Open-PPF}. PPF files are the native persistence
132format in Sophya (or PEIDA++).
133\end{itemize}
134
135The next sections present a quick tour of {\bf piapp}.
136
137\vspace*{10mm}
138\begin{figure}[ht!]
139\begin{center}
140\includegraphics[width=16cm]{piapp_mainwin.eps}
141\caption{piapp main window}
142\label{figmainwin}
143\end{center}
144\end{figure}
145
146
147\newpage
148\section{A Tour of piapp}
149\subsection{the Object Manager (NamedObjMgr)}
150The {\bf piapp} application is built around an object manager
151(class {\tt NamedObjMgr}) and a graphic application
152(class {\tt PIStdImgApp}). Objects inheriting from
153the class {\tt AnyDataObj} can be managed through adapter
154classes (classes inheriting from {\tt NObjMgrAdapter}) by
155the object manager.
156\par
157User sees the objects (such as Sophya objects Histo, NTuple,
158Arrays, Images, SkyMaps, \ldots) kept in memory, organized
159in a single level tree structure. Four memory directories
160are automatically created and can not be removed: \\
161\centerline{\bf /home \hspace{10mm} /old \hspace{10mm} /tmp \hspace{10mm} /autoc}
162The default working directory (in memory) is {\bf /home}.
163Other directories can be created by the user.
164\begin{center}
165{\bf Warning:} These are only the directory
166structure managed by the piapp application and do not
167correspond to the file system directories
168\end{center}
169The window {\bf ObjMgr} shown in figure \ref{figobjmgrw}
170can be used to navigate in the memory directories and
171execute simple operations on objects. This window
172can be displayed using the menu command
173Menubar: {\bf Objects/ObjectManager}.
174The button \framebox{\small \bf SetCurObj} can be used to set the value
175of the interpreter's variable {\tt cobj} to the selected
176object name.
177Refer to the commands in group {\bf Object Management}
178for more information.
179
180\vspace*{5mm}
181\begin{figure}[ht!]
182\begin{center}
183\includegraphics[width=10cm]{piapp_objmgr.eps}
184\caption{The interactive object management window}
185\label{figobjmgrw}
186\end{center}
187\end{figure}
188
189\subsection{command language}
190A basic command interpreter ({\bf piacmd}) is included in {\bf piapp} and
191other command interpreters can be inserted in the application
192framework.
193This interpreter ({\bf piacmd} \myppageref{piacmd})
194synthax is close to the c-shell
195(csh) shell script. It is possible to define and use variables
196({\tt set} command, {\tt \$varname}), and execute loops
197({\tt foreach,for}), as well as simple tests
198({\tt if test then ... else ... endif}).
199Commands from a file (default extension .pic) can be executed
200using the {\tt exec} command.
201Long commands can be put on several lines, by ending a line
202by the backslash \\ caracter, to signal that the command
203continues on the next line.
204
205The command macro below shows a sample piapp session, where
206data from the file {\tt demo.ppf} are displayed.
207\begin{verbatim}
208# Trace mode -> On
209traceon
210# Deleting all objects in the current directory
211delobjs *
212# Opening the PPF file demo.ppf
213openppf demo.ppf
214# Various displays in a graphic window, divided into 2x2 zones
215zone 2 2
216# 1D histogram display
217disp h1d blue
218# 2D histogram display
219disp h2d
220# Function display
221func sin(x)/x 0.1 10. 200 gold
222# Surface representation of a matrix
223surf mtx1 colbr32
224# Contour representation of a matrix
225contour mtx1 'colrj32 normalline ncont=7'
226# 3D representation of points using a PAW like command
227n/plot nt31.z%y%x ! ! win
228# 3D points superimposed on the previous display
229nt3d nt32 x y z ex ey ez - - 'same fcirclemarker7 red'
230\end{verbatim}
231
232\subsection{NTuple vue / PAW like commands}
233It is possible to plot various expressions of objects, seen as
234a 2D table, with named columns. This possibility exist not only
235for NTuples, but also for most objects (from SOPHYA) handled
236by piapp. See command groups {\bf Expr.Plotting} and
237{\bf pawCmd}
238
239\subsection{C++ execution inside piapp}
240For more complex processings, where the full power of C++
241and the class libraries are necessary, {\bf piapp} provide
242the possibility of executing C++ code, without the burden
243of having to write a complete program. The objects
244present in the current directory are automatically
245declared. The communication with the piapp application
246is done by the {\bf NamedObjMgr} class.
247Two macros {\tt KeepObj()} and {\tt DisplayObj()}
248simplify the task of keeping newly created objects.
249In the example below, we first create a noisy signal
250in a vector, and we keep it in the application
251(Notice the use of multiline command) :
252
253\begin{verbatim}
254Cmd> c++exec c++exec Vector in(1024); \
255Cmd> in = RandomSequence(RandomSequence::Gaussian, 0., 1.); \
256Cmd> for(int kk=0; kk<in.Size(); kk++) \
257Cmd> in(kk) += 2*sin(kk*0.05); \
258Cmd> KeepObj(in);
259\end{verbatim}
260We can of course display the resulting vector:
261\begin{verbatim}
262Cmd> disp in
263\end{verbatim}
264
265And, at a subsequent stage, make a low pass filter
266on the vector in:
267\begin{verbatim}
268Cmd> c++exec Vector out(1024); \
269Cmd> int w = 2; \
270Cmd> for(int k=w; k<in.Size()-w; k++) \
271Cmd> out(k) = in(Range(k-w, k+w)).Sum()/(2.*w+1.); \
272Cmd> KeepObj(out);
273\end{verbatim}
274
275We can display the new vector {\tt out} overlayed
276on the previously displayed vector:
277\begin{verbatim}
278Cmd> disp out 'red same'
279\end{verbatim}
280
281See command group {\bf CxxExecutorCmd} for more information,
282and the option window activated by the menu:
283{\bf Special/CxxExecOption}.
284
285\subsection{Extending the application}
286The {\bf piapp} application can easily be extended by the user.
287This is done through shared libraries which can be opened
288and used by the application.
289Two main methods can be used (see command group
290{\bf ExternalModules}) :
291\begin{itemize}
292\item Creation of user functions. A shared library containing
293at least one user function with the following prototype
294should be created:
295\begin{verbatim}
296extern "C" {
297 void myfonction(vector<string>& args);
298}
299\end{verbatim}
300The class {\bf NameObjMgr} should be used to communicate with the
301application. The {\tt link} \myppageref{link} and {\tt call} \myppageref{call}
302should be used to load and execute user functions. An example of
303user function can be found in DemoPIApp/user.cc exlink.pic.
304
305\item Creation of loadable modules: Loadable modules can be
306used to extend the application possibilities in a way totally
307transparent to the user. It is possible to define new commands,
308handling of new object types, additional graphic functionalities
309in a loadable module.
310
311The class {\bf CmdExecutor} is the base class for extending piapp.
312A shared library should be built, containing two functions,for
313the activation and deactivation of the module, with the following
314prototype (where {\tt mymodule} is the module's name.
315\begin{verbatim}
316extern "C" {
317 void mymodule_init();
318 void mymodule_end();
319}
320\end{verbatim}
321
322\end{itemize}
323
324\newpage
325\section{Interactive graphics}
326Display of objects in piapp are managed by {\bf PIDrawers} and three
327main viewers:
328
329\begin{itemize}
330\item[\bul] PIScDrawWdg: Handler of 2-D drawers with interactive zoom
331(see {\bf PIScDrawWdg} \myppageref{PIScDrawWdg} for more information.
332\item[\bul] PIImage: Manages display of a 2-D array (P2DArrayAdapter) as an image
333and controls a zoom widget, as well as a global image view widget, and
334a color map view widget. (see {\bf PIImage} \myppageref{PIImage} for
335 more information.
336\item[\bul] PIDraw3DWdg: handler of 3-D drawers with interacive rotation
337and zoom. (see {\bf PIDraw3DWdg} \myppageref{PIDraw3DWdg} for more information.
338\end{itemize}
339
340\par
341Refer to the command reference section on windows ({\bf Windows}
342\myppageref{Windows})
343for information on the different type of windows used by piapp
344and their properties.
345
346\par
347In addition, a number of control windows can be used to examine and
348change view properties of differents viewers and drawers.
349\begin{itemize}
350\item[] PIDrawerTools (see page \myppageref{secdrwtools})
351\item[] PIAxesTools (see page \myppageref{secaxestools})
352\item[] PIImageTools (see page \myppageref{secimagetools})
353\item[] PIHisto2DTools (see page \myppageref{sech2dtools})
354\item[] PIContourTools (see page \myppageref{secconttools})
355\end{itemize}
356
357
358\newpage
359\section{piapp command reference}
360\label{piappcmdref}
361This section contains the description of piapp commands. This information
362is available on-line, through the help command, or through a graphic
363window, accessible through the menu {\tt File/Help}.
364The help items and command are divided into different sections,
365where related commands are grouped. \\[10mm]
366
367% \include{piahelp}
368\input{piahelp.tex}
369
370% La partie des appendix
371\appendix
372
373\newpage
374\section{DrawerTools} \index{DrawerTools}
375\label{secdrwtools}
376The {\bf PIDrawerTools}, shown in the figure \ref{figdrwtools} can be
377used to change the graphic attributes (color, font, marker, \ldots)
378of the Drawers displayed in 2D displays
379({\bf PIScDrawWdg} \myppageref{PIScDrawWdg}) or 3D displays
380({\bf PIDraw3DWdg} \myppageref{PIDraw3DWdg}), as well in image displays
381{\bf PIImage} (\myppageref{PIImage}). The PIDrawerTools can be activated
382either using {\tt Alt<G>} on a PIScDrawWdg,PIDraw3DWdg,PIImage,
383or through the menu {\bf Tools/Show DrawerTools}.
384A given drawer can be selected through the DrawerId selector.
385
386\vspace*{10mm}
387\begin{figure}[ht!]
388\begin{center}
389\includegraphics[width=7cm]{piapp_drwtools.eps}
390\caption{PIDrawerTools}
391\label{figdrwtools}
392\end{center}
393\end{figure}
394\newpage
395
396\newpage
397\section{AxesTools} \index{AxesTools}
398\label{secaxestools}
399The {\bf PIAxesTools}, shown in the figure \ref{figaxestools} can be used to
400control and change the setting of axes on 2D displays
401({\bf PIScDrawWdg} \myppageref{PIScDrawWdg}).
402The PIAxesTools can be activated
403either using {\tt Alt<A>} on a PIScDrawWdg or through
404the menu {\bf Tools/Show AxesTools}.
405
406\vspace*{10mm}
407\begin{figure}[ht!]
408\begin{center}
409\includegraphics[width=8cm]{piapp_axestools.eps}
410\caption{PIAxesTools}
411\label{figaxestools}
412\end{center}
413\end{figure}
414
415\newpage
416\section{ImageTools} \index{ImageTools}
417\label{secimagetools}
418The {\bf PIImageTools}, shown in the figure \ref{figimgtools} can be used to
419manipulate a display of type image. Image display are handled by the
420{\bf PIImage} (\myppageref{PIImage}). The PIImageTools can be activated
421either using {\tt Alt<O>} on a PIImage, or through the menu
422{\bf Tools/Show ImageTools}.
423
424\vspace*{10mm}
425\begin{figure}[ht!]
426\begin{center}
427\includegraphics[width=8cm]{piapp_imgtools.eps}
428\caption{PIImageTools}
429\label{figimgtools}
430\end{center}
431\end{figure}
432
433\newpage
434\section{Histo2DTools} \index{Histo2DTools}
435\label{sech2dtools}
436The {\bf PIHisto2DTools}, shown in the figure \ref{figh2dtools} can be
437used to control and change the display caracteristics of 2D histograms.
438PIHisto2DTools can be activated
439either using {\tt Alt<O>} on a PIScDrawWdg, when the active
440drawer is a PIHisto2DDrawer, or through the generic drawer tool
441PIDrawerTools.
442
443\vspace*{10mm}
444\begin{figure}[ht!]
445\begin{center}
446\includegraphics[width=8cm]{piapp_h2dtools.eps}
447\caption{PIHisto2DTools}
448\label{figh2dtools}
449\end{center}
450\end{figure}
451
452\newpage
453\section{ContourTools} \index{ContourTools}
454\label{secconttools}
455The {\bf PIContourTools}, shown in the figure \ref{figconttools} can be
456used to control and change the caracteristics of contour displays.
457PIContourTools can be activated
458either using {\tt Alt<O>} on a PIScDrawWdg, when the active
459drawer is a PIContDrawer, or through the generic drawer tool
460PIDrawerTools.
461
462\vspace*{10mm}
463\begin{figure}[ht!]
464\begin{center}
465\includegraphics[width=11cm]{piapp_conttools.eps}
466\caption{PIContourTools}
467\label{figconttools}
468\end{center}
469\end{figure}
470
471
472
473Both drawing options (e.g. color, line type, fonts...) and contour
474determination parameters (e.g. contour number and levels) are controlled
475by {\bf PIContourTools}.
476
477\subsection{Drawing options}
478The top choices in {\bf PIContourTools}
479concern the color map (left choice) or color (right choice) of the contours.
480If a color map has been chosen, it is used to give each contour a color
481(according to its level). If no color map has been chosen, contours may be
482given a color using the left choice box.
483
484Contour are by default traced by lines.
485Alternatively (or in addition) the user may ask to trace them by markers
486or to put numeric labels (with the contour's level) aside the contour.
487These options are enabled/disabled by the {\tt LineON}, {\tt MarkerON} and {\tt LabelON}
488buttons from {\bf PIContourTools}.
489
490Options may be recovered ({\tt GetAtt}) or set ({\tt SetAtt})
491from/to a drawer. Setting an option which adds to the screen will be immediately visible
492whereas unsetting it requires a {\tt Refresh} to be visible.
493
494
495\subsection{Contour options}
496The contouring routines in {\tt spiapp} are based on a hack of the {\tt GNUPlot}
497routines. Contours are determined from a grid of values
498using an interpolation scheme. Three schemes may be used
499(selected by the left menu) :
500\begin{enumerate}
501\item Linear interpolation (default), selected by the {\tt Int. Lin.} option
502\item A cubic spline algorithm, selected by the {\tt CubicSpl} option
503\item A 2d BSpline algorihm, selected by the {\tt B-Spline} option
504\end{enumerate}
505
506Contour levels and number are automatically
507determined by the program. They may be specified differently,
508 through command-line options
509(see section \ref{piappcmdref} for the help of the contour/ntcont commands)
510or the lower part of the {\bf PIContourTools} window.
511
512The user may specify one of the following alternatives :
513\begin{enumerate}
514\item the number of contour (their level beeing automatically set).
515To do this, select {\tt LevelNum} in the right menu and enter the contour number
516in the left box below.
517\item the levels of the contours, through an array of numerical values
518(e.g. 1,4,6,9,27,4.5 will result in 6 contour lines being drawn, if possible and necessary).
519To do this, select {\tt LevelDisc} and enter the contour number (left box)
520and the values (right box) separated by ``{\tt ,}''.
521\item the levels of the contours through an initial (lower) value and an increment.
522For this, select {\tt LevelInc} and enter the contour number (left box)
523and the initial value and increment in the right box, as above.
524\item come back to the default situation, by choosing {\tt LevelAuto}
525\end{enumerate}
526
527Once these options are set, it is necessary the the program recomputes
528the contour lines. This is commanded by the {\tt SetParm} button.
529
530
531\newpage
532\addcontentsline{toc}{section}{Index}
533\printindex
534
535\end{document}
Note: See TracBrowser for help on using the repository browser.