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

Last change on this file since 3138 was 3138, checked in by cmv, 19 years ago

descip. modifs HistoErr et grphique associe cmv 12/01/2007

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