Index: trunk/SophyaExt/XAstroPack/xastropack.cc
===================================================================
--- trunk/SophyaExt/XAstroPack/xastropack.cc	(revision 1515)
+++ trunk/SophyaExt/XAstroPack/xastropack.cc	(revision 1628)
@@ -3,4 +3,10 @@
 #include "xastropack.h"
 
+/*!
+  \defgroup XAstroPack XAstroPack module
+  This module contains simple programs to perform various
+  astronomical computation (based on the libastro of Xephem).
+
+  \verbatim
 // TEMPS: modified Julian date (mjd) (number of days elapsed since 1900 jan 0.5)
 //        jour [1,31] (dy)
@@ -24,5 +30,10 @@
 //                 (angle + vers l'ouest, - vers l'est)
 //             latitude en degres [-90,90] (north>0) (geolat)
-
+  \endverbatim
+*/
+
+/*! \ingroup XAstroPack
+\brief Compute true Julian day from MJD
+*/
 double TrueJDfrMJD(double mjd)
 {
@@ -30,4 +41,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Compute MJD from true Julian day
+*/
 double MJDfrTrueJD(double jd)
 {
@@ -35,4 +49,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Compute MJD from date
+*/
 double MJDfrDate(double dy,int mn,int yr)
 {
@@ -42,4 +59,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Compute date from MJD
+*/
 void DatefrMJD(double mjd,double *dy,int *mn,int *yr)
 {
@@ -47,5 +67,7 @@
 }
 
-/* given a mjd, return the year as a double. */
+/*! \ingroup XAstroPack
+\brief  Given a mjd, return the year as a double.
+*/
 double YearfrMJD(double mjd)
 {
@@ -55,5 +77,7 @@
 }
 
-/* given a decimal year, return mjd */ 
+/*! \ingroup XAstroPack
+\brief Given a decimal year, return mjd
+*/
 double MJDfrYear(double yr)
 {
@@ -63,6 +87,8 @@
 }
 
-/* given a mjd, return the year and number of days since 00:00 Jan 1 */
-/* Attention: si mjd = 2 Janvier -> number of days = 1               */
+/*! \ingroup XAstroPack
+\brief Given a mjd, return the year and number of days since 00:00 Jan 1
+\warning: if mjd = 2 January -> number of days = 1
+*/
 void YDfrMJD(double mjd,double *dy,int *yr)
 {
@@ -70,8 +96,12 @@
 }
 
-/* given a modified julian date, mjd, and a universally coordinated time, utc,
- * return greenwich mean siderial time, *gst.
- * N.B. mjd must be at the beginning of the day.
- */
+/*! \ingroup XAstroPack
+\brief Give GST from UTC
+\verbatim
+ Given a modified julian date, mjd, and a universally coordinated time, utc,
+ return greenwich mean siderial time, *gst.
+ N.B. mjd must be at the beginning of the day.
+\endverbatim
+*/
 double GSTfrUTC(double mjd0,double utc)
 {
@@ -81,8 +111,12 @@
 }
 
-/* given a modified julian date, mjd, and a greenwich mean siderial time, gst,
- * return universally coordinated time, *utc.
- * N.B. mjd must be at the beginning of the day.
- */                                                                             
+/*! \ingroup XAstroPack
+\brief Give UTC from GST
+\verbatim
+ Given a modified julian date, mjd, and a greenwich mean siderial time, gst,
+ return universally coordinated time, *utc.
+ N.B. mjd must be at the beginning of the day.
+\endverbatim
+*/                                                                             
 double UTCfrGST(double mjd0,double gst)
 {
@@ -92,6 +126,8 @@
 }
 
-/* gmst0() - return Greenwich Mean Sidereal Time at 0h UT */
-/* mjd = date at 0h UT in julian days since MJD0          */
+/*! \ingroup XAstroPack
+\brief gmst0() - return Greenwich Mean Sidereal Time at 0h UT
+\param mjd = date at 0h UT in julian days since MJD0
+*/                                                                             
 double GST0(double mjd0)
 /* Copie depuis le code de Xephem car pas prototype */
@@ -106,4 +142,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Compute precession between 2 dates.
+*/                                                                             
 void Precess(double mjd1,double mjd2,double ra1,double dec1,double *ra2,double *dec2)
 {
@@ -115,5 +154,7 @@
 }
 
-/* given apparent altitude find airmass. */
+/*! \ingroup XAstroPack
+\brief Given apparent altitude find airmass.
+*/                                                                             
 double AirmassfrAlt(double alt)
 {
@@ -124,5 +165,7 @@
 }
 
-/* donne l'angle horaire a partir du temps sideral et de l'ascension droite */
+/*! \ingroup XAstroPack
+\brief Give the hour angle from sideral time and right ascencion
+*/                                                                             
 double HafrRaTS(double gst,double ra)
 {
@@ -135,5 +178,7 @@
 }
 
-void HMSfrHdec(double hd,int *h,int *mn,double *s)
+/*! \ingroup XAstroPack
+\brief Give a time in h:mn:s from a decimal hour
+\verbatim
 // INPUT: hd
 // OUTPUT: h mn s   (h,mn,s >=< 0)
@@ -141,4 +186,7 @@
 // EX: 12.51 -> h=12  mn=30  s=10 ; 
 //    -12.51 -> h=-12 mn=-30 s=-10 ; 
+\endverbatim
+*/                                                                             
+void HMSfrHdec(double hd,int *h,int *mn,double *s)
 {
  int sgn=1;
@@ -155,15 +203,25 @@
 }
 
-double HdecfrHMS(int h,int mn,double s)
+/*! \ingroup XAstroPack
+\brief Give a decimal hour from a time in h:mn:s
+\verbatim
 // INPUT: h , mn , s  (h,mn,s >=< 0)
 // RETURN:  en heures decimales
 // REMARQUE: pour avoir hd=-12.51 <- h=-12 mn=-30 s=-10
+\endverbatim
+*/                                                                             
+double HdecfrHMS(int h,int mn,double s)
 {
  return ((double)h + (double)mn/60. + s/3600.);
 }
 
-string ToStringHMS(int h,int mn,double s)
+/*! \ingroup XAstroPack
+\brief Give a time string from a time in h:mn:s
+\verbatim
 // INPUT: h , mn , s   (h,mn,s >=< 0)
 // RETURN: string h:mn:s
+\endverbatim
+*/                                                                             
+string ToStringHMS(int h,int mn,double s)
 {
  double hd = HdecfrHMS(h,mn,s); // put in range
@@ -178,4 +236,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Give a time string from a decimal hour
+*/                                                                             
 string ToStringHdec(double hd)
 {
@@ -185,4 +246,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Convert equatorial coordinates into galactic coordinates
+*/                                                                             
 void EqtoGal(double mjd,double ra,double dec, double *glng,double *glat)
 // Coordonnees equatoriales -> Coordonnees galactiques
@@ -196,4 +260,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Convert galactic coordinates into equatorial coordinates
+*/                                                                             
 void GaltoEq(double mjd,double glng,double glat,double *ra,double *dec)
 // Coordonnees galactiques -> Coordonnees equatoriales
@@ -206,4 +273,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Convert equatorial coordinates into horizontal coordinates
+*/                                                                             
 void EqtoHor(double geolat,double ha,double dec,double *az,double *alt)
 // Coordonnees equatoriales -> Coordonnees horizontales
@@ -217,4 +287,7 @@
 }
 
+/*! \ingroup XAstroPack
+ Convert horizontal coordinates into equatorial coordinates
+*/                                                                             
 void HortoEq(double geolat,double az,double alt,double *ha,double *dec)
 // Coordonnees horizontales -> Coordonnees equatoriales
@@ -229,4 +302,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Convert equatorial coordinates into ecliptic coordinates
+*/                                                                             
 // Attention, j'ai modifie eq_ecl.c pour proteger NaN
 // dans ecleq_aux :
@@ -243,4 +319,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Convert ecliptic coordinates into equatorial coordinates
+*/                                                                             
 void EcltoEq(double mjd,double eclng,double eclat,double *ra,double *dec)
 // Coordonnees ecliptiques -> Coordonnees equatoriales
@@ -253,9 +332,14 @@
 }
 
-/* given the modified JD, mjd, return the true geocentric ecliptic longitude
- *   of the sun for the mean equinox of the date, *lsn, in radians, the
- *   sun-earth distance, *rsn, in AU, and the latitude *bsn, in radians
- *   (since this is always <= 1.2 arcseconds, in can be neglected by
- *   calling with bsn = NULL). */
+/*! \ingroup XAstroPack
+\brief Give Sun position
+\verbatim
+ given the modified JD, mjd, return the true geocentric ecliptic longitude
+ of the sun for the mean equinox of the date, *lsn, in radians, the
+ sun-earth distance, *rsn, in AU, and the latitude *bsn, in radians
+ (since this is always <= 1.2 arcseconds, in can be neglected by
+ calling with bsn = NULL).
+\endverbatim
+*/
 void SunPos(double mjd,double *eclsn,double *ecbsn)
 {
@@ -266,8 +350,13 @@
 }
 
-/* given the mjd, find the geocentric ecliptic longitude, lam, and latitude,
- *   bet, and geocentric distance, rho in a.u. for the moon.  also return
- *   the sun's mean anomaly, *msp, and the moon's mean anomaly, *mdp. 
- *   (for the mean equinox) */
+/*! \ingroup XAstroPack
+\brief Give Moon position
+\verbatim
+ given the mjd, find the geocentric ecliptic longitude, lam, and latitude,
+ bet, and geocentric distance, rho in a.u. for the moon.  also return
+ the sun's mean anomaly, *msp, and the moon's mean anomaly, *mdp. 
+ (for the mean equinox)
+\endverbatim
+*/
 void MoonPos(double mjd,double *eclmn,double *ecbmn)
 {
@@ -278,6 +367,8 @@
 }
 
-void PlanetPos(double mjd,int numplan,double *ecl,double *ecb,double *diamang)
-/* given a modified Julian date, mjd, and a planet, p, find:
+/*! \ingroup XAstroPack
+\brief Give planet position
+\verbatim
+ * given a modified Julian date, mjd, and a planet, p, find:
  *   lpd0: heliocentric longitude, 
  *   psi0: heliocentric latitude,
@@ -292,5 +383,8 @@
  *   dia:  angular diameter in arcsec at 1 AU, 
  *   mag:  visual magnitude when 1 AU from sun and earth at 0 phase angle.
- *   (for the mean equinox) */
+ *   (for the mean equinox)
+ \endverbatim
+*/
+void PlanetPos(double mjd,int numplan,double *ecl,double *ecb,double *diamang)
 {
   double lpd0,psi0,rp0,rho0,mag;
@@ -300,4 +394,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Give Jupiter position
+*/
 void JupiterPos(double mjd,double *ecl,double *ecb,double *diamang)
 {
@@ -305,4 +402,7 @@
 }
 
+/*! \ingroup XAstroPack
+\brief Give Saturn position
+*/
 void SaturnPos(double mjd,double *ecl,double *ecb,double *diamang)
 {
@@ -310,11 +410,15 @@
 }
 
-/* Given a coordinate type "typ", convert to standard for astropack */
+/*! \ingroup XAstroPack
+\brief Given a coordinate type "typ", convert to standard for astropack
+\verbatim
+// Return : 0 = OK
+//          1 = Unknown type of coordinates
+//          2 = bad range for coord1
+//          4 = bad range for coord2
+//          6 = bad range for coord1 et coord2
+\endverbatim
+*/
 int  CoordConvertToStd(TypAstroCoord typ,double& coord1,double& coord2)
-// Return : 0 = OK
-//          1 = Type de coordonnees non connu
-//          2 = Mauvais range pour coord1
-//          4 = Mauvais range pour coord2
-//          6 = Mauvais range pour coord1 et coord2
 {
   int rc = 0;
