Index: /trunk/SophyaLib/Manual/piapp.tex
===================================================================
--- /trunk/SophyaLib/Manual/piapp.tex	(revision 3441)
+++ /trunk/SophyaLib/Manual/piapp.tex	(revision 3442)
@@ -422,4 +422,5 @@
 \newpage
 \section{Interactive graphics} 
+\label{intgraphics}
 %%%
 \subsection{Display commands}
@@ -448,11 +449,17 @@
 % \newpage
 \begin{enumerate}
-\item Image display. The following example uses the data file francetop.ppf
-which can be found in the {\bf DemoData} directory. This PPF file has been 
-made using topographic satellite data available from the {\bf N}ational 
+\label{francetopo}
+\item Image display. The following example uses the data file francetopo.ppf
+which can be found in the {\bf DemoData} directory. This PPF file contains 
+a TMatrix$<$int\_2$>$ (short integers) representing  30 arcmin gridded
+($\sim$ 1 km N-S $\times$ 0.7 km E-W) elevation (or altitude)
+for the area centered on France. It has been made using topographic 
+data (DEM: Digital Elevation Model) available from the {\bf N}ational 
 {\bf G}eophysical {\bf D}ata {\bf C}enter 
-\href{http://www.ngdc.noaa.gov/mgg/topo/globeget.html}{({\bf NGDC})}.
+\href{http://www.ngdc.noaa.gov/mgg/topo/}{({\bf NGDC/GLOBE})}
 \footnote{NGDC web site: \hspace{5mm} 
-http://www.ngdc.noaa.gov/mgg/topo/globeget.html }
+http://www.ngdc.noaa.gov/ }.
+In section \ref{tableplot}, an example shows how to use this data set to 
+create altitude distribution histogram for selected regions.
 \begin{verbatim}
 #  Open a PPF file containing topographic data for france
@@ -866,5 +873,5 @@
 \href{http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html}
 Data is usually read from FITS files as vectors, images, cubes or tables. 
-A subset of SOPHYA objects can be exported in FITS format. 
+A subset of SOPHYA objects can be imported or exported in FITS format. 
 \item[\bul] PPF (Portable Persistence file Format) is the native SOPHYA 
 data format.
@@ -968,8 +975,13 @@
 
 The following commands shows how to open a FITS file containing a synchrotron map
-of our galaxy. This file has been made, by rebinning, from the Haslam 408 MHz 
+of our galaxy. This file contains sky emission at 408 MHz, 
+as brightness temperature, represented as a SOPHYA spherical map 
+(SphereHEALPix$<$r\_4$>$) in \href{http://healpix.jpl.nasa.gov/}{\bf HEALPix} 
+format \footnote{HEALPix home page: \hspace{5mm} http://healpix.jpl.nasa.gov/}.
+It has been made, by rebinning, from the Haslam 408 MHz 
 all sky survey map, available from the NASA CMB data repository 
-\href{http://lambda.gsfc.nasa.gov/}{\bf LAMBDA}.
-\footnote{LAMBDA web site: \hspace{5mm} http://lambda.gsfc.nasa.gov/}
+\href{http://lambda.gsfc.nasa.gov/}{\bf LAMBDA}
+\footnote{LAMBDA web site: \hspace{5mm} http://lambda.gsfc.nasa.gov/}.
+\label{syncmap}
 \begin{verbatim}
 #  Open the fits file : the map is in HEALPix format
@@ -983,5 +995,6 @@
 \begin{center}
 \includegraphics[width=15cm]{syncmap.eps}
-\caption{Synchron map of our Galaxy, displayed in Molleweide projection}
+\caption{Synchron map of our Galaxy, displayed in Molleweide projection.
+The underlying SOPHYA object is a \tcls{SphereHEALPix} }
 \end{center}
 \end{figure}
@@ -995,5 +1008,6 @@
 
 Piapp graphic output can be exported in postscript (level 2) or
-encapsulated postscript format. 
+encapsulated postscript format, preserving the full precision 
+of vector graphics. 
 Postscript (.ps) files my contain several pages, each vue or window
 corresponding to one page and are suitable for direct printing. 
@@ -1004,5 +1018,5 @@
 Postscript file can easily be converted to other formats, 
 PDF or image formats (jpeg \ldots) using converters like
-{\bf ps2pdf} or {imagemagick}.  
+{\bf ps2pdf} or {\bf imagemagick}.  
 
 The menu items under \menubar{PostScript} can be used to export 
@@ -1143,14 +1157,19 @@
 \end{verbatim}
 \vspace*{4mm}
-\item Compute the histogram of pixel values for a spherical map.
-syncmap.fits has been made from Haslam 408 MHz map
-available from NASA \href{http://lambda.gsfc.nasa.gov/}{\bf LAMBDA} data server. \\[1mm]
-\begin{verbatim}
-# Open the synchrotron map file 
+\item Compute the histogram of pixel values for a \tcls{SphreHEALPix}.
+The data come from the synchrotron map (syncmap.fits), described page \pageref{syncmap}.
+\begin{verbatim}
+# Open the synchrotron map file (HEALPix format spherical map)
 # The file can be found in directory DemoData/
 readfits syncmap.fits
+newwin 1 1 800 400
+disp syncmap 'lut=lin,2,50 midas_bluered'
+newwin 1 2
 # Compute and display the pixel value histogram (brightness temperature)
-n/plot syncmap.val val<200 ! ! 'font=helvetica,bold,16'
+n/plot syncmap.val val<200 ! ! 'font=helvetica,bold,16 notit'
 settitle 'Sky brightness @ 408 MHz' ' ' 'font=helvetica,bold,16'
+# display the pixel value histogram in the galactic plane
+n/plot syncmap.val val<200&&(fabs(teta-M_PI/2)<0.025) ! ! 'red notit'
+settitle '408 MHz - Galactic plane' ' ' 'font=helvetica,bold,16 red'
 \end{verbatim}
 \vspace*{4mm}
@@ -1167,5 +1186,5 @@
 zone 1 2
 # Draw a longitude-latitude grid in Molleweide projection
-mollgrid 5 7 'axesnone black font=helvetica,roman,12'
+mollgrid 5 7 'axesnone black font=helvetica,roman,12 notit'
 # Overlay the sources distribution from UZC, for bright objects (mag<14)
 plot2d uzc longlat2mollX(ra*15,dec) longlat2mollY(dec) mag<14 \
@@ -1180,7 +1199,37 @@
   'same nsta red marker=circle,5'
 \end{verbatim}
+%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%
+\item Analysis of elevation (altitude) data for france. We use the francetopo.ppf 
+data set described page \pageref{francetopo}.
+\begin{verbatim}
+# open and display the topographic data for france
+openppf francetopo.ppf (in DemoData/ directory)
+print francetoto
+#--- TMatrix<s>(NRows=1332, NCols=1548) ND=2 SizeX*Y*...= 1548x1332 --- 
+disp francetopo 'zoom/2 imagecenter=750,700 lut=lin,-700,800 colbr128'
+#  Compute the altitude distribution
+newh1d altf 0. 4000 100
+projh1d altf francetopo val val>0.1 
+# Display the histogram overlayed on the topographic map
+disp altf 'white line=solid,2 font=helvetica,bold,14 inset=0.1,0.6,0.45,0.9'
+# Compute altitude distribution for the massif central (Auvergne)
+newh1d altmc 0. 2000 100
+# We select the region as a circle of radius 200, centered on x=c=970,y=r=920
+set regcut (sqrt((c-970)*(c-970)+(r-920)*(r-920))<200)
+projh1d altmc francetopo val (val>0.1)&&$regcut
+# Create a new window and display the two histograms
+newwin 1 2 
+setaxesatt 'font=helvetica,bold,16 fixedfontsize'
+disp altf 'notit'
+settitle 'Elevation (altitude) distribution over France' ' ' \
+  'font=helvetica,bold,16'
+disp altmc 'notit'
+settitle 'Elevation (altitude) distribution over MassifCentral' ' ' \
+  'font=helvetica,bold,16'
+\end{verbatim}
 \end{enumerate}
 
-\begin{figure}[p]
+\begin{figure}[hp]
 \includegraphics[width=15cm]{exhis2dpl.eps}
 \caption{
