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

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

Petite correction d'accolades ds piapp.tex - Reza 9/8/2002

File size: 16.0 KB
Line 
1\documentclass[twoside,11pt,francais]{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# 3D representation of points using a PAW like command
225n/plot nt31.z%y%x ! ! win
226# 3D points superimposed on the previous display
227nt3d nt32 x y z ex ey ez - - 'same fcirclemarker7 red'
228\end{verbatim}
229
230\subsection{NTuple vue / PAW like commands}
231It is possible to plot various expressions of objects, seen as
232a 2D table, with named columns. This possibility exist not only
233for NTuples, but also for most objects (from SOPHYA) handled
234by piapp. See command groups {\bf Expr.Plotting} and
235{\bf pawCmd}
236
237\subsection{C++ execution inside piapp}
238For more complex processings, where the full power of C++
239and the class libraries are necessary, {\bf piapp} provide
240the possibility of executing C++ code, without the burden
241of having to write a complete program. The objects
242present in the current directory are automatically
243declared. The communication with the piapp application
244is done by the {\bf NamedObjMgr} class.
245Two macros {\tt KeepObj()} and {\tt DisplayObj()}
246simplify the task of keeping newly created objects.
247In the example below, we first create a noisy signal
248in a vector, and we keep it in the application
249(Notice the use of multiline command) :
250
251\begin{verbatim}
252Cmd> c++exec c++exec Vector in(1024); \
253Cmd> in = RandomSequence(RandomSequence::Gaussian, 0., 1.); \
254Cmd> for(int kk=0; kk<in.Size(); kk++) \
255Cmd> in(kk) += 2*sin(kk*0.05); \
256Cmd> KeepObj(in);
257\end{verbatim}
258We can of course display the resulting vector:
259\begin{verbatim}
260Cmd> disp in
261\end{verbatim}
262
263And, at a subsequent stage, make a low pass filter
264on the vector in:
265\begin{verbatim}
266Cmd> c++exec Vector out(1024); \
267Cmd> int w = 2; \
268Cmd> for(int k=w; k<in.Size()-w; k++) \
269Cmd> out(k) = in(Range(k-w, k+w)).Sum()/(2.*w+1.); \
270Cmd> KeepObj(out);
271\end{verbatim}
272
273We can display the new vector {\tt out} overlayed
274on the previously displayed vector:
275\begin{verbatim}
276Cmd> disp out 'red same'
277\end{verbatim}
278
279See command group {\bf CxxExecutorCmd} for more information,
280and the option window activated by the menu:
281{\bf Special/CxxExecOption}.
282
283\subsection{Extending the application}
284The {\bf piapp} application can easily be extended by the user.
285This is done through shared libraries which can be opened
286and used by the application.
287Two main methods can be used (see command group
288{\bf ExternalModules}) :
289\begin{itemize}
290\item Creation of user functions. A shared library containing
291at least one user function with the following prototype
292should be created:
293\begin{verbatim}
294extern "C" {
295 void myfonction(vector<string>& args);
296}
297\end{verbatim}
298The class {\bf NameObjMgr} should be used to communicate with the
299application. The {\tt link} \myppageref{link} and {\tt call} \myppageref{call}
300should be used to load and execute user functions. An example of
301user function can be found in DemoPIApp/user.cc exlink.pic.
302
303\item Creation of loadable modules: Loadable modules can be
304used to extend the application possibilities in a way totally
305transparent to the user. It is possible to define new commands,
306handling of new object types, additional graphic functionalities
307in a loadable module.
308
309The class {\bf CmdExecutor} is the base class for extending piapp.
310A shared library should be built, containing two functions,for
311the activation and deactivation of the module, with the following
312prototype (where {\tt mymodule} is the module's name.
313\begin{verbatim}
314extern "C" {
315 void mymodule_init();
316 void mymodule_end();
317}
318\end{verbatim}
319
320\end{itemize}
321
322\newpage
323\section{Interactive graphics}
324Display of objects in piapp are managed by {\bf PIDrawers} and three
325main viewers:
326
327\begin{itemize}
328\item[\bul] PIScDrawWdg: Handler of 2-D drawers with interactive zoom
329(see {\bf PIScDrawWdg} \myppageref{PIScDrawWdg} for more information.
330\item[\bul] PIImage: Manages display of a 2-D array (P2DArrayAdapter) as an image
331and controls a zoom widget, as well as a global image view widget, and
332a color map view widget. (see {\bf PIImage} \myppageref{PIImage} for
333 more information.
334\item[\bul] PIDraw3DWdg: handler of 3-D drawers with interacive rotation
335and zoom. (see {\bf PIDraw3DWdg} \myppageref{PIDraw3DWdg} for more information.
336\end{itemize}
337
338\par
339Refer to the command reference section on windows ({\bf Windows}
340\myppageref{Windows})
341for information on the different type of windows used by piapp
342and their properties.
343
344\par
345In addition, a number of control windows can be used to examine and
346change view properties of differents viewers and drawers.
347\begin{itemize}
348\item[] PIDrawerTools (see page \myppageref{secdrwtools})
349\item[] PIAxesTools (see page \myppageref{secaxestools})
350\item[] PIImageTools (see page \myppageref{secimagetools})
351\item[] PIHisto2DTools (see page \myppageref{sech2dtools})
352\item[] PIContourTools (see page \myppageref{secconttools})
353\end{itemize}
354
355
356\newpage
357\section{piapp command reference}
358This section contains the description of piapp commands. This information
359is available on-line, through the help command, or through a graphic
360window, accessible through the menu {\tt File/Help}.
361The help items and command are divided into different sections,
362where related commands are grouped. \\[10mm]
363
364% \include{piahelp}
365\input{piahelp.tex}
366
367% La partie des appendix
368\appendix
369
370\newpage
371\section{DrawerTools} \index{DrawerTools}
372\label{secdrwtools}
373The {\bf PIDrawerTools}, shown in the figure \ref{figdrwtools} can be
374used to change the graphic attributes (color, font, marker, \ldots)
375of the Drawers displayed in 2D displays
376({\bf PIScDrawWdg} \myppageref{PIScDrawWdg}) or 3D displays
377({\bf PIDraw3DWdg} \myppageref{PIDraw3DWdg}), as well in image displays
378{\bf PIImage} (\myppageref{PIImage}). The PIDrawerTools can be activated
379either using {\tt Alt<G>} on a PIScDrawWdg,PIDraw3DWdg,PIImage,
380or through the menu {\bf Tools/Show DrawerTools}.
381A given drawer can be selected through the DrawerId selector.
382
383\vspace*{10mm}
384\begin{figure}[ht!]
385\begin{center}
386\includegraphics[width=7cm]{piapp_drwtools.eps}
387\caption{PIDrawerTools}
388\label{figdrwtools}
389\end{center}
390\end{figure}
391\newpage
392
393\newpage
394\section{AxesTools} \index{AxesTools}
395\label{secaxestools}
396The {\bf PIAxesTools}, shown in the figure \ref{figaxestools} can be used to
397control and change the setting of axes on 2D displays
398({\bf PIScDrawWdg} \myppageref{PIScDrawWdg}).
399The PIAxesTools can be activated
400either using {\tt Alt<A>} on a PIScDrawWdg or through
401the menu {\bf Tools/Show AxesTools}.
402
403\vspace*{10mm}
404\begin{figure}[ht!]
405\begin{center}
406\includegraphics[width=8cm]{piapp_axestools.eps}
407\caption{PIAxesTools}
408\label{figaxestools}
409\end{center}
410\end{figure}
411
412\newpage
413\section{ImageTools} \index{ImageTools}
414\label{secimagetools}
415The {\bf PIImageTools}, shown in the figure \ref{figimgtools} can be used to
416manipulate a display of type image. Image display are handled by the
417{\bf PIImage} (\myppageref{PIImage}). The PIImageTools can be activated
418either using {\tt Alt<O>} on a PIImage, or through the menu
419{\bf Tools/Show ImageTools}.
420
421\vspace*{10mm}
422\begin{figure}[ht!]
423\begin{center}
424\includegraphics[width=8cm]{piapp_imgtools.eps}
425\caption{PIImageTools}
426\label{figimgtools}
427\end{center}
428\end{figure}
429
430\newpage
431\section{Histo2DTools} \index{Histo2DTools}
432\label{sech2dtools}
433The {\bf PIHisto2DTools}, shown in the figure \ref{figh2dtools} can be
434used to control and change the display caracteristics of 2D histograms.
435PIHisto2DTools can be activated using {\tt Alt<O>} on a
436either using {\tt Alt<O>} on a PIScDrawWdg, when the active
437drawer is a PIHisto2DDrawer, or through the generic drawer tool
438PIDrawerTools.
439
440\vspace*{10mm}
441\begin{figure}[ht!]
442\begin{center}
443\includegraphics[width=8cm]{piapp_h2dtools.eps}
444\caption{PIHisto2DTools}
445\label{figh2dtools}
446\end{center}
447\end{figure}
448
449\newpage
450\section{ContourTools} \index{ContourTools}
451\label{secconttools}
452The {\bf PIContourTools}, shown in the figure \ref{figconttools} can be
453used to control and change the caracteristics of contour displays.
454PIContourTools can be activated using {\tt Alt<O>} on a
455either using {\tt Alt<O>} on a PIScDrawWdg, when the active
456drawer is a PIContDrawer, or through the generic drawer tool
457PIDrawerTools.
458
459\vspace*{10mm}
460\begin{figure}[ht!]
461\begin{center}
462\includegraphics[width=11cm]{piapp_conttools.eps}
463\caption{PIContourTools}
464\label{figconttools}
465\end{center}
466\end{figure}
467
468
469\newpage
470\addcontentsline{toc}{section}{Index}
471\printindex
472
473\end{document}
Note: See TracBrowser for help on using the repository browser.