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/TestPipes/tstmap2toi.cc

    r1760 r1809  
    1919
    2020#include <stdexcept>
    21 
    2221
    2322void usage(void);
     
    3433     <<"          coord1 = alpha or gLong ; coord2 = delta or gLat"<<endl
    3534     <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl
    36      <<" -i c,h : coordIn caracteristics (c=G/E h=H/D) (def=G,D)"<<endl
    37      <<" -m c,h : idem -i for Sphere"<<endl
     35     <<" -i cin : coordIn caracteristics (def=\"gdcdl\")"<<endl
     36     <<" -m cmap : idem -i for Sphere (def=\"g\")"<<endl
     37     <<" -e equi : equinoxe en annee (def=2000.)"<<endl
    3838     <<" fitsin_point : fits file for pointing"<<endl
    3939     <<" fitsphere : fits file for input Healpix sphere"<<endl
     
    4242}
    4343
    44 unsigned long typecoord(char typc=' ',char hd=' ');
    45 unsigned long typecoord(char typc,char hd)
    46 // typc : G=galactiques, E=equatoriales, autres=galactiques
    47 // hd : H=heure, D=degre, autres=(heure si typc==E, degre si typc==G)
    48 {
    49   if(typc!='G' && typc!='E') typc='G';
    50   if(hd!='H' && hd!='D') {if(typc=='E') hd='H'; else hd='D';}
    51  unsigned long rc=TypCoordUndef;
    52   if(typc=='G') rc |= TypCoordGal;
    53     else        rc |= TypCoordEq;
    54   if(hd=='D')   rc |= TypCoordDD;
    55     else        rc |= TypCoordHD;
    56   return rc;
    57 }
    58 
    5944////////////////////////////////////////////////////////////////
    6045int main(int narg, char** arg) {
     
    6550int lp = 0, width = 8192;
    6651char *label_coord1 = "coord1", *label_coord2 = "coord2", *label_bolomuv = "boloMuV";
     52char *tcoorin="gdcdl", *tcoormap="g";
     53double equi=2000.;
    6754long sdeb,sfin;
    68 unsigned long tcoorin=typecoord(), tcoormap=typecoord();
    69 int c; char t=' ',h=' ';
    70 while((c = getopt(narg,arg,"hp:s:w:a:d:b:i:m:")) != -1) {
     55int c;
     56while((c = getopt(narg,arg,"hp:s:w:a:d:b:i:m:e:")) != -1) {
    7157  switch (c) {
    7258  case 's' :
     
    9581    break;
    9682  case 'i' :
    97     sscanf(optarg,"%c,%c",&t,&h);
    98     tcoorin=typecoord(t,h);
     83    tcoorin = optarg;
    9984    break;
    10085  case 'm' :
    101     sscanf(optarg,"%c,%c",&t,&h);
    102     tcoormap=typecoord(t,h);
     86    tcoormap = optarg;
     87    break;
     88  case 'e' :
     89    sscanf(optarg,"%lf",&equi);
    10390    break;
    10491  case 'h' :
     
    11299char * fitsout         = arg[optind+2];
    113100
    114 {
    115 unsigned long tg,te,hd,dd;
    116101cout<<">>>> tstmap2toi:"<<endl
    117102    <<"Pipe Window Size "<<width<<endl
    118103    <<"Fits OutFile "<<fitsout<<endl
    119104    <<"  ...label_bolomuv "<<label_bolomuv<<endl;
    120 tg = tcoorin&TypCoordGal; te = tcoorin&TypCoordEq;
    121 hd = tcoorin&TypCoordHD;  dd = tcoorin&TypCoordDD;
    122105cout<<"Fits Infile Pointing "<<fitsin_point<<endl
    123106    <<"  ...label_coord1 "<<label_coord1<<endl
    124107    <<"  ...label_coord2 "<<label_coord2<<endl
    125     <<"  ...... Gal="<<tg<<" Eq="<<te<<"   hour="<<hd<<" deg="<<dd<<endl;
    126 tg = tcoormap&TypCoordGal; te = tcoormap&TypCoordEq;
    127 hd = tcoormap&TypCoordHD;  dd = tcoormap&TypCoordDD;
     108    <<"  ...... ctype="<<tcoorin<<endl;
    128109cout<<"Fits Healpix Sphere "<<fitsphere<<endl
    129     <<"  ...... Gal="<<tg<<" Eq="<<te<<"   hour="<<hd<<" deg="<<dd<<endl;
    130 }
     110    <<"  ...... ctype="<<tcoormap<<endl;
     111cout<<"Equinoxe "<<equi<<" years"<<endl;
    131112
    132113SophyaInit();
     
    157138 Map2TOI m2toi(sph);
    158139 cout<<"Map2TOI created"<<endl;
    159  m2toi.SetEquinox(2000.);
    160  m2toi.SetCoorIn((TypAstroCoord) tcoorin);
    161  m2toi.SetCoorMap((TypAstroCoord) tcoormap);
     140 m2toi.SetEquinox(equi);
     141 m2toi.SetCoorIn(tcoorin);
     142 m2toi.SetCoorMap(tcoormap);
    162143 m2toi.Print(cout);
    163144
     
    219200 wfits.start();
    220201
    221  if(lp>1)
    222    for(int jjjj=0;jjjj<5;jjjj++) {
    223      cout<<*toicoord1in;
    224      cout<<*toibolout;
    225      sleep(2);
    226    }
     202 //if(lp>1) for(int jjjj=0;jjjj<5;jjjj++) {
     203 //  cout<<*toicoord1in;
     204 //  cout<<*toibolout;
     205 //  sleep(2);
     206 //}
    227207
    228208 //  Affichage de l'avancement des TOIProcessors
Note: See TracChangeset for help on using the changeset viewer.