// Dominique YVON, CEA/DAPNIA/SPP 02/2000 #include #include #include #ifdef __MWERKS__ #include "unixmac.h" #endif #include "sigcalctools.h" //#include "integ.h" int kmg_eulerRad(double ai, double bi, int select, double *ao, double *bo) { // All coordinates are in Radian. /* kmg_euler.c * * Converts between different coordinate systems. * * SELECT From To | SELECT From To * 1 RA-Dec (2000) Galactic | 4 Ecliptic RA-Dec * 2 Galactic RA-DEC | 5 Ecliptic Galactic * 3 RA-Dec Ecliptic | 6 Galactic Ecliptic * * Date Programmer Remarks * ----------- ---------- ------- * 08-Aug-1999 K. Ganga First version. Copied and modified EULER from * the IDL Astrolib. * May 2000, D. Yvon Change coordinates units to Radians */ /* Local Declarations */ double a, b, sb, cb, cbsa; long i; const double TWOPI = 2.0*M_PI; const double FOURPI = 4.0*M_PI; const double DEG2RAD = 180.0/M_PI; /* J2000 coordinate conversions are based on the following constants * eps = 23.4392911111 Obliquity of the ecliptic * alphaG = 192.85948 Right Ascension of Galactic North Pole * deltaG = 27.12825 Declination of Galactic North Pole * lomega = 32.93192 Galactic longitude of celestial equator * alphaE = 180.02322 Ecliptic longitude of Galactic North Pole * deltaE = 29.811438523 Ecliptic latitude of Galactic North Pole * Eomega = 6.3839743 Galactic longitude of ecliptic equator */ const double psi[6] = {0.57477043300, 4.9368292465 , 0.00000000000, 0.0000000000 , 0.11142137093, 4.71279419371}; const double stheta[6] = {0.88998808748,-0.88998808748, 0.39777715593,-0.39777715593, 0.86766622025,-0.86766622025}; const double ctheta[6] = {0.45598377618, 0.45598377618, 0.91748206207, 0.91748206207, 0.49714719172, 0.49714719172}; const double phi[6] = {4.9368292465 , 0.57477043300, 0.0000000000 , 0.00000000000, 4.71279419371, 0.11142137093}; i = select - 1; a = ai - phi[i]; b = bi; sb = sin(b); cb = cos(b); cbsa = cb*sin(a); b = -stheta[i]*cbsa + ctheta[i]*sb; b = ( (b > 1.0) ? 1.0 : b ); b = ( (b < -1.0) ? -1.0 : b ); *bo = asin(b); a = atan2( ctheta[i] * cbsa + stheta[i] * sb, cb * cos(a) ); *ao = fmod(a + psi[i] + FOURPI, TWOPI); /* Later */ return 0; } template void addToSkyMap(PixelMap& Map, SigCalcTool& Tool) { double theta, phi; long PixelNumber= Map.NbPixels(); cout<<"Nbre de pIxel a calculer dans addToSkyMap: "< void divMap1WithMap2(PixelMap& Map, PixelMap& Map2) { double theta, phi; long PixelNumber= Map.NbPixels(); //T1 temp; for(long k=0; k void scaleMap(double scalefactor, PixelMap& Map) { long PixelNumber= Map.NbPixels(); //T temp; for(long k=0; k int MinMaxSigMap(PixelMap& Map, double& Min, double& Max, double& Moy, double& sigma) { long PixelNumber= Map.NbPixels(); double val=0.; double variance=0; Moy=0.; Min=1.e36; Max=-1.e-36; sigma=0.; for(long k=0; kMax) Max=val; if(val& Map, SigCalcTool& Tool); template void addToSkyMap(PixelMap& Map, SigCalcTool& Tool); template void compSkyMap(PixelMap& Map, SigCalcTool& Tool); template void compSkyMap(PixelMap& Map, SigCalcTool& Tool); // Idem pour les outils de cartes template void scaleMap(double scalefactor, PixelMap& Map2); template void scaleMap(double scalefactor, PixelMap& Map2); template int MinMaxSigMap(PixelMap& Map, double& Min, double& Max, double& Moy, double& sigma); template int MinMaxSigMap(PixelMap& Map, double& Min, double& Max, double& Moy, double& sigma); template void substractMap(PixelMap& Map, PixelMap& Map2); template void addMap(PixelMap& Map, PixelMap& Map2); template void divMap1WithMap2(PixelMap& Map, PixelMap& Map2); template void substractMap(PixelMap& Map, PixelMap& Map2); template void addMap(PixelMap& Map, PixelMap& Map2); template void divMap1WithMap2(PixelMap& Map, PixelMap& Map2); template void substractMap(PixelMap& Map, PixelMap& Map2); template void addMap(PixelMap& Map, PixelMap& Map2); template void divMap1WithMap2(PixelMap& Map, PixelMap& Map2); template void substractMap(PixelMap& Map, PixelMap& Map2); template void addMap(PixelMap& Map, PixelMap& Map2); template void divMap1WithMap2(PixelMap& Map, PixelMap& Map2);