Changeset 2099 in Sophya for trunk/ArchTOIPipe/ProcWSophya


Ignore:
Timestamp:
Jul 16, 2002, 5:26:19 PM (23 years ago)
Author:
cecile
Message:

* empty log message *

Location:
trunk/ArchTOIPipe/ProcWSophya
Files:
2 edited

Legend:

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

    r2095 r2099  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toi2toi_addsp.cc,v 1.1 2002-07-16 08:48:06 cecile Exp $
     5// $Id: toi2toi_addsp.cc,v 1.2 2002-07-16 15:26:19 cecile Exp $
    66
    77#include "machdefs.h"
     
    99#include "pexceptions.h"
    1010#include "ctimer.h"
    11 #include "toi2map.h"
     11#include "toi2toi_addsp.h"
    1212// La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta
    1313#include "smathconst.h"
    1414
    1515////////////////////////////////////////////////////////////////////////
    16 TOI2Map::TOI2Map()
    17   : totnscount(0)
     16Toi2toi_Addsp::Toi2toi_Addsp(Info_src* info, int_4 ns)
     17  : src(info), nb_src(ns)
    1818{
    1919 SetEquinox();
     
    2626}
    2727
    28 TOI2Map::~TOI2Map()
     28Toi2toi_Addsp::~Toi2toi_Addsp()
    2929{
    3030}
    3131
    3232////////////////////////////////////////////////////////////////////////
    33 void TOI2Map::Print(::ostream & os)
     33void Toi2toi_Addsp::Print(::ostream & os)
    3434{
    3535}
    3636
    3737////////////////////////////////////////////////////////////////////////
    38 void TOI2Map::init() {
    39   cout << "TOI2Map::init" << endl;
     38void Toi2toi_Addsp::init() {
     39  cout << "Toi2toi_Addsp::init" << endl;
     40  declareInput("BoloIn");
    4041  declareInput("Coord1In");
    4142  declareInput("Coord2In");
    42   declareInput("BoloIn");
    4343  declareInput("utc");
    4444  declareInput("lon");
     
    4949
    5050////////////////////////////////////////////////////////////////////////
    51 // define SANS_BUFFER
    52 void TOI2Map::run()
     51void Toi2toi_Addsp::run()
    5352{
    5453long snb = getMinIn();
     
    5655
    5756if(snb>sne) {
    58   cout<<"TOI2Map::run() - Bad sample interval"<<snb<<" , "<<sne<<endl;
    59   throw ParmError("TOI2Map::run() - Bad sample interval");
     57  cout<<"Toi2toi_Addsp::run() - Bad sample interval"<<snb<<" , "<<sne<<endl;
     58  throw ParmError("Toi2toi_Addsp::run() - Bad sample interval");
    6059}
    6160if(!checkInputTOIIndex(0) || !checkInputTOIIndex(1) || !checkInputTOIIndex(2)) {
    62   cout<<"TOI2Map::run() - Input TOI (Coord1In or Coord2In or BoloIn) not connected! "<<endl;
    63   throw ParmError("TOI2Map::run() Output TOI (Coord1In or Coord2In or BoloIn) not connected!");
     61  cout<<"Toi2toi_Addsp::run() - Input TOI (Coord1In or Coord2In or BoloIn) not connected! "<<endl;
     62  throw ParmError("Toi2toi_Addsp::run() Output TOI (Coord1In or Coord2In or BoloIn) not connected!");
    6463}
    6564if( !(mTypCoorIn&TypCoordEq || mTypCoorIn&TypCoordGal) ) {
    66   cout<<"TOI2Map::run() - Input Coordinates not Eq or Gal! "<<endl;
    67   throw ParmError("TOI2Map::run() - Input Coordinates not Eq or Gal!");
     65  cout<<"Toi2toi_Addsp::run() - Input Coordinates not Eq or Gal! "<<endl;
     66  throw ParmError("Toi2toi_Addsp::run() - Input Coordinates not Eq or Gal!");
    6867}
    6968if( !(mTypCoorMap&TypCoordEq || mTypCoorMap&TypCoordGal) ) {
    70   cout<<"TOI2Map::run() - Output Coordinates not Eq or Gal! "<<endl;
    71   throw ParmError("TOI2Map::run() - Output Coordinates not Eq or Gal!");
     69  cout<<"Toi2toi_Addsp::run() - Output Coordinates not Eq or Gal! "<<endl;
     70  throw ParmError("Toi2toi_Addsp::run() - Output Coordinates not Eq or Gal!");
    7271}
    7372
     
    7675try {
    7776
    78 int ii;
    79 uint_4 mNSnFill=0, mNpixFill=0, NFill[NFILL], BadCoorRange=0;
    80 for(ii=0;ii<NFILL;ii++) NFill[ii]=0;
    8177double mjd = MJDfrYear(mActualYear);
    8278
    83 cout<<"TOI2Map::run() from "<<snb<<" to "<<sne;
    84 #ifndef SANS_BUFFER
    85 int bufsz = 100;
    86 uint_8* bfgbolo = new uint_8[bufsz];
    87 double* bbolo   = new double[bufsz];
    88 double* bc1     = new double[bufsz];
    89 double* bc2     = new double[bufsz];
    90 int i0 = -1;
    91 cout<<" (getData() bufferized)"<<endl;
    92 #else
    93 cout<<" (getData() not bufferized)"<<endl;
    94 #endif
     79cout<<"Toi2toi_Addsp::run() from "<<snb<<" to "<<sne;
    9580
    9681for(int s=snb;s<=sne;s++) {
    9782  uint_8 fgbolo = 0;
    98   double bolo,coord1,coord2;
     83  double bolo,bolo_sp,coord1,coord2;
    9984  //              Equatoriales   /   Galactiques
    10085  // coord1,2 =   alpha,delta    /   gLon,gLat
    10186
    102   getData(2,s,bolo,fgbolo);
    103   coord1 = getData(0,s);
    104   coord2 = getData(1,s);
    105   totnscount++;
     87  getData(0,s,bolo,fgbolo);
     88  coord1 = getData(1,s);
     89  coord2 = getData(2,s);
    10690
    10791  // Comme il n'y a pas de toi en sortie, il faut dire
     
    129113  }
    130114  ToCoLat(&coord2,TypUniteD);
    131 
     115  bolo_sp=bolo;
     116 
    132117  putData(0,s,bolo_sp,fgbolo);
    133118
     
    135120 
    136121
    137  cout<<"TOI2Map::run(): Fin de boucle sur les sampleNum"<<endl;
     122 cout<<"Toi2toi_Addsp::run(): Fin de boucle sur les sampleNum"<<endl;
    138123
    139124
    140125//---------------------------------------------------------
    141126} catch (PException & exc) {
    142   cout<<"TOI2Map: Catched Exception "<<(string)typeid(exc).name()
     127  cout<<"Toi2toi_Addsp: Catched Exception "<<(string)typeid(exc).name()
    143128      <<"\n .... Msg= "<<exc.Msg()<<endl;
    144129}
    145130
    146 return;                                                                           
     131return;     
    147132}
  • trunk/ArchTOIPipe/ProcWSophya/toi2toi_addsp.h

    r2095 r2099  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: toi2toi_addsp.h,v 1.1 2002-07-16 08:48:06 cecile Exp $
     7// $Id: toi2toi_addsp.h,v 1.2 2002-07-16 15:26:19 cecile Exp $
    88
    99#ifndef TOI2MAP_H
     
    3535// Si les CoordIn et les CoordMap sont equatoriales -> meme equinoxe!
    3636
    37 class TOI2Map : public TOIProcessor {
     37struct Info_src
     38{
     39  double glon,glat;
     40  double azi,elv;
     41  double amp,tau1,tau2;
     42};
     43
     44void Fill_Info_scr(Info_src* scr, int_4 ns);
     45
     46class Toi2toi_Addsp : public TOIProcessor {
    3847public:
    39                  TOI2Map();
    40                  //TOI2Map(SphereHEALPix<r_8>* map,SphereHEALPix<r_8>* wmap=NULL);
    41   virtual       ~TOI2Map();
     48                 Toi2toi_Addsp(Info_src* info, int_4 ns);
     49  virtual       ~Toi2toi_Addsp();
    4250
    4351  virtual void  init(void);
     
    7179  // Print
    7280  void Print(::ostream & os);
    73   inline int_8  ProcessedSampleCount() const { return totnscount; }
    7481
    7582protected:
     
    7784  unsigned long mTypCoorIn, mTypCoorMap;
    7885  double mActualYear;
     86  Info_src* src;
     87  int_4 nb_src;
    7988
    8089  bool mTFlag,mTMin,mTMax;
    8190  uint_8 mBadFlag;
    8291  r_8 mValMin,mValMax;
    83   int_8 totnscount;   // Nombre total d'echantillon processe
    8492
    8593};
Note: See TracChangeset for help on using the changeset viewer.