Ignore:
Timestamp:
Aug 29, 2000, 12:03:24 PM (25 years ago)
Author:
ansari
Message:

mise a jour

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SigPredictor/sigcalchackingtools.cc

    r801 r1148  
    55#include <fstream>
    66#ifdef __MWERKS__
    7    #include "mwerksmath.h"
     7    
    88   #include "unixmac.h"
    99#endif
     
    1212//#include "integ.h"
    1313 
     14 int kmg_eulerRad(double ai, double bi, int select, double *ao, double *bo) {
     15  // All coordinates are in Radian.
     16  /* kmg_euler.c
     17   *
     18   * Converts between different coordinate systems.
     19   *
     20   * SELECT   From           To         |   SELECT    From          To
     21   *    1     RA-Dec (2000)  Galactic   |     4       Ecliptic      RA-Dec   
     22   *    2     Galactic       RA-DEC     |     5       Ecliptic
     23Galactic 
     24   *    3     RA-Dec         Ecliptic   |     6       Galactic
     25Ecliptic 
     26   *
     27   *    Date     Programmer Remarks
     28   * ----------- ---------- -------
     29   * 08-Aug-1999 K. Ganga   First version. Copied and modified EULER from
     30   *                        the IDL Astrolib.
     31   * May 2000, D. Yvon          Change coordinates units to Radians
     32   */
     33
     34  /* Local Declarations */
     35  double       a, b, sb, cb, cbsa;
     36  long         i;
     37  const double TWOPI   = 2.0*M_PI;
     38  const double FOURPI  = 4.0*M_PI;
     39  const double DEG2RAD = 180.0/M_PI;
     40
     41  /* J2000 coordinate conversions are based on the following constants
     42   * eps    =  23.4392911111  Obliquity of the ecliptic
     43   * alphaG = 192.85948       Right Ascension of Galactic North Pole
     44   * deltaG =  27.12825       Declination of Galactic North Pole
     45   * lomega =  32.93192       Galactic longitude of celestial equator
     46   * alphaE = 180.02322       Ecliptic longitude of Galactic North Pole
     47   * deltaE =  29.811438523   Ecliptic latitude of Galactic North Pole
     48   * Eomega =   6.3839743     Galactic longitude of ecliptic equator
     49   */
     50
     51  const double psi[6]    = {0.57477043300, 4.9368292465 ,
     52                            0.00000000000, 0.0000000000 ,
     53                            0.11142137093, 4.71279419371};
     54  const double stheta[6] = {0.88998808748,-0.88998808748,
     55                            0.39777715593,-0.39777715593,
     56                            0.86766622025,-0.86766622025};   
     57  const double ctheta[6] = {0.45598377618, 0.45598377618,
     58                            0.91748206207, 0.91748206207,
     59                            0.49714719172, 0.49714719172};
     60  const double phi[6]    = {4.9368292465 , 0.57477043300,
     61                            0.0000000000 , 0.00000000000,
     62                            4.71279419371, 0.11142137093};
     63
     64  i    = select - 1;
     65  a    = ai - phi[i];
     66  b    = bi;
     67  sb   = sin(b);
     68  cb   = cos(b);
     69  cbsa = cb*sin(a);
     70  b    = -stheta[i]*cbsa + ctheta[i]*sb;
     71  b    = ( (b >  1.0) ?  1.0 : b );
     72  b    = ( (b < -1.0) ? -1.0 : b );
     73  *bo  = asin(b);
     74
     75  a    = atan2( ctheta[i] * cbsa + stheta[i] * sb, cb * cos(a) );
     76  *ao  = fmod(a + psi[i] + FOURPI, TWOPI);
     77
     78  /* Later */
     79  return 0;
     80}
     81
     82
    1483template <class T> void addToSkyMap(PixelMap<T>& Map, SigCalcTool& Tool)
    1584{
Note: See TracChangeset for help on using the changeset viewer.