Changeset 1809 in Sophya for trunk/ArchTOIPipe/TestPipes


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

Location:
trunk/ArchTOIPipe/TestPipes
Files:
2 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
  • trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc

    r1760 r1809  
    3737     <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl
    3838     <<" -n nlat : nlat for Healpix sphere (def=128)"<<endl
    39      <<" -i c,h : coordIn caracteristics (c=G/E h=H/D/R) (def=G,D)"<<endl
    40      <<" -o c,h : idem -i for coordOut"<<endl
     39     <<" -i cin : coordIn caracteristics (def=\"gdcdl\")"<<endl
     40     <<" -o cmap : idem -i for coordMap (def=\"g\")"<<endl
     41     <<" -e equi : equinoxe en annee (def=2000.)"<<endl
    4142     <<" -m vmin : samples are good if sample value >= vmin"<<endl
    4243     <<" -M vmax : samples are good if sample value <= vmax"<<endl
     
    4849}
    4950
    50 unsigned long typecoord(char typc=' ',char hd=' ');
    51 unsigned long typecoord(char typc,char hd)
    52 // typc : G=galactiques, E=equatoriales, autres=galactiques
    53 // hd : H=heure, D=degre, R=radian, autres=(heure si typc==E, degre si typc==G)
    54 {
    55   if(typc!='G' && typc!='E') typc='G';
    56   if(hd!='H' && hd!='D' && hd!='R') {if(typc=='E') hd='H'; else hd='D';}
    57  unsigned long rc=TypCoordUndef;
    58   if(typc=='G') rc |= TypCoordGal;
    59     else        rc |= TypCoordEq;
    60   if(hd=='D')        rc |= TypCoordDD;
    61     else if(hd=='R') rc |= TypCoordRR;
    62       else           rc |= TypCoordHD;
    63   return rc;
    64 }
    65 
    6651////////////////////////////////////////////////////////////////
    6752int main(int narg, char** arg) {
     
    7661char *label_coord1 = "coord1", *label_coord2 = "coord2"
    7762   , *label_bolomuv = "boloMuV";
     63double equi=2000.;
     64char *tcoorin="gdcdl", *tcoormap="g";
     65string fitsphwout = "";
    7866long sdeb,sfin;
    79 string fitsphwout = "";
    80 unsigned long tcoorin=typecoord(), tcoorout=typecoord();
    81 int c; char t=' ',h=' ';
    82 while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:m:M:f:")) != -1) {
     67int c;
     68while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:m:M:f:e:")) != -1) {
    8369  switch (c) {
    8470  case 's' :
     
    11197    break;
    11298  case 'i' :
    113     sscanf(optarg,"%c,%c",&t,&h);
    114     tcoorin=typecoord(t,h);
     99    tcoorin=optarg;
    115100    break;
    116101  case 'o' :
    117     sscanf(optarg,"%c,%c",&t,&h);
    118     tcoorout=typecoord(t,h);
     102    tcoormap=optarg;
     103    break;
     104  case 'e' :
     105    sscanf(optarg,"%lf",&equi);
    119106    break;
    120107  case 'm' :
     
    149136cout<<"Fits Infile Pointing "<<fitsin_point<<endl
    150137    <<"  ...label_coord1 "<<label_coord1<<endl
    151     <<"  ...label_coord2 "<<label_coord2<<endl;
     138    <<"  ...label_coord2 "<<label_coord2<<endl
     139    <<"  ...... ctype="<<tcoorin<<endl;
    152140cout<<"Fits Healpix Sphere "<<fitsphout<<endl
    153141    <<"  ...nlat "<<nlat<<endl;
    154 cout<<"Fits Healpix Weight Sphere "<<fitsphwout<<endl;
     142cout<<"Fits Healpix Weight Sphere "<<fitsphwout<<endl
     143    <<"  ...... ctype="<<tcoormap<<endl;
     144cout<<"Equinoxe "<<equi<<" years"<<endl;
    155145
    156146SophyaInit();
     
    189179 TOI2Map toi2m(sph,wsph);
    190180 cout<<"TOI2Map created"<<endl;
    191  toi2m.SetEquinox(2000.);
    192  toi2m.SetCoorIn((TypAstroCoord) tcoorin);
    193  toi2m.SetCoorOut((TypAstroCoord) tcoorout);
     181 toi2m.SetEquinox(equi);
     182 toi2m.SetCoorIn(tcoorin);
     183 toi2m.SetCoorMap(tcoormap);
    194184 toi2m.SetTestFlag(tflg,badflg);
    195185 toi2m.SetTestMin(tmin,vmin);
Note: See TracChangeset for help on using the changeset viewer.