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

Last change on this file since 2717 was 2437, checked in by cmv, 22 years ago

chgt DPC...REP en SOPHYA...REP et EROSCXX en SOPHYACXX cmv 17/09/2003

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