Index: /trunk/DocHFI_L2/L2L3_DMC_spec.html
===================================================================
--- /trunk/DocHFI_L2/L2L3_DMC_spec.html	(revision 1142)
+++ /trunk/DocHFI_L2/L2L3_DMC_spec.html	(revision 1142)
@@ -0,0 +1,152 @@
+<HTML>
+<HEAD>
+<TITLE>L2/L3 DMC Requirements</TITLE>
+</HEAD>
+<BODY>
+<CENTER>
+<H1>DMC Specifications</H1>
+<H2>L2/L3 Requirements</H2>
+<H3>R&eacute;za Ansari, &Eacute;ric Aubourg, Floor van Leeuwen</H3>
+<H3>July 10, 2000 (draft)</H3>
+<H3>PL-HFI-SPP-SP-DMC002</H3>
+</CENTER>
+<SPACER TYPE="VERTICAL" SIZE="20">
+
+<H2>Introduction</H2>
+
+The Data Management Component (<ACRONYM>DMC</ACRONYM>) is a set of 
+interfaces handling data persistence for Planck <ACRONYM>DPC</ACRONYM>'s 
+(in the <ACRONYM>IDIS</ACRONYM> framework). It will be used by both 
+consortia (<ACRONYM>HFI</ACRONYM> and <ACRONYM>LFI</ACRONYM>).
+
+<P>
+Since the <ACRONYM>DMC</ACRONYM> is a set of interfaces, different 
+persistence mechanisms can be implemented in a transparent way. This 
+insures some independance from the market (especially from the currently 
+highly volatile market of object databases, O2 being virtually dead, Object 
+Design appearing as the new leader as of June 2000).
+
+<P>
+Even if the two consortia choose the same implementation, which is not 
+required, care must be taken to preserve this independence as the 
+<ACRONYM>DMC</ACRONYM> interface is evolved.
+
+
+<H2>Object persistence mechanisms</H2>
+The <ACRONYM>DMC</ACRONYM> should provide object persistence, i.e. the 
+fact that the internal state of an object is preserved after the end of 
+the life of the application that created or modified it. The 
+<ACRONYM>DPC</ACRONYM>'s will use this object persistence facility to store 
+data, like maps, <ACRONYM>TOI</ACRONYM>'s, calibration information, 
+pointing information, etc.
+
+<P>
+Data persistence can be achieved in several ways. For L2/L3 
+<ACRONYM>DPC</ACRONYM>'s, one should keep in mind that
+
+<UL>
+    <LI><ACRONYM>DPC</ACRONYM> software should be independant of the 
+    <ACRONYM>DMC</ACRONYM> implementation. In particular, it should be able to 
+    run, for testing and development purposes, without any 
+    <ACRONYM>DMC</ACRONYM> implementation (or a basic flat file 
+    implementation).
+    <LI>Most objects handled during <ACRONYM>DPC</ACRONYM> processing will 
+    be transient. Only input data and final products of a task will be 
+    tagged persistent. Too tight a coupling between classes handled by 
+    <ACRONYM>DPC</ACRONYM> software and <ACRONYM>DMC</ACRONYM> should be 
+    avoided. 
+</UL>
+One way to achieve this is by using the Bridge design pattern [Gamma 1995], to 
+decouple interface and implementation inside the <ACRONYM>DMC</ACRONYM>.
+The <ACRONYM>DMC</ACRONYM> should probably be kept as a separate package providing 
+persistence services, the science objects and classes having no explicit 
+dependency to the <ACRONYM>DMC</ACRONYM>.
+
+<P>
+The <ACRONYM>DMC</ACRONYM> interface should moreover make minimal 
+assumptions on the implementation layer functionalities.
+
+<H2>Data structure details, and opaque persistence</H2>
+
+<ACRONYM>DPC</ACRONYM> software will need to store complex objects, which 
+structure can evolve. The precise internal data structure does not need to 
+be handled by the DMC (semantically, although the DMC needs of course to know 
+how the structure is built in terms of basic data types).
+
+<P>
+This facilitates schema evolution, since this provides skill separation 
+between precise data structure definition (a physicist task) and data 
+persistence (a database specialist task).
+
+<P>
+This also keeps the <ACRONYM>DMCI</ACRONYM> simple: it is a low-level 
+software layer, that should not depend on higher-level (and thus more 
+volatile) concepts.
+
+<P>
+Persistent data should be associated with tags and flags on which 
+<ACRONYM>DMC</ACRONYM> requests can be based. A history of each object 
+should also be kept, with support for versioning. Finer-grained searches 
+should be handled by higher-level software layers. 
+
+<H2>Use cases</H2> The data model specifications document should be
+complemented by use cases.  A list of the kind of requests on each
+type of data will help determine the
+information that need to be
+accessible by the <ACRONYM>DMC</ACRONYM>, i.e. 
+which classes of the
+data model have to be known by the 
+<ACRONYM>DMC</ACRONYM>, and which
+tags should be associated with them.
+
+<H2>Requirements summary</H2>
+
+The <ACRONYM>DMCI</ACRONYM> should implement the
+following requirements:
+
+<UL>
+ <LI>The <ACRONYM>DMCI</ACRONYM> should
+provide a set of interfaces to  handle persistence on any kind of
+data.
+ <LI>Software that uses <ACRONYM>DMCI</ACRONYM> facilities
+should be able to  run without those facilities.
+ <LI>Making data
+persistent should not imply a hard-coded dependency between  the data
+definition (in C++ or Java) and the <ACRONYM>DMCI</ACRONYM>. 
+
+Persistence should in particular not be obtained by heritage, but by 
+mechanisms like bridges and delegation.
+<LI>The <ACRONYM>DMCI</ACRONYM> should make persistent all basic data types 
+(integers, floating point numbers, strings, and n-dimensional arrays
+of such data), as well as aggregates of those basic types. It should
+provide an <ACRONYM>API</ACRONYM> to define new data types as
+aggregates of already defined types. It should provide an
+<ACRONYM>API</ACRONYM> to define  searchable fields and tags
+associated to data. <LI>The <ACRONYM>DMCI</ACRONYM> should associate
+to any persistent data the  following characteristics: name, creation
+date, modification date, creator.  It should handle version history:
+several versions of an object can be  stored and retrieved.
+<LI>The <ACRONYM>DMCI</ACRONYM> should provide an <ACRONYM>API</ACRONYM> to 
+
+locate an object based on searcheable fields and tags, and on version;
+to retrieve and store an object; and to lock an object while it is
+being  processed.
+</UL>
+
+The <ACRONYM>DMCI</ACRONYM> could provide
+more functionalities for 
+fundamental data structures like
+<ACRONYM>TOI</ACRONYM>'s and maps. This 
+remains to be defined,
+keeping in particular in mind that, for instance, 
+unforeseen pixelisation schemes could be used and that this should neither 
+break the <ACRONYM>DMC</ACRONYM> nor imply major developments in a low
+software layer.
+
+<H3>Revisions</H3>
+<UL>
+<LI>0.1 &Eacute;ric Aubourg, 07/07/2000
+<LI>0.2 &Eacute;ric Aubourg, 10/07/2000
+</UL>
+</BODY>
+</HTML>
Index: /trunk/DocHFI_L2/defdocl2.sty
===================================================================
--- /trunk/DocHFI_L2/defdocl2.sty	(revision 1142)
+++ /trunk/DocHFI_L2/defdocl2.sty	(revision 1142)
@@ -0,0 +1,79 @@
+% ------  Simple style file for HFI-L2 LaTeX documents ---------
+%                                      R. Ansari - LAL 
+%                                      V 1.0   08/2000
+% -------------------------------------------------------------- 
+% Standard packages 
+\usepackage{graphicx}
+% Use this package for producing PDF files (the font name can be changed)
+\usepackage{palatino}
+
+%  Page sizes 
+\setlength{\textwidth}{16cm}
+\setlength{\textheight}{21.5cm}
+\setlength{\topmargin}{0.5cm}
+\setlength{\oddsidemargin}{0.cm}
+\setlength{\evensidemargin}{0.cm}
+\setlength{\unitlength}{1mm}
+
+% ---------- Commands for setting up the title page ----------------
+
+%  >>>  The title page head and document title
+%  >>>  Usage: \titleph{ My document title }
+%  The icon file hfi_icon_vsmall.eps in Encapsulated Postscript format is used
+%  You can change the document group identification (Planck HFI-L2) 
+
+\newcommand{\titleph}[1]
+{
+\vspace{1cm}
+\makebox[30mm][c]{\includegraphics[width=3cm]{hfi_icon_small.eps}}
+\hspace{5mm} \raisebox{12mm}{\rule{85 mm}{0.5 mm}\makebox[40 mm]{\bf Planck HFI-L2 }}
+\vspace{2cm}
+\begin{center}
+% \par \renewcommand{\baselinestretch}{2.0} \small 
+{\LARGE \bf #1}
+\end{center}
+}
+
+%  >>>  The author list table 
+%  >>>  Usage: \authors{ name1 & institute \\ name2 & institute ... }
+
+\newcommand{\authors}[1]
+{
+\vspace{3 cm}
+\begin{center}
+\begin{tabular}{ll}
+#1
+\end{tabular}
+\end{center}
+}
+
+
+%  >>> Title page foot, document No, revision , and date
+%  >>> Usage \titlepf{PL-HFI-OOO-YY-ZZZnnn}{1.0}{2000-08-24}
+
+\newcommand{\titlepf}[3]
+{
+\vfill
+\hfill 
+\framebox[\textwidth]{\hspace{0.5cm} \large \bf #1 \hspace{1cm} Rev: #2
+\hfill #3 } \\
+}
+
+% >>> Simplified version for title page foot, with automatic insertion of date
+% >>> Usage \titlepfd{PL-HFI-OOO-YY-ZZZnnn}
+\newcommand{\titlepfd}[2]
+{
+\titlepf{#1}{#2}{\today}
+}
+
+% >>> The revision history table
+\newcommand{\revisionhistory}
+{
+\newpage
+\vspace*{1cm}
+\begin{center}
+\mbox{
+\rule{50 mm}{0.6 mm} \makebox[60 mm]{\bf Revision history} \rule{50 mm}{0.6 mm} }
+\end{center}
+\vspace{2 mm}
+}
Index: /trunk/DocHFI_L2/exdocl2.tex
===================================================================
--- /trunk/DocHFI_L2/exdocl2.tex	(revision 1142)
+++ /trunk/DocHFI_L2/exdocl2.tex	(revision 1142)
@@ -0,0 +1,65 @@
+\documentclass[twoside,11pt]{article}
+
+%  The commands for setting up the title page are in file defdocl2.sty
+\usepackage{defdocl2}
+
+%  -------  The document itself
+\begin{document}
+% ------- The title page -----
+\begin{titlepage}
+% Document title using the titleph command :
+\titleph{Using the defdocl2 style file} 
+% The authors list using \authors{ name & institue \\ name & institue ...}
+\authors{R. Ansari & LAL-IN2P3/CNRS (Orsay)\\ E. Aubourg & DAPNIA-CEA (Saclay)}
+% Document number , revision/issue and date
+% \titlepfd{DocNumber}{Revision} adds the date automatically using \today
+\titlepfd{PL-HFI-LAL-MA-001}{1.0}
+% \titlepf{DocNumber}{Revision}{theDate} can be used to specify a date
+\end{titlepage}
+
+% It is a good practice to include a revision history table at the 
+% beginning of the document
+\revisionhistory
+\begin{itemize}
+\item Version 1.0 (August 2000 - CVS version 1.1) \\
+First version of defdocl2.sty latex style file and example tex file
+\end{itemize}
+
+\newpage
+\section*{Using the docl2 style file}
+
+This document is an example or template file which can be used to produce 
+documentation for Planck HFI using \LaTeX . 
+The commands for setting up the cover page are defined in the style 
+file {\tt defdocl2.sty}. The HFI icon (in Encapsulated Postscript format) 
+is in the file \\
+{\tt hfi\_icon\_small.eps}. \\
+The following commands can be used to setup the title page inside
+the {\tt titlepage} environment.
+\begin{itemize}
+\item[] {\bf titleph} should be the first command in the {\tt titlepage} environment.
+It has one argument which defines to document title. 
+\item[] {\bf authors} can be used for the authors list.
+\item[] {\bf titlepf} should be the last command in the {\tt titlepage} environment.
+It accepts three arguments: The document number, revision/issue nummber and
+the date.
+\item[] {\bf titlepfd} is a simplified version of the previous command, which 
+inserts the current date automatically (using \verb+\today+).
+\end{itemize}
+The commands to produce the title/cover page of this document are reproduced 
+below:
+\begin{verbatim}
+% ------- The title page -----
+\begin{titlepage}
+\titleph{Using the defdocl2.sty style file}  % The document title
+\authors{R. Ansari & LAL-IN2P3/CNRS (Orsay)\\ 
+         E. Aubourg & DAPNIA-CEA (Saclay)}   % Author list
+\titlepfd{PL-HFI-LAL-MA-001}{1.0} % Document number , revision/issue and date
+\end{titlepage}
+\end{verbatim}
+
+It is a good practice to include a revision history table at the beginning 
+of the document, as shown in this example file. The command \verb+\revisionhistory+
+can be used for the corresponding page header.
+
+\end{document}
Index: /trunk/DocHFI_L2/wbsl2.tex
===================================================================
--- /trunk/DocHFI_L2/wbsl2.tex	(revision 1141)
+++ /trunk/DocHFI_L2/wbsl2.tex	(revision 1142)
@@ -1,70 +1,56 @@
 \documentclass[twoside,11pt]{article}
+
+%  Definition pour Documentation L2
+\usepackage{defdocl2}
+
 %  Package standard : Utilisation de caracteres accentues, mode francais et graphique
 \usepackage[latin1]{inputenc}
 \usepackage[T1]{fontenc}
 \usepackage{babel}
-\usepackage{graphicx}
+% \usepackage{graphicx}
 % package a mettre pour faire du pdf
-\usepackage{palatino}
+% \usepackage{palatino}
+
 
 %  Extension de symboles mathematiques
 \usepackage{amssymb}
-
-%  Definition de taille de page
-\setlength{\textwidth}{16cm}
-\setlength{\textheight}{21.5cm}
-\setlength{\topmargin}{0.5cm}
-\setlength{\oddsidemargin}{0.cm}
-\setlength{\evensidemargin}{0.cm}
-\setlength{\unitlength}{1mm}
-
+\usepackage{amstex}
+
+
+%  Definition de taille de page (c'est ds defdocl2.sty)
 \newcommand{\bul}{$\bullet \ $}
 \newcommand{\gph}[1]{ {\bf GPH#1} }
 \newcommand{\ngph}[1]{ GPH#1 }
 
+%  Symboles en bold 
+\newcommand{\bnu}{\boldsymbol{\nu}}
+\newcommand{\bbold}{\boldsymbol{b}}
+\newcommand{\dbold}{\boldsymbol{d}}
+
 \begin{document}
 
 \begin{titlepage}
-\vspace{1cm}
-\makebox[30mm][c]{\includegraphics[width=3cm]{hfi_icon_vsmall.eps}}
-\raisebox{12mm}{\rule{80 mm}{0.5 mm}\makebox[50 mm]{\bf Planck HFI L2}}
-\vspace{2cm}
-\begin{center}
-\par \renewcommand{\baselinestretch}{2.0} \small 
-{\LARGE \bf 
+\titleph{
 Planck HFI L2 \\ 
 Work Breakdown Structure \\
 Package Breakdown Structure
 }
-
-\par \renewcommand{\baselinestretch}{1.0} \normalsize
-\vspace{2 cm}
-\begin{tabular}{ll}
-R. Ansari & LAL \\ % & {\tt ansari@lal.in2p3.fr} \\
-I.J. Grivell  & ICSTM \\ 
+%  Authors list
+\authors{
+R. Ansari & LAL, Orsay \\ % & {\tt ansari@lal.in2p3.fr} \\
+I.J. Grivell  & ICSTM, London \\ 
+G. Le Meur & LAL, Orsay \\
 R.G. Mann  &  IfA, Edinburgh \\ 
-C. Mercier & IAS \\ % & {\tt Claude.Mercier@ias.fr} \\
-M. Rowan-Robinson  & ICSTM \\ 
+M. Rowan-Robinson  & ICSTM, London \\ 
 S. Serjeant  & ICSTM \\ 
-J.F. Sygnet & IAS \\ % {\tt Jean-Francois.Sygnet@ias.fr} \\
-
-% {É. Aubourg} & {\tt aubourg@hep.saclay.cea.fr} \\
-% {É. Lesquoy} & {\tt lesquoy@hep.saclay.cea.fr} \\
-% {C. Magneville} & {\tt cmv@hep.saclay.cea.fr} \\
-\end{tabular}
-
-\end{center}
-\vfill
-\hfill 
-\framebox[\textwidth]{\hspace{0.5cm} \bf Planck HFI Level 2 
-\hspace{1cm} \today } \\
+J.F. Sygnet & IAS, Orsay \\ % {\tt Jean-Francois.Sygnet@ias.fr} \\
+}
+
+\titlepfd{PL-HFI-LAL-PW-L2001}{2.0}
+
 \end{titlepage}
 
-\vspace*{1cm}
-\begin{center}
-\mbox{
-\rule{50 mm}{0.6 mm} \makebox[60 mm]{\bf Revision history} \rule{50 mm}{0.6 mm} }
-\end{center}
-\vspace{2 mm}
+%   -------- Revision history
+\revisionhistory
 \begin{itemize}
 \item Version 1.0 (February 2000 - CVS version 1.1) \\
@@ -72,12 +58,13 @@
 \item Version 1.1 (April 2000 - CVS version 1.2) \\
 Draft updated using the document prepared at ISCTM and IfA (Edinburgh)
-\end{itemize}
-
+\item Version 2.0 (August 2000 - CVS version 1.3) \\
+Inclusion of a section describing notation and conventions, 
+flow charts. A more detailed description of deliverables is also included.
+\end{itemize}
+
+%   -------- Table of content
 \newpage
-
 \tableofcontents
-
 \newpage
-% \tableofcontents
 
 \section{Introduction}
@@ -106,7 +93,7 @@
 \item[]\gph{422}  TOI processing
 \item[]\gph{423}  Polarised TOI processing
-\item[]\gph{424}  Simple 2-D map reconstruction from TOI's
-\item[]\gph{425}  Global 2-D map reconstruction
-\item[]\gph{426}  Global 2-D polarised map reconstruction
+\item[]\gph{424}  Basic 2-D map reconstruction from TOI's
+\item[]\gph{425}  Optimal 2-D map reconstruction
+\item[]\gph{426}  Optimal 2-D polarised map reconstruction
 \item[]\gph{427}  Early Compact Source Catalogue
 \item[]\gph{428}  General software architecture and support modules
@@ -114,6 +101,14 @@
 \end{itemize}
 
-In addition to the specific Level 2 workpackages, the following are 
-also related to Level 2 data processing:
+The package \gph424 should provide a resonably fast and simple 
+method for reconstructing 2-D maps from cleaned TOI's (from 
+\gph422 and \gph423), removing systematic effects (destriping) 
+and deconvolving the antenna beam pattern. An iterative method 
+is foreseen, capable of dealing with partial knowledge of 
+instrument caracteristics.
+The optimal 2-D map reconstruction packages (\gph425 and \gph426)
+will implement the best feasible method for analysing the whole
+data set from the HFI instrument and building the full sky frequency 
+maps.
 
 \begin{itemize}
@@ -158,5 +153,36 @@
 \end{table}
 
-
+\section{HFI data processing steps}
+The major steps for processing Planck-HFI data are briefly described here.
+For the sake of clarity, we define here the notation and conventions used
+throughout this document for referring to the different data components 
+in planck HFI. Most of these data components are also defined in 
+\cite{datamodel}.
+
+\subsection{Notation and conventions}
+\begin{itemize}
+\item[] {\bf Coordinates:} The spacecraft attitude is defined by the spin 
+axis direction $SA (\theta, \phi)$. $\psi$ is the third angle defining
+the position of the spacecraft and thus a given detectors view 
+direction and beam pattern orientation.
+A given sky direction is denoted $(\alpha,\delta)$ in equatorial coordinates, 
+$(l,b)$ in Galactic coordinates or $(\lambda,\beta)$ in ecliptic coordinate.
+\item[] {\bf Detector:} A given HFI bolometer read-out channel. The corresponding
+signal is denoted $\dbold(t)$ or $\bbold(t)$ $\dbold^j(t)$ or $\bbold^j(t)$ where $j$ is the 
+bolometer number.
+\item[] {\bf Frequency channel:} The set of detectors working in the 
+same frequency range. This information is only obtained by combining 
+information from several detectors in the corresponding frequency band.
+The subscript $\bnu$ is used to denote a frequency channel. The sky map
+in a given frequency band would be written as $Sky  (\theta,\phi) \vert ^{\bnu}$.
+\item[] {\bf Scan:} The time interval corresponding to a nominal spin axis
+direction
+
+\end{itemize}
+
+\subsection{Processing steps}
+
+
+ 
 \section{GPH421: RTA/QLA Real Time Assesment, Quick Look Analysis}
 \begin{itemize}
@@ -173,5 +199,13 @@
 perfomed on TOI's (Time Ordered Information ) for either a 
 single-detector or multpile-detector, single-frequency set 
-of TOI's.
+of TOI's. A very rough sketch of data flow and processing 
+steps for GPH422 is given in figure \ref{fig422}.
+
+\begin{figure}[htbp]
+\mbox{\hspace*{1cm} \includegraphics[width=7cm]{gph422_1.eps}
+      \includegraphics[width=7cm]{gph422_2.eps} }
+\caption{Data flow and processing steps for GPH422}
+\label{fig422}
+\end{figure}
 
 \begin{itemize}
@@ -422,3 +456,10 @@
 \end{itemize} 
 
+\begin{thebibliography}{10}
+\bibitem{datamodel}
+\newblock {\bf PL-COM-OAT-TN-003}
+\newblock {Planck IDIS Data Model Description Document}
+\end{thebibliography}
+
+
 \end{document}
