Changeset 1809 in Sophya for trunk/ArchTOIPipe


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
Files:
6 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//---------------------------------------------------------
  • trunk/ArchTOIPipe/ProcWSophya/map2toi.h

    r1762 r1809  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: map2toi.h,v 1.6 2001-11-13 16:22:47 aubourg Exp $
     7// $Id: map2toi.h,v 1.7 2001-12-03 20:38:02 cmv Exp $
    88
    99#ifndef MAP2TOI_H
     
    4242  virtual void  run(void);
    4343
    44   // Pour savoir si on a de HourDeg,DegDeg,RadRad
     44  // Flag pour les mauvais samples
     45  inline void SetBad(unsigned long long flg=FlgToiOut)
     46                    {mBadFlag = flg;}
     47
     48  // Pour definir la partie astrometrie
    4549  inline void SetEquinox(double actualyear=2000.)
    4650              {mActualYear = actualyear;}
    47   inline void SetCoorIn(TypAstroCoord mfg=TypCoordGalStd)
     51
     52  inline void SetCoorIn(unsigned long mfg=TypCoordGalStd)
    4853              {mTypCoorIn = mfg;}
    49   inline void SetCoorMap(TypAstroCoord mfg=TypCoordGalStd)
     54  inline void SetCoorIn(char const *ctype)
     55              {mTypCoorIn = DecodeTypAstro(ctype);}
     56
     57  inline void SetCoorMap(unsigned long mfg=TypCoordGal)
    5058              {mTypCoorMap = mfg;}
     59  inline void SetCoorMap(char const *ctype)
     60              {mTypCoorMap = DecodeTypAstro(ctype);}
     61
    5162  // Print
    5263  void Print(::ostream & os);
     
    5465protected:
    5566  SphereHEALPix<r_8>& mSph;
    56   TypAstroCoord mTypCoorIn,mTypCoorMap;
     67  unsigned long mTypCoorIn,mTypCoorMap;
     68  unsigned long long mBadFlag;
    5769  double mActualYear;
    5870};
  • trunk/ArchTOIPipe/ProcWSophya/toi2map.cc

    r1807 r1809  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toi2map.cc,v 1.23 2001-12-01 13:35:15 aubourg Exp $
     5// $Id: toi2map.cc,v 1.24 2001-12-03 20:38:02 cmv Exp $
    66
    77#include "machdefs.h"
     
    1010#include "ctimer.h"
    1111#include "toi2map.h"
     12// La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta
     13#include "smathconst.h"
    1214
    1315////////////////////////////////////////////////////////////////////////
    1416TOI2Map::TOI2Map(PixelMap<r_8>* map,PixelMap<r_8>* wmap)
    15   : mMap(map), mWMap(map), mWMapInternal(false)
     17  : mMap(map), mWMap(wmap), mWMapInternal(false)
    1618{
    1719 SetEquinox();
    1820 SetCoorIn();
    19  SetCoorOut();
     21 SetCoorMap();
    2022 SetTestFlag();
    2123 SetTestMin();
    2224 SetTestMax();
    23 
    24  mIsColat = false;
    2525
    2626 if(mMap->NbPixels()<1) {
     
    3131 mMap->SetPixels(0.);
    3232 int nlat = mMap->SizeIndex();
     33 string typmap = mMap->TypeOfMap();
    3334
    3435 if(mWMap==NULL) {
    3536   // We would need a cloning function in maps. $$TBD$$ $CHECK$
    36    string typmap = mMap->TypeOfMap();
    3737   if (typmap == "LOCAL") {
    3838     mWMap = new LocalMap<r_8>(*(LocalMap<r_8>*)mMap);
     
    4747   mWMapInternal = false;
    4848   if(nlat != mWMap->SizeIndex()) {
    49      cout << "TOI2Map::TOI2Map() Bad size for sphere mWMap, does not "
    50           << "correspond to mMap : " << mMap->SizeIndex() << ", " << mWMap->SizeIndex() << endl;
    51      throw ParmError("TOI2Map::TOI2Map() - Different sizes for map and wmap");
     49     cout<<"TOI2Map::TOI2Map() Bad size for sphere mWMap, does not "
     50         <<"correspond to mMap : "<<mMap->SizeIndex()<<", "<<mWMap->SizeIndex()<<endl;
     51     if (typmap == "LOCAL") {
     52       throw ParmError("TOI2Map::TOI2Map() - Different sizes for map and wmap");
     53     } else if(typmap == "RING") {
     54       ((SphereHEALPix<r_8> *)mWMap)->Resize(nlat);
     55       cout<<"Resize have been done..."<<endl;
     56     } else {
     57       cout << "TOI2Map::TOI2Map() cannot handle map of type " << typmap << endl;
     58       throw ParmError("TOI2Map::TOI2Map() - bad type of map");
     59     }
    5260   }
    5361 }
     
    6876void TOI2Map::Print(::ostream & os)
    6977{
    70   os<<"TOI2Map::Print -- Map type " << mMap->TypeOfMap() << " SizeIndex = "<<mMap->SizeIndex()<<endl
    71 
    72     <<"   - Equinoxe="<<mActualYear<<endl
    73 
    74     <<"   - TypCoorIn: Gal("<<((mTypCoorIn&TypCoordGal)?1:0)
    75     <<") Eq("<<((mTypCoorIn&TypCoordEq)?1:0)
    76     <<") Deg("<<((mTypCoorIn&TypCoordDD)?1:0)
    77     <<") Hour("<<((mTypCoorIn&TypCoordHD)?1:0)
    78     <<") Rad("<<((mTypCoorIn&TypCoordRR)?1:0)<<")"<<endl
    79 
    80     <<"   - TypCoorOut: Gal("<<((mTypCoorOut&TypCoordGal)?1:0)
    81     <<") Eq("<<((mTypCoorOut&TypCoordEq)?1:0)
    82     <<") Deg("<<((mTypCoorOut&TypCoordDD)?1:0)
    83     <<") Hour("<<((mTypCoorOut&TypCoordHD)?1:0)
    84     <<") Rad("<<((mTypCoorOut&TypCoordRR)?1:0)<<")"<<endl
    85 
    86     <<"   - Tests: Flag("<<mTFlag<<") bad="<<mBadFlag
    87     <<" / Value Min("<<mTMin<<")="<<mValMin
    88     <<" , Max("<<mTMax<<")="<<mValMax<<endl;
     78 os<<"TOI2Map::Print -- Map type " << mMap->TypeOfMap() << " SizeIndex = "<<mMap->SizeIndex()<<endl
     79   <<"   - Equinoxe="<<mActualYear<<endl
     80   <<"   - TypCoorIn:  "<<mTypCoorIn<<" = "<<DecodeTypAstro(mTypCoorIn)<<endl
     81   <<"   - TypCoorMap: "<<mTypCoorMap<<" = "<<DecodeTypAstro(mTypCoorMap)<<endl
     82   <<"  - Tests: Flag("<<mTFlag<<") bad="<<mBadFlag
     83   <<" / Value Min("<<mTMin<<")="<<mValMin
     84   <<" , Max("<<mTMax<<")="<<mValMax<<endl;
    8985}
    9086
     
    116112  throw ParmError("TOI2Map::run() - Input Coordinates not Eq or Gal!");
    117113}
    118 if( !(mTypCoorOut&TypCoordEq || mTypCoorOut&TypCoordGal) ) {
     114if( !(mTypCoorMap&TypCoordEq || mTypCoorMap&TypCoordGal) ) {
    119115  cout<<"TOI2Map::run() - Output Coordinates not Eq or Gal! "<<endl;
    120116  throw ParmError("TOI2Map::run() - Output Coordinates not Eq or Gal!");
     
    126122
    127123int ii;
    128 uint_4 mNSnFill=0, mNpixFill=0, NFill[NFILL];
     124uint_4 mNSnFill=0, mNpixFill=0, NFill[NFILL], BadCoorRange=0;
    129125for(ii=0;ii<NFILL;ii++) NFill[ii]=0;
    130126double mjd = MJDfrYear(mActualYear);
     
    175171  // sphere phi   entre [0,2*Pi] en radians
    176172  // sphere theta entre [0,Pi]   en radians
    177   double phi=-1.,theta;
    178   CoordConvertToStd(mTypCoorIn,coord1,coord2);
    179 
    180   if(mTypCoorIn&TypCoordEq && mTypCoorOut&TypCoordGal) { // Eq -> Gal
     173  double phi=-1.;
     174  CoordConvertToStd(mTypCoorIn,&coord1,&coord2);
     175
     176  if(mTypCoorIn&TypCoordEq && mTypCoorMap&TypCoordGal) { // Eq -> Gal
    181177    EqtoGal(mjd,coord1,coord2,&coord1,&coord2);
    182     phi   = coord1 * M_PI/180.;
    183   } else if(mTypCoorIn&TypCoordGal && mTypCoorOut&TypCoordEq) { // Gal -> Eq
     178    phi   = coord1 * Pi/180.;
     179  } else if(mTypCoorIn&TypCoordGal && mTypCoorMap&TypCoordEq) { // Gal -> Eq
    184180    GaltoEq(mjd,coord1,coord2,&coord1,&coord2);
    185     phi   = coord1 * M_PI/12.;
    186   } else if(mTypCoorOut&TypCoordGal) { // Gal -> Gal
    187     phi   = coord1 * M_PI/180.;
    188   } else if(mTypCoorOut&TypCoordEq) { // Eq -> Eq
    189     phi   = coord1 * M_PI/12.;
     181    phi   = coord1 * Pi/12.;
     182  } else if(mTypCoorMap&TypCoordGal) { // Gal -> Gal
     183    phi   = coord1 * Pi/180.;
     184  } else if(mTypCoorMap&TypCoordEq) { // Eq -> Eq
     185    phi   = coord1 * Pi/12.;
    190186  }
    191 
    192   if (phi<0) phi += 2*M_PI;
    193   if (phi>=2*M_PI) phi -= 2*M_PI;
    194   if (mIsColat) {
    195     theta = coord2 * M_PI/180;
    196   } else {
    197     theta = (90.-coord2) * M_PI/180.;     
    198   }
    199 
    200   if(phi<0.   || phi>=2*M_PI) continue;
    201   if(theta<0. || theta>=M_PI) continue;
     187  ToCoLat(&coord2,TypUniteD);
     188  double theta = coord2 * Pi/180.;
     189
     190  if(phi<0. | phi>=2*Pi || theta<0. || theta>Pi)
     191                     {BadCoorRange++; continue;}
    202192
    203193  int_4 ipix = mMap->PixIndexSph(theta,phi);
     
    212202 for(int_4 i=0;i<mMap->NbPixels();i++) {
    213203   r_8 wf = (*mWMap)(i);
    214    if( wf > 0. ) {
    215      mNpixFill++;
    216      (*mMap)(i) /= wf;
    217    }
     204   if(wf>0.) {mNpixFill++; (*mMap)(i) /= wf;}
    218205   int_4 nf = int_4(wf);
    219206   if(nf>=NFILL) nf=NFILL-1; NFill[nf]++;
     
    227214 for(ii=0;ii<NFILL;ii++) {cout<<NFill[ii]<<" "; if(ii%10==9) cout<<endl;}
    228215 cout<<endl;
     216 cout<<"  BadCoorRange="<<BadCoorRange<<endl;
    229217
    230218#ifndef SANS_BUFFER
  • trunk/ArchTOIPipe/ProcWSophya/toi2map.h

    r1807 r1809  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: toi2map.h,v 1.13 2001-12-01 13:34:09 aubourg Exp $
     7// $Id: toi2map.h,v 1.14 2001-12-03 20:38:03 cmv Exp $
    88
    9 #ifndef TOI2GMAP_H
    10 #define TOI2GMAP_H
     9#ifndef TOI2MAP_H
     10#define TOI2MAP_H
    1111
    1212#include "toiprocessor.h"
     
    3333//                     soit Galactiques  (GLong,GLat)
    3434// Sortie sur une sphere en coordonnees Equatoriales ou Galactiques
    35 // Si les CoordIn et les CoordOut sont equatoriales -> meme equinoxe!
     35// Si les CoordIn et les CoordMap sont equatoriales -> meme equinoxe!
    3636
    3737class TOI2Map : public TOIProcessor {
    3838public:
    3939                 TOI2Map(PixelMap<r_8>* map,PixelMap<r_8>* wmap=NULL);
     40                 //TOI2Map(SphereHEALPix<r_8>* map,SphereHEALPix<r_8>* wmap=NULL);
    4041  virtual       ~TOI2Map();
    4142
     
    4647  inline void SetEquinox(double actualyear=2000.)
    4748              {mActualYear = actualyear;}
    48   inline void SetCoorIn(TypAstroCoord mfg=TypCoordGalStd)
     49
     50  inline void SetCoorIn(unsigned long mfg=TypCoordGalStd)
    4951              {mTypCoorIn = mfg;}
    50   inline void SetCoorOut(TypAstroCoord mfg=TypCoordGalStd)
    51               {mTypCoorOut = mfg;}
     52  inline void SetCoorIn(const char *ctype)
     53              {mTypCoorIn = DecodeTypAstro(ctype);}
     54
     55  inline void SetCoorMap(unsigned long mfg=TypCoordGal)
     56              {mTypCoorMap = mfg;}
     57  inline void SetCoorMap(const char *ctype)
     58              {mTypCoorMap = DecodeTypAstro(ctype);}
     59
    5260  // Test on flag value ? if yes, BAD sample have flag matching mBadFlag
    5361  inline void SetTestFlag(bool tflg=false, uint_8 badflg=FlgToiAll)
     
    6472  void Print(::ostream & os);
    6573
    66   void SetIsColat(bool b=true) {mIsColat=b;} // latitude is a colatitude, 0-Pi
    6774protected:
    6875  PixelMap<r_8>* mMap;
     
    7077  bool mWMapInternal;
    7178
    72   TypAstroCoord mTypCoorIn, mTypCoorOut;
     79  unsigned long mTypCoorIn, mTypCoorMap;
    7380  double mActualYear;
    7481
    7582  bool mTFlag,mTMin,mTMax;
    76   bool mIsColat; // temporary fix
    7783  uint_8 mBadFlag;
    7884  r_8 mValMin,mValMax;
  • 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.