Ignore:
Timestamp:
Dec 3, 2001, 9:38:03 PM (24 years ago)
Author:
cmv
Message:
  • map2toi et toi2map avec nouvelle interface sys coor et unites.
  • les modifs map2toi (LocalMap) de EA sont introduites + certains bugs corriges.

cmv 3/12/01

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/ProcWSophya/map2toi.cc

    r1762 r1809  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: map2toi.cc,v 1.9 2001-11-13 16:22:47 aubourg Exp $
     5// $Id: map2toi.cc,v 1.10 2001-12-03 20:38:02 cmv Exp $
    66
    77#include "toimanager.h"
     
    99#include "ctimer.h"
    1010#include "map2toi.h"
     11// La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta
     12#include "smathconst.h"
    1113
    1214////////////////////////////////////////////////////////////////////////
     
    1416: mSph(sph)
    1517{
     18 SetBad();
    1619 SetEquinox();
    1720 SetCoorIn();
     
    2629void Map2TOI::Print(::ostream & os)
    2730{
    28   os<<"Map2TOI::Print -- Sphere NLat = "<<mSph.SizeIndex()<<endl
    29 
    30     <<"   - Equinoxe="<<mActualYear<<endl
    31 
    32     <<"   - TypCoorIn: Gal("<<((mTypCoorIn&TypCoordGal)?1:0)
    33     <<") Eq("<<((mTypCoorIn&TypCoordEq)?1:0)
    34     <<") Deg("<<((mTypCoorIn&TypCoordDD)?1:0)
    35     <<") Hour("<<((mTypCoorIn&TypCoordHD)?1:0)
    36     <<") Rad("<<((mTypCoorIn&TypCoordRR)?1:0)<<")"<<endl
    37 
    38     <<"   - TypCoorMap: Gal("<<((mTypCoorMap&TypCoordGal)?1:0)
    39     <<") Eq("<<((mTypCoorMap&TypCoordEq)?1:0)
    40     <<") Deg("<<((mTypCoorMap&TypCoordDD)?1:0)
    41     <<") Hour("<<((mTypCoorMap&TypCoordHD)?1:0)
    42     <<") Rad("<<((mTypCoorMap&TypCoordRR)?1:0)<<")"<<endl;
     31 os<<"Map2TOI::Print -- Sphere NLat = "<<mSph.SizeIndex()<<endl
     32   <<"   - Equinoxe:   "<<mActualYear<<" y"<<endl
     33   <<"   - TypCoorIn:  "<<mTypCoorIn<<" = "<<DecodeTypAstro(mTypCoorIn)<<endl
     34   <<"   - TypCoorMap: "<<mTypCoorMap<<" = "<<DecodeTypAstro(mTypCoorMap)<<endl;
    4335}
    4436
     
    8981try {
    9082
    91 uint_4 mSnRead=0, mSnFilled=0;
    9283double mjd = MJDfrYear(mActualYear);
     84cout<<"Map2TOI::run() - modified Julian day "<<mjd<<endl;
     85
     86uint_4 mSnRead=0, mSnFilled=0, BadCoorRange=0;
    9387
    9488for(int k=snb;k<=sne;k++) {
     
    10094  mSnRead++;
    10195
    102   // Convert CoordIn to Standard
    103   double phi=-1.,theta;
    104   CoordConvertToStd(mTypCoorIn,c1,c2);
     96  // Conversion de CoordIn to Standard
     97  double phi=-1.;
     98  CoordConvertToStd(mTypCoorIn,&c1,&c2);
     99
     100  // Conversion dans le systeme astronomique approprie
    105101  if(mTypCoorIn&TypCoordEq && mTypCoorMap&TypCoordGal) { // CIn=Eq  CMap=Gal
    106102    EqtoGal(mjd,c1,c2,&c1,&c2);
    107     phi   = c1 * M_PI/180.;
     103    phi   = c1 * Pi/180.;
    108104  } else if(mTypCoorIn&TypCoordGal && mTypCoorMap&TypCoordEq) { // CIn=Gal CMap=Eq
    109105    GaltoEq(mjd,c1,c2,&c1,&c2);
    110     phi   = c1 * M_PI/12.;
     106    phi   = c1 * Pi/12.;
    111107  } else if(mTypCoorMap&TypCoordGal) { // CIn=Gal CMap=Gal
    112     phi   = c1 * M_PI/180.;
     108    phi   = c1 * Pi/180.;
    113109  } else if(mTypCoorMap&TypCoordEq) { // CIn=Eq CMap=Eq
    114     phi   = c1 * M_PI/12.;
     110    phi   = c1 * Pi/12.;
    115111  }
    116   theta = (90.-c2) * M_PI/180.;
    117   if(phi<0.   || phi>=2*M_PI) flg=FlgToiOut;
    118   if(theta<0. || theta>=M_PI) flg=FlgToiOut;
     112  ToCoLat(&c2,TypUniteD);
     113  double theta = c2 * Pi/180.;
     114  if(phi<0. || phi>=2*Pi || theta<0. || theta>Pi)
     115               {BadCoorRange++; flg = mBadFlag; }
    119116
    120117  if(!flg) {
     
    128125}
    129126
    130 cout<<"TOI2Map::run: Samples Read "<<mSnRead<<" Filled "<<mSnFilled<<endl;
     127cout<<"TOI2Map::run: Samples Read "<<mSnRead
     128    <<" Filled "<<mSnFilled
     129    <<" BadCoorRange="<<BadCoorRange<<endl;
    131130
    132131//---------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.