Index: trunk/SophyaExt/XAstroPack/xastropack.h
===================================================================
--- trunk/SophyaExt/XAstroPack/xastropack.h	(revision 1791)
+++ trunk/SophyaExt/XAstroPack/xastropack.h	(revision 1808)
@@ -16,44 +16,66 @@
 
 enum TypAstroCoord {
-  TypCoordUndef  =  (unsigned long)  (0),
-
-  TypCoordH0     =  (unsigned long)  (1 << 10), // heure=[0,24[
-  TypCoordH1     =  (unsigned long)  (1 << 11), // heure=]-12,12]
-  TypCoordD0     =  (unsigned long)  (1 << 12), // degre=[0,360[
-  TypCoordD1     =  (unsigned long)  (1 << 13), // degre=]-180,180]
-  TypCoordD2     =  (unsigned long)  (1 << 14), // degre=[-90,90]
-  TypCoordR0     =  (unsigned long)  (1 << 15), // degre=[0,2Pi[
-  TypCoordR1     =  (unsigned long)  (1 << 16), // degre=]-Pi,Pi]
-  TypCoordR2     =  (unsigned long)  (1 << 17), // degre=[-Pi/2,Pi/2]
-
-  // Pour indiquer que les coordonnees sont en (heure=[0,24[,degre=[-90,90])
-  TypCoordHD     =  (unsigned long)  (1 << 20),
-  // Pour indiquer que les coordonnees sont en (degre=[0,360[,degre=[-90,90])
-  TypCoordDD     =  (unsigned long)  (1 << 21),
-  // Pour indiquer que les coordonnees sont en (radian=[0,2Pi[,radian=[-Pi/2,Pi/2])
-  TypCoordRR     =  (unsigned long)  (1 << 22),
-  // Pour indiquer que les coordonnees sont en (heure=]-12,12],degre=[-90,90])
-  TypCoordH1D    =  (unsigned long)  (1 << 23),
-  // Pour indiquer que les coordonnees sont en (degre=]-180,180],degre=[-90,90])
-  TypCoordD1D    =  (unsigned long)  (1 << 24),
-  // Pour indiquer que les coordonnees sont en (radian=]-Pi,Pi],radian=[-Pi/2,Pi/2])
-  TypCoordR1R    =  (unsigned long)  (1 << 25),
-
+  //------ Coordonnees de type (A,B) avec:
+  //      A,B <==> alpha,delta
+  //      A,B <==> longitude,latitude
+  //      A,B <==> azimuth,altitude ou elevation
+
+  //------ Les unites des coordonnees
+  TypUniteH       =  (unsigned long)  (1 << 0), // coord en heure
+  TypUniteD       =  (unsigned long)  (1 << 1), // coord en degre
+  TypUniteR       =  (unsigned long)  (1 << 2), // coord en radian
+
+  //------ Les unites des coordonnees A et B
+  TypCoord1H      =  (unsigned long)  (1 << 3), // coord A en heure
+  TypCoord1D      =  (unsigned long)  (1 << 4), // coord A en degre
+  TypCoord1R      =  (unsigned long)  (1 << 5), // coord A en radian
+  TypCoord2H      =  (unsigned long)  (1 << 6), // coord B en heure
+  TypCoord2D      =  (unsigned long)  (1 << 7), // coord B en degre
+  TypCoord2R      =  (unsigned long)  (1 << 8), // coord B en radian
+
+  //------ Le type d'intervalle des coordonnees A et B
+  // Coord A intervalle... ex: [0,24[ ou [0,360[ ou [0,2Pi[
+  TypCoord1C      =  (unsigned long)  (1 << 10),
+  // Coord A intervalle centre... ex: ]-12,12] ou ]-180,180] ou ]-Pi,Pi]
+  TypCoord1L      =  (unsigned long)  (1 << 11),
+  // Coord B intervalle... ex:  [0,12] ou [0,180] ou [0,Pi] (colatitude)
+  TypCoord2C      =  (unsigned long)  (1 << 12),
+  // Coord B intervalle centre... ex: [-6,6] ou [-90,90] ou [-Pi/2,Pi/2] (latitude)
+  TypCoord2L      =  (unsigned long)  (1 << 13),
+
+  //------ Les systemes de coordonnees astronomiques
   // Coordonnees Equatoriales alpha,delta
-  TypCoordEq     =  (unsigned long)  (1 << 0),
-  TypCoordEqStd  =  (unsigned long) ((1 << 0) | (1 << 20)),
+  TypCoordEq     =  (unsigned long)  (1 << 15),
   // Coordonnees Galactiques gLong, gLat
-  TypCoordGal    =  (unsigned long)  (1 << 1),
-  TypCoordGalStd =  (unsigned long) ((1 << 1) | (1 << 21)),
+  TypCoordGal    =  (unsigned long)  (1 << 16),
   // Coordonnees Horizontales azimuth,altitude
-  TypCoordHor    =  (unsigned long)  (1 << 2),
-  TypCoordHorStd =  (unsigned long) ((1 << 2) | (1 << 21)),
+  TypCoordHor    =  (unsigned long)  (1 << 17),
   // Coordonnees Ecliptiques EclLong,EclLat
-  TypCoordEcl    =  (unsigned long)  (1 << 3),
-  TypCoordEclStd =  (unsigned long) ((1 << 3) | (1 << 21))
+  TypCoordEcl    =  (unsigned long)  (1 << 18),
+
+  //------ Les systemes de coordonnees astronomiques "standard"
+  // Coordonnees Equatoriales alpha,delta
+  TypCoordEqStd     =  (unsigned long)  (TypCoordEq |TypCoord1C|TypCoord1H|TypCoord2L|TypCoord2D),
+  // Coordonnees Galactiques gLong, gLat
+  TypCoordGalStd    =  (unsigned long)  (TypCoordGal|TypCoord1C|TypCoord1D|TypCoord2L|TypCoord2D),
+  // Coordonnees Horizontales azimuth,altitude
+  TypCoordHorStd    =  (unsigned long)  (TypCoordHor|TypCoord1C|TypCoord1D|TypCoord2L|TypCoord2D),
+  // Coordonnees Ecliptiques EclLong,EclLat
+  TypCoordEclStd    =  (unsigned long)  (TypCoordEcl|TypCoord1C|TypCoord1D|TypCoord2L|TypCoord2D),
+
+  //------ undef pour la forme
+  TypCoordUndef  =  (unsigned long)  (0)
 };
 
 // ------------------- Utilitaires -------------------
-int  CoordConvertToStd(TypAstroCoord typ,double& coord1,double& coord2);
+unsigned long CoordConvertToStd(unsigned long typ,double* coord1,double* coord2);
+unsigned long GetCoordUnit(int coordnum,unsigned long typ);
+unsigned long DecodeTypAstro(const char *ctype);
+inline unsigned long DecodeTypAstro(const string stype)
+                {return DecodeTypAstro(stype.c_str());}
+string        DecodeTypAstro(unsigned long typ);
+void ToCoLat(double* val,unsigned long typ);
+void InRangeLat(double* val,unsigned long typ);
+void InRangeCoLat(double* val,unsigned long typ);
 
 /*!
@@ -64,6 +86,6 @@
 \verbatim
   r>0 vmax>0
-  r=24. vmax=24.   -> mets dans [  0,+24[ borne sup exclue
-  r=24. vmax=12.   -> mets dans ]-12,+12] borne inf exclue
+  r=24. vmax=24.   -> mets "val" dans [  0,+24[ borne sup exclue
+  r=24. vmax=12.   -> mets "val" dans ]-12,+12] borne inf exclue
   (ATTENTION: ca ne marche pas pour la latitude [-90,90]
               car -90 ne peut etre inclus dans l'intervalle)
