Commit e043f252556f34eb2be46f7c030eb23f88e17583

Authored by knodlseder
1 parent 5bd757d1

Add observation module description

Showing 1 changed file with 201 additions and 31 deletions
doc/um/latex/gammalib_um.tex
... ... @@ -2,7 +2,7 @@
2 2 % GammaLib User Manual
3 3 %
4 4 % Version: 0.5
5   -% Last modification: 10 February 2012
  5 +% Last modification: 9 March 2012
6 6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7 7  
8 8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
... ... @@ -11,7 +11,7 @@
11 11 \newcommand{\task}{\mbox{GammaLib}}
12 12 \newcommand{\this}{\mbox{\tt \task}}
13 13 \newcommand{\version}{\mbox{0.5.0}}
14   -\newcommand{\calendar}{\mbox{10 February 2012}}
  14 +\newcommand{\calendar}{\mbox{9 March 2012}}
15 15  
16 16  
17 17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
... ... @@ -708,9 +708,6 @@ This seems to be a bug (or a feature) of the clang compiler.
708 708  
709 709  
710 710  
711   -
712   -
713   -
714 711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
715 712 % GammaLib modules (for experienced users)
716 713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
... ... @@ -718,77 +715,250 @@ This seems to be a bug (or a feature) of the clang compiler.
718 715 \section{\this\ modules}
719 716  
720 717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
721   -\subsection{High-level analysis support}
  718 +\subsection{What is in this section?}
  719 +
  720 +This section provides an overview over all \this\ modules and their C++ classes, with particular
  721 +emphasis on the relation between the classes and their basic functionalities.
  722 +It describes the purpose of all C++ classes and their primary usage, as well as their underlying
  723 +arithmetics.
  724 +However, we do not provide a detailed description of the interface and the inner workings of
  725 +each C++ class.
  726 +This information is provided in the reference documentation, which can be found online
  727 +at \url{http://gammalib.sourceforge.net/doxygen/}, or which can be installed locally on your
  728 +machine (see section \ref{sec:doxygen}).
  729 +
  730 +Each \this\ module is presented in a dedicated section, following the overview shown in
  731 +Fig.~\ref{fig:structure} from the top-left to the bottom right.
  732 +Instrument specific modules are described in a dedicated chapter (see chapter \ref{sec:inst}).
  733 +All C++ classes of a module and their relations are illustrated using a UML diagram.
  734 +
  735 +To explain how to read such a diagram, we show an example for five fictive classes in
  736 +Fig.~\ref{fig:umltemplate}.
  737 +Our example shows a container class that contains an arbitrary number of elements which
  738 +are realized by an abstract base class.
  739 +Names of abstract base classes are indicated in {\it italic} to highlight the fact that such classes
  740 +can not be instantiated.
  741 +The possible number of elements that may be held by the container (in this case any number)
  742 +is indicated by the cardinality {\tt 0..*} situated next to the abstract base class.
  743 +Our example shows also two derived classes that inherit from the abstract base class.
  744 +The second derived class is associated with a single element of some other class, indicated by
  745 +the cardinality {\tt 1} next to the class.
  746 +This other class is not part of the actual module, and is thus shown in grey with a dotted boundary.
722 747  
723 748 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
724   -\subsubsection{{\tt app} - Creation of ftools applications}
725   -\label{sec:app}
  749 +\begin{figure*}[!h]
  750 + \center
  751 + \epsfig{figure=uml-template.eps}
  752 + \caption{UML diagram illustrating the relation between five classes.}
  753 + \label{fig:umltemplate}
  754 +\end{figure*}
  755 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
726 756  
727 757  
728 758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
729   -\subsubsection{{\tt obs} - Observation handling}
  759 +\subsection{Observation handling ({\tt obs})}
730 760 \label{sec:obs}
731 761  
732   -The primary user interface for the analysis of gamma-ray data is implemented by
733   -the container class {\tt GObservations}.
734   -{\tt GObservations} collects a list of gamma-ray observations which are the basic
735   -entity used
  762 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  763 +\subsubsection{Overview}
  764 +
  765 +Figure \ref{fig:umlobs} present an overview over the C++ classes of the {\tt obs} module and their
  766 +relations.
  767 +
  768 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  769 +\begin{figure*}[!h]
  770 + \center
  771 + \epsfig{figure=uml-obs.eps, width=16cm}
  772 + \caption{Relation of C++ classes in the {\tt obs} module.}
  773 + \label{fig:umlobs}
  774 +\end{figure*}
  775 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  776 +
  777 +The central C++ class of the {\tt obs} module is the abstract base class {\tt GObservation} which
  778 +defines the instrument-independent interface for a gamma-ray observation.
  779 +A gamma-ray observation is defined for a single specific instrument, and describes a time period
  780 +during which the instrument is in a given stable configuration that can be characterized by a
  781 +single specific response function.
  782 +Each gamma-ray observation is composed of events, a response function and a pointing.
  783 +
  784 +Observations are collected in the C++ container class {\tt GObservations} which is composed
  785 +of a list of {\tt GObservation} elements (the list is of arbitrary length; an empty list is a valid state
  786 +of the {\tt GObservations} class).
  787 +The observation container is furthermore composed of a {\tt GModels} model container class
  788 +that holds a list of models used to describe the event distributions of the observations
  789 +(see section \ref{sec:model}).
  790 +The {\tt GObservations} class presents the central element of all scientific data analyses,
  791 +as it combines all data and all models in a single entity.
  792 +
  793 +Instrument specific implementations of {\tt GObservation} objects are registered in the
  794 +C++ registry class {\tt GObservationRegistry} which statically collects one instance of each
  795 +instrument-specific observation class that is available in \this\ (see section \ref{sec:registry}
  796 +for a general description of registry classes).
  797 +
  798 +The instrument response for a given observation is defined by the abstract base class
  799 +{\tt GResponse}.
  800 +This class is composed of the C++ class {\tt GCaldb} which implements the calibration data
  801 +base that is required to compute the response function for a given instrument and observation.
  802 +{\tt GCaldb} supports the HEASARC CALDB format
  803 +(\url{http://heasarc.nasa.gov/docs/heasarc/caldb/}), but is sufficiently general to support also
  804 +other formats (see section \ref{sec:caldb} to learn how to setup and to use a calibration database).
  805 +
  806 +The pointing for a given observation is defined by the abstract base class {\tt GPointing}.
  807 +This class is composed of the C++ class {\tt GSkyDir} which implements a sky direction,
  808 +which is a position on the celestial sphere ({\tt GSkyDir} returns the position in equatorial
  809 +and galactic coordinates).
  810 +Note that the pointing needs not to be fixed during the observation but may evolve with time.
  811 +In this case, the sky direction returned by {\tt GPointing} will explicitly depend on time.
  812 +
  813 +The events for a given observation are defined by the abstract base class {\tt GEvents}.
  814 +This class is composed of the C++ classes {\tt GGti} and {\tt GEbounds}.
  815 +{\tt GGti} implements so called {\em Good Time Intervals}, which defines the time period(s)
  816 +during which the data were taken (see section \ref{sec:time}).
  817 +{\tt GEbounds} implements so called {\em Energy Boundaries}, which define the energy
  818 +intervals that are covered by the data (see section \ref{sec:energy}).
  819 +
  820 +{\tt GEvents} is also a container for the individual events, implemented by the abstract
  821 +{\tt GEvent} base class.
  822 +\this\ distinguishes two types of events:
  823 +event atoms, which are individual events, and
  824 +event bins, which are collections of events with similar properties.
  825 +Event atoms are implemented by the abstract base class {\tt GEventAtom}, while event bins
  826 +are implemented by the abstract base class {\tt GEventBin}.
  827 +Both classes derive from the abstract {\tt GEvent} base class.
  828 +
  829 +Each event type has it's own container class, which derives from the abstract {\tt GEvents}
  830 +base class.
  831 +Event atoms are collected by the abstract {\tt GEventList} base class, while event bins are
  832 +collected by the abstract {\tt GEventCube} base class.
  833 +The {\tt GEventList} class contains an instance of the abstract {\tt GRoi} base class
  834 +
  835 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  836 +\subsubsection{Describing observations using XML}
  837 +\label{sec:obsxml}
  838 +
  839 +TBW: Describe the observation XML format, and show how to handle observations using this
  840 +format.
  841 +
  842 +
  843 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  844 +\subsubsection{Handling the instrument response}
  845 +\label{sec:response}
  846 +
  847 +TBW: Describe how the instrument response is handled and what the general interfaces are.
  848 +Note that the deadtime correction is taken into account in the
  849 +{\tt GResponse::irf},
  850 +{\tt GResponse::npred}, and
  851 +{\tt GResponse::mc} methods.
  852 +
  853 +
  854 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  855 +\subsubsection{Setting up and using a calibration database}
  856 +\label{sec:caldb}
  857 +
  858 +TBW: Describe how to setup and how to use a calibration database.
  859 +
  860 +
  861 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  862 +\subsubsection{Times in \this}
  863 +\label{sec:time}
  864 +
  865 +TBW: Describe how times are implemented in \this. This section should also handle GTIs.
736 866  
737   -The basic entity used for analysis of gamma-ray data is an observation.
738   -{\bf TBW: Define what an observation is: single instrument, specific response function}.
739 867  
740   -An observation is implemented by the abstract {\tt GObservation} class that provides
741   -the instrument independent interface to the data.
  868 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  869 +\subsubsection{Energies in \this}
  870 +\label{sec:energy}
  871 +
  872 +TBW: Describe how energies are implemented in \this. Mention that the internal energy is MeV.
  873 +This section should also handle EBOUNDS.
  874 +
  875 +
  876 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  877 +\subsubsection{Regions of Interest}
  878 +\label{sec:roi}
742 879  
743   -To combine several observation for an analysis, a list of {\tt GObservation} objects is
744   -gather by the container class {\tt GObservations}
  880 +TBW: Describe what a ROI is and why this is needed (unbinned analysis).
745 881  
746 882  
747 883 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
748   -\subsubsection{{\tt model} - Model handling}
  884 +\subsection{Model handling ({\tt model})}
749 885 \label{sec:model}
750 886  
751 887  
752 888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
753   -\subsubsection{{\tt sky} - Sky maps and sky coordinates}
  889 +\subsection{Sky maps and sky coordinates ({\tt sky})}
754 890 \label{sec:sky}
755 891  
756 892  
757 893 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
758   -\subsection{Core services}
  894 +\subsection{Creation of ftools applications ({\tt app})}
  895 +\label{sec:app}
  896 +
759 897  
760 898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
761   -\subsubsection{{\tt numerics} - Numerical methods}
  899 +\subsection{Numerical methods ({\tt numerics})}
762 900 \label{sec:numerics}
763 901  
764 902  
765 903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
766   -\subsubsection{{\tt linalg} - Linear algebra}
  904 +\subsection{Linear algebra ({\tt linalg})}
767 905 \label{sec:linalg}
768 906  
769 907  
770 908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
771   -\subsubsection{{\tt opt} - Optimizers}
  909 +\subsection{Optimizers ({\tt opt})}
772 910 \label{sec:opt}
773 911  
774 912 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
775   -\subsubsection{{\tt support} - Support functions and classes}
  913 +\subsection{Support functions and classes ({\tt support})}
776 914 \label{sec:support}
777 915  
778 916  
779 917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
780   -\subsection{Interfaces}
781   -
782   -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
783   -\subsubsection{{\tt fits} - FITS file interface}
  918 +\subsection{FITS file interface ({\tt fits})}
784 919 \label{sec:fits}
785 920  
786 921  
787 922 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
788   -\subsubsection{{\tt xml} - XML file interface}
  923 +\subsection{XML file interface ({\tt xml})}
789 924 \label{sec:xml}
790 925  
791 926  
  927 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  928 +% Instrument-specific interfaces (for experienced users)
  929 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  930 +\clearpage
  931 +\section{Instrument-specific interfaces}
  932 +\label{sec:inst}
  933 +
  934 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  935 +\subsection{CTA interface ({\tt cta})}
  936 +\label{sec:cta}
  937 +
  938 +
  939 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  940 +\subsection{{\em Fermi}-LAT interface ({\tt cta})}
  941 +\label{sec:lat}
  942 +
  943 +
  944 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  945 +\subsection{Multi-wavelength interface ({\tt mwl})}
  946 +\label{sec:mwl}
  947 +
  948 +
  949 +
  950 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  951 +% Under the hood (for experienced users)
  952 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  953 +\clearpage
  954 +\section{Under the hood}
  955 +
  956 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  957 +\subsection{Registry classes}
  958 +\label{sec:registry}
  959 +
  960 +TBW: Describe what a registry class is.
  961 +
792 962  
793 963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
794 964 % Users manual (for experienced users)
... ...