Ignore:
Timestamp:
Dec 3, 2001, 9:34:06 PM (24 years ago)
Author:
cmv
Message:

nouvelle interface de gestion des systemes de coordonnees et des unites cmv 3/12/01

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/XAstroPack/xastropack.h

    r1791 r1808  
    1616
    1717enum TypAstroCoord {
    18   TypCoordUndef  =  (unsigned long)  (0),
    19 
    20   TypCoordH0     =  (unsigned long)  (1 << 10), // heure=[0,24[
    21   TypCoordH1     =  (unsigned long)  (1 << 11), // heure=]-12,12]
    22   TypCoordD0     =  (unsigned long)  (1 << 12), // degre=[0,360[
    23   TypCoordD1     =  (unsigned long)  (1 << 13), // degre=]-180,180]
    24   TypCoordD2     =  (unsigned long)  (1 << 14), // degre=[-90,90]
    25   TypCoordR0     =  (unsigned long)  (1 << 15), // degre=[0,2Pi[
    26   TypCoordR1     =  (unsigned long)  (1 << 16), // degre=]-Pi,Pi]
    27   TypCoordR2     =  (unsigned long)  (1 << 17), // degre=[-Pi/2,Pi/2]
    28 
    29   // Pour indiquer que les coordonnees sont en (heure=[0,24[,degre=[-90,90])
    30   TypCoordHD     =  (unsigned long)  (1 << 20),
    31   // Pour indiquer que les coordonnees sont en (degre=[0,360[,degre=[-90,90])
    32   TypCoordDD     =  (unsigned long)  (1 << 21),
    33   // Pour indiquer que les coordonnees sont en (radian=[0,2Pi[,radian=[-Pi/2,Pi/2])
    34   TypCoordRR     =  (unsigned long)  (1 << 22),
    35   // Pour indiquer que les coordonnees sont en (heure=]-12,12],degre=[-90,90])
    36   TypCoordH1D    =  (unsigned long)  (1 << 23),
    37   // Pour indiquer que les coordonnees sont en (degre=]-180,180],degre=[-90,90])
    38   TypCoordD1D    =  (unsigned long)  (1 << 24),
    39   // Pour indiquer que les coordonnees sont en (radian=]-Pi,Pi],radian=[-Pi/2,Pi/2])
    40   TypCoordR1R    =  (unsigned long)  (1 << 25),
    41 
     18  //------ Coordonnees de type (A,B) avec:
     19  //      A,B <==> alpha,delta
     20  //      A,B <==> longitude,latitude
     21  //      A,B <==> azimuth,altitude ou elevation
     22
     23  //------ Les unites des coordonnees
     24  TypUniteH       =  (unsigned long)  (1 << 0), // coord en heure
     25  TypUniteD       =  (unsigned long)  (1 << 1), // coord en degre
     26  TypUniteR       =  (unsigned long)  (1 << 2), // coord en radian
     27
     28  //------ Les unites des coordonnees A et B
     29  TypCoord1H      =  (unsigned long)  (1 << 3), // coord A en heure
     30  TypCoord1D      =  (unsigned long)  (1 << 4), // coord A en degre
     31  TypCoord1R      =  (unsigned long)  (1 << 5), // coord A en radian
     32  TypCoord2H      =  (unsigned long)  (1 << 6), // coord B en heure
     33  TypCoord2D      =  (unsigned long)  (1 << 7), // coord B en degre
     34  TypCoord2R      =  (unsigned long)  (1 << 8), // coord B en radian
     35
     36  //------ Le type d'intervalle des coordonnees A et B
     37  // Coord A intervalle... ex: [0,24[ ou [0,360[ ou [0,2Pi[
     38  TypCoord1C      =  (unsigned long)  (1 << 10),
     39  // Coord A intervalle centre... ex: ]-12,12] ou ]-180,180] ou ]-Pi,Pi]
     40  TypCoord1L      =  (unsigned long)  (1 << 11),
     41  // Coord B intervalle... ex:  [0,12] ou [0,180] ou [0,Pi] (colatitude)
     42  TypCoord2C      =  (unsigned long)  (1 << 12),
     43  // Coord B intervalle centre... ex: [-6,6] ou [-90,90] ou [-Pi/2,Pi/2] (latitude)
     44  TypCoord2L      =  (unsigned long)  (1 << 13),
     45
     46  //------ Les systemes de coordonnees astronomiques
    4247  // Coordonnees Equatoriales alpha,delta
    43   TypCoordEq     =  (unsigned long)  (1 << 0),
    44   TypCoordEqStd  =  (unsigned long) ((1 << 0) | (1 << 20)),
     48  TypCoordEq     =  (unsigned long)  (1 << 15),
    4549  // Coordonnees Galactiques gLong, gLat
    46   TypCoordGal    =  (unsigned long)  (1 << 1),
    47   TypCoordGalStd =  (unsigned long) ((1 << 1) | (1 << 21)),
     50  TypCoordGal    =  (unsigned long)  (1 << 16),
    4851  // Coordonnees Horizontales azimuth,altitude
    49   TypCoordHor    =  (unsigned long)  (1 << 2),
    50   TypCoordHorStd =  (unsigned long) ((1 << 2) | (1 << 21)),
     52  TypCoordHor    =  (unsigned long)  (1 << 17),
    5153  // Coordonnees Ecliptiques EclLong,EclLat
    52   TypCoordEcl    =  (unsigned long)  (1 << 3),
    53   TypCoordEclStd =  (unsigned long) ((1 << 3) | (1 << 21))
     54  TypCoordEcl    =  (unsigned long)  (1 << 18),
     55
     56  //------ Les systemes de coordonnees astronomiques "standard"
     57  // Coordonnees Equatoriales alpha,delta
     58  TypCoordEqStd     =  (unsigned long)  (TypCoordEq |TypCoord1C|TypCoord1H|TypCoord2L|TypCoord2D),
     59  // Coordonnees Galactiques gLong, gLat
     60  TypCoordGalStd    =  (unsigned long)  (TypCoordGal|TypCoord1C|TypCoord1D|TypCoord2L|TypCoord2D),
     61  // Coordonnees Horizontales azimuth,altitude
     62  TypCoordHorStd    =  (unsigned long)  (TypCoordHor|TypCoord1C|TypCoord1D|TypCoord2L|TypCoord2D),
     63  // Coordonnees Ecliptiques EclLong,EclLat
     64  TypCoordEclStd    =  (unsigned long)  (TypCoordEcl|TypCoord1C|TypCoord1D|TypCoord2L|TypCoord2D),
     65
     66  //------ undef pour la forme
     67  TypCoordUndef  =  (unsigned long)  (0)
    5468};
    5569
    5670// ------------------- Utilitaires -------------------
    57 int  CoordConvertToStd(TypAstroCoord typ,double& coord1,double& coord2);
     71unsigned long CoordConvertToStd(unsigned long typ,double* coord1,double* coord2);
     72unsigned long GetCoordUnit(int coordnum,unsigned long typ);
     73unsigned long DecodeTypAstro(const char *ctype);
     74inline unsigned long DecodeTypAstro(const string stype)
     75                {return DecodeTypAstro(stype.c_str());}
     76string        DecodeTypAstro(unsigned long typ);
     77void ToCoLat(double* val,unsigned long typ);
     78void InRangeLat(double* val,unsigned long typ);
     79void InRangeCoLat(double* val,unsigned long typ);
    5880
    5981/*!
     
    6486\verbatim
    6587  r>0 vmax>0
    66   r=24. vmax=24.   -> mets dans [  0,+24[ borne sup exclue
    67   r=24. vmax=12.   -> mets dans ]-12,+12] borne inf exclue
     88  r=24. vmax=24.   -> mets "val" dans [  0,+24[ borne sup exclue
     89  r=24. vmax=12.   -> mets "val" dans ]-12,+12] borne inf exclue
    6890  (ATTENTION: ca ne marche pas pour la latitude [-90,90]
    6991              car -90 ne peut etre inclus dans l'intervalle)
Note: See TracChangeset for help on using the changeset viewer.