Changeset 3439 in Sophya for trunk/SophyaLib/Manual/piapp.tex


Ignore:
Timestamp:
Dec 13, 2007, 11:49:04 AM (18 years ago)
Author:
ansari
Message:

Chapitre 5 (tables and expression plotting) + figures complete ds piapp.tex - Reza 13/12/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Manual/piapp.tex

    r3438 r3439  
    151151contain {\tt \$SOPHYABASE /exe}. Refer to the SOPHYA overview manual
    152152for more information on SOPHYA directory structure. \\
    153 It might also be necessary to define the environment variable
    154 {\bf PIXKBMOMASK}, used by the libPI.a to map correctly
    155 the {\tt <Alt>} key with some X servers (in particular with
    156 X11 on MacOS X). \\
    157 {\tt csh> setenv PIXKBMODMASK 2 }
    158153\par
    159154{\tt (s)piapp -h} provides a brief help of the command line
     
    192187commands can be entered in this widget. It is also possible to keep
    193188the terminal where piapp was started  for {\tt stdout/stderr} (flag {\tt -nored}).
    194 It is also possible to have a command reader on  the terminal
    195 ({\tt stdin}), using the flag {\tt -term}. \\[1mm]
    196 %
    197 {\bf Warning:} The output redirection uses unix pipes. On Linux, with commands
    198 producing long outputs, the application may block because of incorrect management
    199 of pipes. If this happens, use piapp with  {\tt -nored} flag. This problem has been
    200 in principle solved with SOPHYA V=2.1 / piapp V=4.1
     189The flag {\tt -term} activate a command reader on the terminal
     190It is also possible to have a command reader on  the terminal ({\tt stdin}).  \\[1mm]
    201191
    202192\par
     
    208198and help items. Various interactive control windows are described in appendix.
    209199
     200\subsection{DemoPIApp and DemoData}
     201The directory {\bf DemoPIApp} contains a number of example scripts, such as the
     202{\tt demo.pic} and the associated data file {\tt demo.ppf}. It contains
     203also examples of loadable modules for piapp. The  DemoPIApp/CONTENT
     204file contains a brief description of the different files. \\
     205The {\bf DemoData} contains a number of data files, in PPF and FITS format, which are
     206used for the examples in this document.
     207
     208\subsection{Warnings/Known problems}
     209\begin{enumerate}
     210\item It might  be necessary to define the environment variable
     211{\bf PIXKBMOMASK}, used by the libPI.a to map correctly
     212the {\tt <Alt>} key with some X servers (in particular with
     213X11 on MacOS X). \\
     214{\tt csh> setenv PIXKBMODMASK 2 }
     215However, the default value has been changed in PI/piapp V=4.1 and it should not be
     216necessary anymore to define PIXKBMODMASK.
     217%%
     218\item The output redirection uses unix pipes. On Linux, with commands
     219producing long outputs, the application may block because of incorrect management
     220of pipes. If this happens, use piapp with  {\tt -nored} flag. This problem has been
     221in principle solved with SOPHYA V=2.1 / piapp V=4.1
     222\end{enumerate}
    210223
    211224\newpage
     
    232245command script and sample data files.
    233246
    234 \subsection{the Object Manager (NamedObjMgr)}
     247\subsection{The Object Manager (NamedObjMgr)}
    235248The {\bf piapp} application is built around an object manager
    236249(class {\tt NamedObjMgr}) and a graphic application
     
    318331It is possible to plot various expressions of objects, seen as
    319332a 2D table, with named columns. This possibility exist not only
    320 for NTuples, but also for most objects (from SOPHYA) handled
    321 by piapp. See command groups {\bf Expr.Plotting} and
    322 {\bf pawCmd}
     333for NTuples/DataTables, but also for most objects (from SOPHYA) handled
     334by piapp. The related commands are grouped under {\bf Expr.Plotting} and
     335{\bf pawCmd} and are described in section \ref{tableplot}.
    323336
    324337\subsection{C++ execution inside piapp}
     
    364377\end{verbatim}
    365378
    366 See command group {\bf CxxExecutorCmd} for more information,
    367 and the option window activated by the menu:
    368 {\bf Special/CxxExecOption}.
     379See section \ref{flycplusplus} and command group {\bf CxxExecutorCmd}
     380for more information.
    369381
    370382\subsection{Extending the application}
     
    433445 {\bf w2eps} \myppageref{w2eps} as well the menu  \menubar{PostScript} can
    434446 be used to export graphics. \\[2mm]
    435 The examples in the followwing pages illustrates the usage of some piapp graphic commands.
    436 \newpage
     447The examples in the following pages illustrates the usage of some piapp graphic commands.
     448% \newpage
    437449\begin{enumerate}
    438 \item Image display
     450\item Image display. The following example uses the data file francetop.ppf
     451which can be found in the {\bf DemoData} directory. This PPF file has been
     452made using topographic satellite data available from the {\bf N}ational
     453{\bf G}eophysical {\bf D}ata {\bf C}enter
     454\href{http://www.ngdc.noaa.gov/mgg/topo/globeget.html}{({\bf NGDC})}.
     455\footnote{NGDC web site: \hspace{5mm}
     456http://www.ngdc.noaa.gov/mgg/topo/globeget.html }
    439457\begin{verbatim}
    440458#  Open a PPF file containing topographic data for france
    441459#  as a TMatrix<short> 1332x1548
     460#  The file is in the directory DemoData/
    442461openppf francetopo.ppf
    443462#  Display the matrix, whit a zoom factor, lut and color map
     
    949968
    950969The following commands shows how to open a FITS file containing a synchrotron map
    951 of our galaxy:
     970of our galaxy. This file has been made, by rebinning, from the Haslam 408 MHz
     971all sky survey map, available from the NASA CMB data repository
     972\href{http://lambda.gsfc.nasa.gov/}{\bf LAMBDA}.
     973\footnote{LAMBDA web site: \hspace{5mm} http://lambda.gsfc.nasa.gov/}
    952974\begin{verbatim}
    953975#  Open the fits file : the map is in HEALPix format
     
    10951117\end{itemize} 
    10961118
     1119%%%%%
     1120\subsection{Examples}
     1121The following examples illustrates the use of some Expression Plotting commands
     1122(see the command groups {\bf Expr. Plotting} \myppageref{ExprZZPlotting} and
     1123 {\bf pawCmd} \myppageref{pawCmd}).
     1124The {\bf pawCmd} defines a number of operations with command name and syntax
     1125similar to the CERN PAW program.
     1126The graphic output from the examples below are shown in the figures
     1127\ref{exhis2dpl} and \ref{uzcpos}.
     1128\begin{enumerate}
     1129\item 2D plot with error bars \\[1mm]
     1130\begin{verbatim}
     1131# Set the axes attibute (the font used for axes ...)
     1132setaxesatt 'font=helvetica,bold,16 minorticks fixedfontsize'
     1133#  Open the file demo.ppf (in DemoPIApp)
     1134openppf demo.ppf
     1135print nt21
     1136print nt22
     1137# 2D plot directly from the NTuple columns (nt2d)
     1138# nt2d DO NOT use a compiled c file
     1139nt2d nt21 x y - - - - 'font=helvetica,bold,16'
     1140# Overlay a plot with scaled error bars from nt22
     1141plot2de nt22 x y ex*0.3 ey*0.5 1 \
     1142  'same marker=box,7 red font=helvetica,bold,16 '
     1143\end{verbatim}
     1144\vspace*{4mm}
     1145\item Compute the histogram of pixel values for a spherical map.
     1146syncmap.fits has been made from Haslam 408 MHz map
     1147available from NASA \href{http://lambda.gsfc.nasa.gov/}{\bf LAMBDA} data server. \\[1mm]
     1148\begin{verbatim}
     1149# Open the synchrotron map file
     1150# The file can be found in directory DemoData/
     1151readfits syncmap.fits
     1152# Compute and display the pixel value histogram (brightness temperature)
     1153n/plot syncmap.val val<200 ! ! 'font=helvetica,bold,16'
     1154settitle 'Sky brightness @ 408 MHz' ' ' 'font=helvetica,bold,16'
     1155\end{verbatim}
     1156\vspace*{4mm}
     1157\item Sources (galaxies) distribution over the sky. The data used below (uzc.ppf)
     1158has been extracted from the {\bf U}pdated {\bf Z}wicky {\bf C}atalog of Galaxies,
     1159available from the Harvard-Smithsonian Center For Astrophysics
     1160\href{http://tdc-www.harvard.edu/uzc/}{CfA/UZC web site}.
     1161\footnote{CfA web site: \hspace{5mm} http://tdc-www.harvard.edu/uzc/} \\[1mm]
     1162%%%
     1163\begin{verbatim}
     1164#  Keep the synchrotron map
     1165#  Open the Updated Zwicky Catalog of galaxies (in DemoData)
     1166openppf uzc.ppf
     1167zone 1 2
     1168# Draw a longitude-latitude grid in Molleweide projection
     1169mollgrid 5 7 'axesnone black font=helvetica,roman,12'
     1170# Overlay the sources distribution from UZC, for bright objects (mag<14)
     1171plot2d uzc longlat2mollX(ra*15,dec) longlat2mollY(dec) mag<14 \
     1172  'same red marker=circle,5'
     1173# Change the plot title
     1174settitle 'RA-Dec in degrees UZC (Updated Zwicky Catalog)' ' ' \
     1175  'font=helvetica,bold,16 red'
     1176# Display the synchrotron map
     1177disp syncmap 'lut=lin,2,40 grey128'
     1178# Add the source distribution in Galactic coordinates
     1179plot2d uzc longlat2mollX(glong,glat) longlat2mollY(glat) mag<14  \
     1180  'same nsta red marker=circle,5'
     1181\end{verbatim}
     1182\end{enumerate}
     1183
     1184\begin{figure}[p]
     1185\includegraphics[width=15cm]{exhis2dpl.eps}
     1186\caption{
     1187top: 2d plot example with error bars \hspace{5mm}
     1188bottom: Histogram of pixel values from the synchrotron map
     1189of our galaxy}
     1190\label{exhis2dpl}
     1191\end{figure}
     1192
     1193\begin{figure}[p]
     1194\includegraphics[width=15cm]{uzcpos.eps}
     1195\caption{UZC: Updated Zwicky Catalog. \hspace{5mm}
     1196top: The galaxy position distribution in equatorial
     1197$(\alpha, \delta)$ coordinates. \hspace{5mm}
     1198bottom: Position distribution in Galactic coordinates, superimposed on
     1199the synchrotron map.}
     1200\label{uzcpos}
     1201\end{figure}
     1202
    10971203%%%%%%%%%%%%%%% Section 6 :  command interpreter
    10981204\newpage
     
    13941500\newpage
    13951501\section{On the fly C++ execution}
     1502\label{flycplusplus}
     1503and the option window activated by the menu:
     1504{\bf Special/CxxExecOption}.
    13961505
    13971506%%%%%%%%%%%%%%% Section 8 :  command reference
Note: See TracChangeset for help on using the changeset viewer.