Changeset 3429 in Sophya for trunk/SophyaLib/Manual/piapp.tex
- Timestamp:
- Dec 10, 2007, 12:28:29 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Manual/piapp.tex
r3302 r3429 22 22 ]{hyperref} 23 23 24 \setlength{\textwidth}{1 7cm}25 \setlength{\textheight}{2 1.5cm}26 \setlength{\topmargin}{0. 5cm}24 \setlength{\textwidth}{15cm} 25 \setlength{\textheight}{20.5cm} 26 \setlength{\topmargin}{0.cm} 27 27 \setlength{\oddsidemargin}{0.cm} 28 28 \setlength{\evensidemargin}{0.cm} … … 72 72 \vspace{1cm} 73 73 \begin{center} 74 {\bf \Large piapp Version: 4.1 (V\_ Aug2007) }74 {\bf \Large piapp Version: 4.1 (V\_Nov2007) } 75 75 \end{center} 76 76 \titrebp{5} … … 111 111 \end{itemize} 112 112 %%% 113 \vspace*{5mm} 114 \par 113 \begin{figure}[ht!] 114 \begin{center} 115 \includegraphics[width=15cm]{piapp_mainwin.eps} 116 \caption{piapp main window} 117 \label{figmainwin} 118 \end{center} 119 \end{figure} 120 \subsection{starting piapp} 115 121 {\bf piapp} can simply be started on the command line in a terminal window 116 122 once the SOPHYA/piapp environment has been initialised. … … 135 141 SophyaInitiator::SophyaInitiator() BaseTools Init 136 142 PIOPersist::Initialize() Starting Sophya Persistence management service 137 SOPHYA Version 2. 0 Revision 0 (V_Jul2006) -- Jul 18 2006 12:35:58 gcc 3.3 20030304 (Apple Computer, Inc. build 1495)138 143 SOPHYA Version 2.1 Revision 0 (V_Nov2007) -- Nov 24 2007 13:08:58 gcc 3.3 144 20030304 (Apple Computer, Inc. build 1495) 139 145 piapp: Interactive data analysis and visualisation program 140 Usage: piapp [-nored] [- termread] [-term] [-hidezswin] [-small]141 [- nosig] [-nosigfpe] [-nosigsegv]146 Usage: piapp [-nored] [-doublered] [-termread] [-term] 147 [-hidezswin] [-small] [-nosig] [-nosigfpe] [-nosigsegv] 142 148 [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]] 143 149 -nored : Don't redirect stdout/stderr to piapp console 150 -doublered : Redirect stdout/stderr to piapp console AND the terminal 144 151 -termread : Read commands on terminal (stdin) 145 152 -term : equivalent to -nored -termread -small … … 166 173 {\bf Warning:} The output redirection uses unix pipes. On Linux, with commands 167 174 producing long outputs, the application may block because of incorrect management 168 of pipes. If this happens, use piapp with {\tt -nored} flag. 175 of pipes. If this happens, use piapp with {\tt -nored} flag. This problem has been 176 in principle solved with SOPHYA V=2.1 / piapp V=4.1 169 177 170 178 \par … … 175 183 Section \ref{piappcmdref} contains a brief description of all piapp commands 176 184 and 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 185 187 186 … … 392 391 {\bf disp} command \myppageref{disp} can be used to display the object, while 393 392 other commands like {\bf surf} \myppageref{surf} , {\bf imag} 394 or {\bf contour} \myppageref{contour} will try to force a given graphic representation. \\ 393 or {\bf contour} \myppageref{contour} will try to force a given graphic representation. 394 395 395 Data from table like objects can be plotted using commands like {\bf nt2d} 396 396 \myppageref{nt2d} or {\bf nt3d} \myppageref{nt3d}. Most objects in piapp … … 398 398 like {\bf plot2d} \myppageref{plot2d} , {\bf plot3d} \myppageref{plot3d} 399 399 or {\bf n/plot} \myppageref{nZplot}. These commands are described in section 400 \ref{tableplot}. \\ 401 Commands producing a graphic output have usually an optional argument called 402 {\tt graphic\_attributes} or {\tt gr\_att}. This argument provide a flexible and easy 403 way to change and customise the output graphic, as discussed in the paragraph below. 400 \ref{tableplot}. 401 402 Commands producing a graphic output have usually an optional argument called \\ 403 {\tt graphic\_attributes} or {\tt gr\_att}. \\ 404 This argument provide a flexible and easy 405 way to change and customise the output graphic, as discussed in the paragraphs below. 406 404 407 The piapp graphics can be exported in postscript (.ps) or encapsulated postscript 405 408 (.eps) format. The commands {\bf w2ps} \myppageref{w2ps} and 406 409 {\bf w2eps} \myppageref{w2eps} as well the menu \menubar{PostScript} can 407 be used to export graphics. \\[1mm] 408 The examples below illustrates the usage of some piapp graphic commands. 410 be used to export graphics. \\[2mm] 411 The examples in the followwing pages illustrates the usage of some piapp graphic commands. 412 \newpage 409 413 \begin{enumerate} 410 414 \item Image display … … 483 487 for multi-layer 2D overlay vector graphics. \\[2mm] 484 488 %% 485 Main 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 489 Main piapp/PI graphic viewers, windows and drawer objects are described if 490 the following sections. 491 492 \subsubsection{PIScDrawWdg (2D display)} 493 The {\bf PIScDrawWdg} handles a set of of 2-D drawers, managing 488 494 the 2D coordinate system and interactive zoom. The axes drawing is 489 495 handled by a specialised drawer, number 0, which also manages various added … … 494 500 activates the PIDrawer graphic attributes control window ({\bf PIDrawerTools}). 495 501 %%% 496 \item[\bul] The {\bf PIDraw3DWdg} handles a set of of 3-D drawers, managing 502 \subsubsection{PIDraw3DWdg (3D display)} 503 The {\bf PIDraw3DWdg} handles a set of of 3-D drawers, managing 497 504 interactive camera/object rotation (mouse-button-2) and zoom (mouse-button-2). 498 505 {\tt $<$Alt$>$G} to display/activate the PIDrawer graphic attributes … … 502 509 Drawer 0 handles axes drawing and graphic elements. 503 510 %%% 504 \item[\bul] The display of 2-D arrays $A(i,j)$ as an image is managed by 511 \subsubsection{PIImage (Image Display)} 512 The display of 2-D arrays $A(i,j)$ as an image is managed by 505 513 the {\bf PIImage} viewer/widget. The PI library interface {\bf P2DArrayAdapter} is used 506 514 to represent a generic 2-D array. The array values are converted into an index, converted … … 515 523 axes drawing and added graphic elements. 516 524 %%% 517 \ item[\bul] {\bf Windows}525 \subsubsection{Windows} 518 526 The viewers described above are displayed in differnt kind of windows. 519 527 The graphic option {\tt next,win,same,stack} can be used to control the way the 520 528 type of windows used. Graphic windows can be divided into several zones 521 (Command {\bf zone} \myppageref{zone}). 529 (Command {\bf zone} \myppageref{zone}). 530 531 When an object is diplayed in piapp, a widget (PIWdg) is created which manages 532 the drawer or the 2d-array. The default name for this widget is the displayed 533 object name. However, it is possible to specify a name using the graphic attribute: \\ 534 \hspace*{5mm} {\tt wname=WidgetName} \\ 535 It is possible to display multiple objects on a single widget, corresponding 536 to the superposition of the different drawers. Displaying an object superimposed 537 on the previously displayed object can be done using the graphic option 538 {\tt same}. It is also possible to specify a target widget by its name, through 539 the graphic option \\ 540 \hspace*{5mm} {\tt samew=WidgetName} \\ 541 It is also possible to specify the display of the drawer in a specified region 542 of the last displayed widget \\ 543 \hspace*{5mm} {\tt same=fx1,fx2,fy1,fy2} \\ 544 where {\tt fx1,fx2,fy1,fy2} express X and Y limits, as fraction of widget size. 545 522 546 Refer to the command reference section on windows ({\bf Windows} 523 547 \myppageref{Windows}) 524 548 for information on the different type of windows used by piapp 525 and their properties. 549 and their properties. \\ 550 526 551 %%% 527 \item[\bul] {\bf PIDrawer} Graphical representation of most objects in piapp is 528 handled through objects inheriting from the PIDrawer class. A base drawer 552 \subsubsection{Drawers} 553 Graphical representation of most objects in piapp is 554 handled through objects inheriting from the {\bf PIDrawer class}. A base drawer 529 555 (PIElDrawer, number 0) associated to all three above viewers manages the axes drawing 530 556 as well as the added graphic elements (text, arrow, \ldots). A drawer management menu 531 557 can be activated using {\tt $<$Alt$>$D}. This menu can be used to move and resize 532 558 drawers, or to display a window for changing drawers graphic attributes. 533 \end{itemize} 534 559 %%% 535 560 \par 536 561 In addition, a number of control windows can be used to examine and … … 764 789 765 790 \end{verbatim} 791 \item[\bul] The {\bf (PIContourDrawer)} decodes the following options : \\ 792 \begin{verbatim} 793 autolevels : automatic selection of levels and number of contours 794 ncont=nLevel (or nc=NLevel) : sets the number of contour 795 lev=v1,v2,v3... (or niv=v1,v2,v3...) set the number and levels of contours 796 lstep=nLev,start,step : define incremental levels 797 labon/laboff : display of contour level values on/off 798 linear/bspline/cubicspl=3spl : select contour kind 799 800 \end{verbatim} 801 766 802 \item[\bul] {\bf PIBarGraph} options : \\ 767 803 \begin{verbatim} … … 794 830 \end{itemize} 795 831 796 \subsection{text files} 797 ASCII files (see {\tt ntfrascii} \myppageref{ntfrascii} and 798 {\tt newnt} \myppageref{newnt} command) 799 \subsection{FITS and PPF} 800 FITS format files, through \menubar{File/Open-Fits}. 801 (see also (see {\tt openfits} \myppageref{openfits}) command. 802 PPF (Portable Persistence file Format) files through 803 menu \menubar{File/Open-PPF}. PPF files are the native persistence 804 format in Sophya 832 \subsection{Text files} 833 Text (or ascii) files can be read into array or datatable objects by spiapp. 834 835 {\bf Arrays :} \\ 836 Arrays can be written to to files in text/ascii format using the {\tt arrtoascii} 837 \myppageref{arrtoascii} command. Double precision matrices and vectors 838 can be read from text files using the commands 839 {\tt mtxfrascii} \myppageref{mtxfrascii} and 840 {\tt vecfrascii} \myppageref{vecfrascii} . \\ 841 The menu-bar command \menubar{File/Open-ASCII} reads in a text 842 file as a matrix. 843 \begin{verbatim} 844 # Create and initialize a matrix 845 newmtx arr 250 150 x+3*y 846 # Save the file in the text file arr.txt 847 arrtoascii arr arr.txt 848 # Read the previously created file and fill a matrix 849 mtxfrascii mxa arr.txt 850 # Print and display the matrix 851 print mxa 852 disp mxa zoomx2 853 \end{verbatim} 854 It is possible to specify the field separator in the input file, as well as the marker for the comment 855 lines. 856 857 {\bf DataTable :} \\ 858 Text files can also be read as a 2-D table (NTuple or DataTable). The table should be 859 created using the {\tt newnt} \myppageref{newnt} or 860 {\tt newdt} \myppageref{newdt} command. 861 The command {\tt ntfrascii} \myppageref{ntfrascii} can then be used to append 862 data from the file to the datatable. 863 864 \subsection{PPF} 865 %%% 866 PPF (Portable Persistence file Format) is the the native persistence 867 format of SOPHYA and thus is fully handled by spiapp. PPF files can 868 be opened through the menu-bar \menubar{File/Open-PPF}, or through 869 the {\tt openppf} \myppageref{openppf}. 870 871 If the PPF file contains NameTags, only the objects marked with nametags are read and given 872 the corresponding names. Otherwise, all objects are red sequentially, with their names 873 formed by the filename followed by a sequence number. It is also possible to force the sequential 874 reading specifying the {\tt -s} flag for openppf. 875 876 The objects managed in spiapp by the {\bf NamedObjMgr} can be saved to PPF files, with their 877 names as NameTags. The commands {\tt saveppf} \myppageref{saveppf} or 878 {\tt saveall} \myppageref{saveall} can be used to this end. 879 880 \begin{verbatim} 881 # Create two vectors and two matrices 882 newvec va1 150 sin(sqrt(x)) 883 newvec vb2 150 sin(sqrt(x))*sqrt(x*0.1) 884 newmtx mxa 250 150 x+2.*y 885 newmtx mxb 250 150 sin(sqrt(x))*cos(sqrt(y)) 886 # List of the objects in memory 887 listobjs 888 # Save the two vectors in the file vecab.ppf 889 saveppf v* vecab.ppf 890 # Save the two matrices in the file mxab.ppf 891 saveppf m* mxab.ppf 892 \end{verbatim} 893 894 \subsection{FITS} 895 FITS files may contain three types of data structures 896 \begin{enumerate} 897 \item Image or array data structure : {\tt IMAGE\_HDU} 898 \item Binary table : {\tt BINARY\_TBL} 899 \item ascii table : {\tt ASCII\_TBL} 900 \end{enumerate} 901 The {\bf FitsIOServer} module contain FitsHandler classes which 902 can map many SOPHYA classes on FITS data structures. 903 Generic {\tt IMAGE\_HDU} correspond to the SOPHYA \tcls{TArray} 904 class, while {\tt BINARY\_TBL} or {\tt ASCII\_TBL} is mapped 905 to NTuple or DataTable. 906 907 FITS format files can be read through the menu command \menubar{File/Open-Fits}, 908 or using {\tt readfits/openfits} \myppageref{readfits} command. 909 Objects can be exported to FITS using the {\tt writefits/savefits} 910 \myppageref{writefits} command. 911 912 \begin{verbatim} 913 # Open the PPF file created by the commands above 914 openppf vecab.ppf 915 # Export the two vector objects to file vecab.fits 916 # Note that the '!' forces c-fitsio to overwrite the file, if it exists 917 writefits v?? !vecab.fits 918 \end{verbatim} 919 805 920 \subsection{Graphic export in postscript} 806 See the menu under \menubar{PostScript} 921 %% 922 Postscript a page description language widely used for printing and 923 graphic output, developed by Adobe systems. Refer to 924 \href{http://www.adobe.com/products/postscript/}{Adobe/PostScript3} 925 for more detail. 926 927 Piapp graphic output can be exported in postscript (level 2) or 928 encapsulated postscript format. 929 Postscript (.ps) files my contain several pages, each vue or window 930 corresponding to one page and are suitable for direct printing. 931 An Encapsulated Postscript (.eps) file contains a single page, 932 corresponding to a window and is suitable for inclusion in 933 other document. 934 935 Postscript file can easily be converted to other formats, 936 PDF or image formats (jpeg \ldots) using converters like 937 {\bf ps2pdf} or {imagemagick}. 938 939 The menu items under \menubar{PostScript} can be used to export 940 graphics in postscript. The default file name is {\tt pia.ps} 941 or {\tt pia1.eps} {\tt pia2.eps} \ldots 942 The following commands can also be used to create postscriot file 943 from the display in the current graphic window: 944 \begin{itemize} 945 \item {\tt w2ps} \myppageref{w2ps} to add the current graphic 946 output as a new page to the output postscript file. 947 The current output postscript file (default = w2ps.ps) 948 should be closed before being used. Exiting piapp closes automatically 949 all postscript files. 950 \item {\tt psclosefile} \myppageref{psclosefile} to close the current 951 output postscript file. 952 \item {\tt pssetfilename} \myppageref{pssetfilename} To define 953 the output postscript file name for the subsequent {\tt w2ps} commands. 954 \item {\tt w2eps} \myppageref{w2eps} to export the current 955 graphic display, in Encapsulated Postscript format to the specified file. 956 \begin{verbatim} 957 # Open the PPF file created by the commands above 958 openppf vecab.ppf 959 # Display one of the vectors 960 setaxesatt 'font=helvetica,bold,18 fixedfontsize' 961 disp va1 'blue marker=box,5' 962 # Export the graphic to file va1.eps 963 w2eps va1.eps 964 # The created file can be viewed using gv 965 \end{verbatim} 966 \end{itemize} 807 967 808 968 %%%%%%%%%%%%%%% Section 5 : analyse a la paw … … 857 1017 # Notice that spaces before / after '(' and ')' are mandatory 858 1018 Cmd> set vecv ( mot1 mot2 mot3 mot4 mot5 ) 859 # Arithmetic expression : C language syntax - spaces before/after '=' are mandatory 1019 # Arithmetic expression : C language syntax - spaces 1020 # before/after '=' are mandatory 860 1021 Cmd> a = 2+3*sqrt(4) 861 1022 # The '=' operator can also be used to initialize a variable with a string … … 932 1093 piapp[3] echo ${va.?} 933 1094 TMatrix.Att: rank size/nelts nrow/nrows ncol/ncols sum 934 # Compound names, in the form name.att must be inclosed in braces {name.att} 1095 # Compound names, in the form name.att must be inclosed in 1096 # braces {name.att} 935 1097 piapp[4] echo ${va.size} 936 1098 12
Note:
See TracChangeset
for help on using the changeset viewer.