Changeset 1515 in Sophya


Ignore:
Timestamp:
Jun 12, 2001, 5:36:47 PM (24 years ago)
Author:
cmv
Message:

intro enum TypAstroCoord cmv 12/6/01

Location:
trunk/SophyaExt/XAstroPack
Files:
2 edited

Legend:

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

    r1465 r1515  
    77//        mois [1,12] (mn)
    88//        annee       (yr)
    9 //        universal time [0,23[ (utc)
    10 //        Greenwich mean siderial [0,23[ (gst)
    11 //        Greenwich mean siderial at 0h UT [0,23[ (gst0)
     9//        universal time [0,24[ (utc)
     10//        Greenwich mean siderial [0,24[ (gst)
     11//        Greenwich mean siderial at 0h UT [0,24[ (gst0)
    1212// EQUATORIALE: ascension droite en heures [0,24[ (ra)
    1313//              declinaison en degres [-90,90]    (dec)
     
    1515// GALACTIQUE: longitude en degres [0,360[  (glng)
    1616//             latitude en degres [-90,90]  (glat)
    17 // HORIZONTAL: altitude en degres [-90,90] (alt)
    18 //             azimuth en degres [0,360[   (az)
    19 //               (angle round to the east from north+)
    20 // ECLIPTIQUE: latitude ecliptique en degres [-90,90] (eclat)
    21 //             lontitude ecliptique en degres [0,360[ (eclng)
    22 //               (angle round counter clockwise from the vernal equinoxe)
    23 // GEOGRAPHIE: latitude en degres [-90,90] (north>0) (geolat)
    24 //             longitude en degres ]-180,180]        (geolng)
    25 //               (angle + vers l'ouest, - vers l'est)
     17// HORIZONTAL: azimuth en degres [0,360[   (az)
     18//                 (angle round to the east from north+)
     19//             altitude en degres [-90,90] (alt)
     20// ECLIPTIQUE: lontitude ecliptique en degres [0,360[ (eclng)
     21//                 (angle round counter clockwise from the vernal equinoxe)
     22//             latitude ecliptique en degres [-90,90] (eclat)
     23// GEOGRAPHIE: longitude en degres ]-180,180]        (geolng)
     24//                 (angle + vers l'ouest, - vers l'est)
     25//             latitude en degres [-90,90] (north>0) (geolat)
    2626
    2727double TrueJDfrMJD(double mjd)
     
    309309  PlanetPos(mjd,SATURN,ecl,ecb,diamang);
    310310}
     311
     312/* Given a coordinate type "typ", convert to standard for astropack */
     313int  CoordConvertToStd(TypAstroCoord typ,double& coord1,double& coord2)
     314// Return : 0 = OK
     315//          1 = Type de coordonnees non connu
     316//          2 = Mauvais range pour coord1
     317//          4 = Mauvais range pour coord2
     318//          6 = Mauvais range pour coord1 et coord2
     319{
     320  int rc = 0;
     321
     322  // ---- Equatoriales alpha,delta
     323  //    - standard = [0,24[ , [-90,90]
     324  if(typ&TypCoordEq) {
     325    if(typ&TypCoordDD) {
     326      coord1 = coord1 / 180. * 12.;
     327    } else if(typ&TypCoordRR) {
     328      coord1 = coord1 / PI * 12.;
     329      coord2 = coord2 / PI * 180.;
     330    }
     331    if(coord1==24.) coord1 = 0.;
     332    if(coord1<0.   || coord1>=24.) rc+= 2;
     333    if(coord2<-90. || coord2>90. ) rc+= 4;
     334
     335  // ---- Galactiques gLong, gLat
     336  // ---- Horizontales azimuth,altitude
     337  // ---- Ecliptiques EclLong,EclLat
     338  //    - standard = [0,360[ , [-90,90]
     339  } else if( typ&TypCoordGal || typ&TypCoordHor || typ&TypCoordEcl) {
     340    if(typ&TypCoordHD) {
     341      coord1 = coord1 / 12. * 180.;
     342    } else if(typ&TypCoordRR) {
     343      coord1 = coord1 / PI * 180.;
     344      coord2 = coord2 / PI * 180.;
     345    }
     346    if(coord1==360.) coord1 = 0.;
     347    if(coord1<0.   || coord1>=360.) rc+= 2;
     348    if(coord2<-90. || coord2>90. )  rc+= 4;
     349
     350  } else {          // Coordonnees non-connues
     351    rc= 1;
     352  }
     353
     354  return rc;
     355}
  • trunk/SophyaExt/XAstroPack/xastropack.h

    r1475 r1515  
    1414}             /* extern "C" */
    1515#endif
     16
     17enum TypAstroCoord {
     18  TypCoordUndef  =  (unsigned long)  (0),
     19
     20  // Pour indiquer que les coordonnees sont en (heure=[0,24[,degre=[-90,90])
     21  TypCoordHD     =  (unsigned long)  (1 << 20),
     22  // Pour indiquer que les coordonnees sont en (degre=[0,360[,degre=[-90,90])
     23  TypCoordDD     =  (unsigned long)  (1 << 21),
     24  // Pour indiquer que les coordonnees sont en (radian=[0,2Pi[,radian=[-Pi/2,Pi/2])
     25  TypCoordRR     =  (unsigned long)  (1 << 22),
     26
     27  // Coordonnees Equatoriales alpha,delta
     28  TypCoordEq     =  (unsigned long)  (1 << 0),
     29  TypCoordEqStd  =  (unsigned long) ((1 << 0) | (1 << 20)),
     30  // Coordonnees Galactiques gLong, gLat
     31  TypCoordGal    =  (unsigned long)  (1 << 1),
     32  TypCoordGalStd =  (unsigned long) ((1 << 1) | (1 << 21)),
     33  // Coordonnees Horizontales azimuth,altitude
     34  TypCoordHor    =  (unsigned long)  (1 << 2),
     35  TypCoordHorStd =  (unsigned long) ((1 << 2) | (1 << 21)),
     36  // Coordonnees Ecliptiques EclLong,EclLat
     37  TypCoordEcl    =  (unsigned long)  (1 << 3),
     38  TypCoordEclStd =  (unsigned long) ((1 << 3) | (1 << 21))
     39};
    1640
    1741double TrueJDfrMJD(double mjd);
     
    4367void JupiterPos(double mjd,double *ecl,double *ecb,double *diamang);
    4468void SaturnPos(double mjd,double *ecl,double *ecb,double *diamang);
     69int  CoordConvertToStd(TypAstroCoord typ,double& coord1,double& coord2);
    4570
    4671#endif
Note: See TracChangeset for help on using the changeset viewer.