Changeset 1530 in Sophya for trunk/ArchTOIPipe/TestPipes


Ignore:
Timestamp:
Jun 14, 2001, 7:53:29 PM (24 years ago)
Author:
cmv
Message:

ameliorations et + de possibilites cmv 14/6/01

Location:
trunk/ArchTOIPipe/TestPipes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/TestPipes/tstmap2toi.cc

    r1520 r1530  
    137137
    138138 FITSTOIWriter wfits(fitsout);
    139  wfits.setOutFlags(true);
     139 //wfits.setOutFlags(true);
    140140 cout << "fits reader and writer created"<<endl;
    141141
     
    153153 m2toi.SetCoorIn((TypAstroCoord) tcoorin);
    154154 m2toi.SetCoorMap((TypAstroCoord) tcoormap);
     155 m2toi.Print(cout);
    155156
    156157 // Definition des tuyaux
  • trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc

    r1520 r1530  
    2020     <<"           [-a label_coord1] [-d label_coord2] [-b label_bolomuv]"<<endl
    2121     <<"           [-n nlat] [-i c,h] [-o c,h]"<<endl
     22     <<"           [-m vmin] [-M vmax] [-f flag]"<<endl
    2223     <<"           fitsin_point fitsin_bolo fitsphout [fitsphwout]"<<endl
    2324     <<" -p lp : print level (def=0)"<<endl
     
    2930     <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl
    3031     <<" -n nlat : nlat for Healpix sphere (def=128)"<<endl
    31      <<" -i c,h : coordIn caracteristics (c=G/E h=H/D) (def=G,D)"<<endl
     32     <<" -i c,h : coordIn caracteristics (c=G/E h=H/D/R) (def=G,D)"<<endl
    3233     <<" -o c,h : idem -i for coordOut"<<endl
     34     <<" -m vmin : samples are good if sample value >= vmin"<<endl
     35     <<" -M vmax : samples are good if sample value <= vmax"<<endl
     36     <<" -f flag : samples are bad if match flag"<<endl
    3337     <<" fitsin_point : fits file for pointing"<<endl
    3438     <<" fitsin_bolo : fits file for bolo values"<<endl
     
    4044unsigned long typecoord(char typc,char hd)
    4145// typc : G=galactiques, E=equatoriales, autres=galactiques
    42 // hd : H=heure, D=degre, autres=(heure si typc==E, degre si typc==G)
     46// hd : H=heure, D=degre, R=radian, autres=(heure si typc==E, degre si typc==G)
    4347{
    4448  if(typc!='G' && typc!='E') typc='G';
    45   if(hd!='H' && hd!='D') {if(typc=='E') hd='H'; else hd='D';}
     49  if(hd!='H' && hd!='D' && hd!='R') {if(typc=='E') hd='H'; else hd='D';}
    4650 unsigned long rc=TypCoordUndef;
    4751  if(typc=='G') rc |= TypCoordGal;
    4852    else        rc |= TypCoordEq;
    49   if(hd=='D')   rc |= TypCoordDD;
    50     else        rc |= TypCoordHD;
     53  if(hd=='D')        rc |= TypCoordDD;
     54    else if(hd=='R') rc |= TypCoordRR;
     55      else           rc |= TypCoordHD;
    5156  return rc;
    5257}
     
    6065int lp = 0, width = 8192;
    6166int nlat = 128;   // npixel = 12 * nlat^2
    62 char *label_coord1 = "coord1", *label_coord2 = "coord2", *label_bolomuv = "boloMuV";
     67bool tflg=false, tmin=false, tmax=false;
     68r_8 vmin=-1.e30, vmax=1.e30; int_8 badflg=0;
     69char *label_coord1 = "coord1", *label_coord2 = "coord2"
     70   , *label_bolomuv = "boloMuV";
    6371long sdeb,sfin;
    6472string fitsphwout = "";
    6573unsigned long tcoorin=typecoord(), tcoorout=typecoord();
    6674int c; char t=' ',h=' ';
    67 while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:")) != -1) {
     75while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:m:M:f:")) != -1) {
    6876  switch (c) {
    6977  case 's' :
     
    103111    tcoorout=typecoord(t,h);
    104112    break;
     113  case 'm' :
     114    sscanf(optarg,"%lf",&vmin);
     115    tmin = true;
     116    break;
     117  case 'M' :
     118    sscanf(optarg,"%lf",&vmax);
     119    tmax = true;
     120    break;
     121  case 'f' :
     122    sscanf(optarg,"%ld",&badflg);
     123    tflg = true;
     124    break;
    105125  case 'h' :
    106126  default:
     
    116136if(optind+3<narg) fitsphwout = arg[optind+3];
    117137
    118 {
    119 unsigned long tg,te,hd,dd;
    120138cout<<">>>> tsttoi2map:"<<endl
    121139    <<"Pipe Window Size "<<width<<endl
    122140    <<"Fits Infile Bolo "<<fitsin_bolo<<endl
    123141    <<"  ...label_bolomuv "<<label_bolomuv<<endl;
    124 tg = tcoorin&TypCoordGal; te = tcoorin&TypCoordEq;
    125 hd = tcoorin&TypCoordHD;  dd = tcoorin&TypCoordDD;
    126142cout<<"Fits Infile Pointing "<<fitsin_point<<endl
    127143    <<"  ...label_coord1 "<<label_coord1<<endl
    128     <<"  ...label_coord2 "<<label_coord2<<endl
    129     <<"  ...... Gal="<<tg<<" Eq="<<te<<"   hour="<<hd<<" deg="<<dd<<endl;
    130 tg = tcoorout&TypCoordGal; te = tcoorout&TypCoordEq;
    131 hd = tcoorout&TypCoordHD;  dd = tcoorout&TypCoordDD;
     144    <<"  ...label_coord2 "<<label_coord2<<endl;
    132145cout<<"Fits Healpix Sphere "<<fitsphout<<endl
    133     <<"  ...nlat "<<nlat<<endl
    134     <<"  ...... Gal="<<tg<<" Eq="<<te<<"   hour="<<hd<<" deg="<<dd<<endl;
     146    <<"  ...nlat "<<nlat<<endl;
    135147cout<<"Fits Healpix Weight Sphere "<<fitsphwout<<endl;
    136 }
    137148
    138149SophyaInit();
     
    157168 SphereHEALPix<r_8>* sph = new SphereHEALPix<r_8>(nlat);
    158169 cout<<"SphereHEALPix: Type de map : "<<sph->TypeOfMap()<<endl
    159      <<"               Nombre de pixels : "<<sph->NbPixels()<<endl;
     170     <<"               Nombre de pixels : "<<sph->NbPixels()<<endl
     171     <<"               Nlat : "<<sph->SizeIndex()<<endl;
    160172
    161173 // Creation de la sphere de poids Healpix
     
    163175 if(fitsphwout.size()>0) {
    164176   wsph = new SphereHEALPix<r_8>;
    165    cout<<"SphereHEALPix Weight: Type de map : "<<wsph->TypeOfMap()<<endl
    166        <<"              Nombre de pixels : "<<wsph->NbPixels()<<endl;
     177   cout<<"SphereHEALPix Weight Created"<<endl;
    167178 }
    168179
     
    173184 toi2m.SetCoorIn((TypAstroCoord) tcoorin);
    174185 toi2m.SetCoorOut((TypAstroCoord) tcoorout);
     186 toi2m.SetTestFlag(tflg,badflg);
     187 toi2m.SetTestMin(tmin,vmin);
     188 toi2m.SetTestMax(tmax,vmax);
     189 toi2m.Print(cout);
    175190
    176191 // Definition des tuyaux
Note: See TracChangeset for help on using the changeset viewer.