Changeset 1804 in Sophya


Ignore:
Timestamp:
Nov 30, 2001, 10:07:16 PM (24 years ago)
Author:
aubourg
Message:

pour cmv

Location:
trunk/ArchTOIPipe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/toisegment.cc

    r1775 r1804  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toisegment.cc,v 1.24 2001-11-16 14:23:54 aubourg Exp $
     5// $Id: toisegment.cc,v 1.25 2001-11-30 21:07:16 aubourg Exp $
    66
    77#include "toisegment.h"
     
    612612      cout << "waiting bufferview is waiting for " << (*i)->waitingFor
    613613           << " and still needs " << (*i)->firstNeeded << endl;
     614      cout << "it has sn0= " << (*i)->sn0 << " nseg = " << (*i)->segments.size()
     615           << " snlast = " << (*i)->sn0+(*i)->segments.size()*(*i)->segmentSize -1
     616           << endl;
     617       
    614618      abort();
    615619    }
  • trunk/ArchTOIPipe/ProcWSophya/Makefile.in

    r1800 r1804  
    4545
    4646
    47 SRCFILES=map2toi.cc toi2map.cc rztoi.cc simtoipr.cc ktoibad.cc smoothtoi.cc toi2gmap.cc
     47SRCFILES=map2toi.cc toi2map.cc rztoi.cc simtoipr.cc ktoibad.cc smoothtoi.cc
    4848
    4949FILES=$(patsubst %.c,%.o,$(SRCFILES:.cc=.o))
  • trunk/ArchTOIPipe/ProcWSophya/toi2map.cc

    r1792 r1804  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toi2map.cc,v 1.19 2001-11-27 12:12:12 aubourg Exp $
     5// $Id: toi2map.cc,v 1.20 2001-11-30 21:07:16 aubourg Exp $
    66
    77#include "machdefs.h"
     
    99#include "pexceptions.h"
    1010#include "ctimer.h"
    11 #include "toi2map.h"
    12 
    13 ////////////////////////////////////////////////////////////////////////
    14 TOI2Map::TOI2Map(SphereHEALPix<r_8>* sph,SphereHEALPix<r_8>* wsph)
    15   : mSph(sph), mWSph(wsph), mWSphInternal(false)
     11#include "toi2gmap.h"
     12
     13////////////////////////////////////////////////////////////////////////
     14TOI2GMap::TOI2GMap(PixelMap<r_8>* map,PixelMap<r_8>* wmap)
     15  : mMap(map), mWMap(map), mWMapInternal(false)
    1616{
    1717 SetEquinox();
     
    2424 mIsColat = false;
    2525
    26  if(mSph->NbPixels()<1) {
    27   cout<<"TOI2Map::TOI2Map() Bad number of pixels in sphere mSph "
    28       <<mSph->NbPixels()<<endl;
    29   throw ParmError("TOI2Map::TOI2Map() - Bad number of pixels in sphere");
    30  }
    31  mSph->SetPixels(0.);
    32  int nlat = mSph->SizeIndex();
    33 
    34  if(mWSph==NULL) {
    35    mWSph = new SphereHEALPix<r_8>(nlat);
    36    mWSphInternal = true;
     26 if(mMap->NbPixels()<1) {
     27  cout<<"TOI2GMap::TOI2GMap() Bad number of pixels in sphere mMap "
     28      <<mMap->NbPixels()<<endl;
     29  throw ParmError("TOI2GMap::TOI2GMap() - Bad number of pixels in sphere");
     30 }
     31 mMap->SetPixels(0.);
     32 int nlat = mMap->SizeIndex();
     33
     34 if(mWMap==NULL) {
     35   // We would need a cloning function in maps. $$TBD$$ $CHECK$
     36   string typmap = mMap->TypeOfMap();
     37   if (typmap == "LOCAL") {
     38     mWMap = new LocalMap<r_8>(*(LocalMap<r_8>*)mMap);
     39   } else if (typmap == "RING") {
     40     mWMap = new SphereHEALPix<r_8>(nlat);
     41   } else {
     42     cout << "TOI2GMap::TOI2GMap() cannot handle map of type " << typmap << endl;
     43     throw ParmError("TOI2GMap::TOI2GMap() - bad type of map");
     44   }
     45   mWMapInternal = true;
    3746 } else {
    38    mWSphInternal = false;
    39    if(nlat != mWSph->SizeIndex()) mWSph->Resize(nlat);
    40  }
    41  if(mWSph->NbPixels()<1) {
    42    cout<<"TOI2Map::TOI2Map() Bad number of pixels in sphere mWSph "
    43        <<mWSph->NbPixels()<<endl;
    44    throw ParmError("TOI2Map::TOI2Map() - Bad number of pixels in sphere");
    45  }
    46  mWSph->SetPixels(0);
    47 
    48 }
    49 
    50 TOI2Map::~TOI2Map()
    51 {
    52  if(mWSph && mWSphInternal) delete mWSph;
    53 }
    54 
    55 ////////////////////////////////////////////////////////////////////////
    56 void TOI2Map::Print(::ostream & os)
    57 {
    58   os<<"TOI2Map::Print -- Sphere NLat = "<<mSph->SizeIndex()<<endl
     47   mWMapInternal = false;
     48   if(nlat != mWMap->SizeIndex()) {
     49     cout << "TOI2GMap::TOI2GMap() Bad size for sphere mWMap, does not "
     50          << "correspond to mMap : " << mMap->SizeIndex() << ", " << mWMap->SizeIndex() << endl;
     51     throw ParmError("TOI2GMap::TOI2GMap() - Different sizes for map and wmap");
     52   }
     53 }
     54 if(mWMap->NbPixels()<1) {
     55   cout<<"TOI2GMap::TOI2GMap() Bad number of pixels in sphere mWMap "
     56       <<mWMap->NbPixels()<<endl;
     57   throw ParmError("TOI2GMap::TOI2GMap() - Bad number of pixels in sphere");
     58 }
     59 mWMap->SetPixels(0);
     60}
     61
     62TOI2GMap::~TOI2GMap()
     63{
     64 if(mWMap && mWMapInternal) delete mWMap;
     65}
     66
     67////////////////////////////////////////////////////////////////////////
     68void TOI2GMap::Print(::ostream & os)
     69{
     70  os<<"TOI2GMap::Print -- Map type " << mMap->TypeOfMap() << " SizeIndex = "<<mMap->SizeIndex()<<endl
    5971
    6072    <<"   - Equinoxe="<<mActualYear<<endl
     
    7890
    7991////////////////////////////////////////////////////////////////////////
    80 void TOI2Map::init() {
    81   cout << "TOI2Map::init" << endl;
     92void TOI2GMap::init() {
     93  cout << "TOI2GMap::init" << endl;
    8294  declareInput("Coord1In");     // input index 0
    8395  declareInput("Coord2In");     // input index 1
     
    8799////////////////////////////////////////////////////////////////////////
    88100// define SANS_BUFFER
    89 void TOI2Map::run()
     101void TOI2GMap::run()
    90102{
    91103long snb = getMinIn();
     
    93105
    94106if(snb>sne) {
    95   cout<<"TOI2Map::run() - Bad sample interval"<<snb<<" , "<<sne<<endl;
    96   throw ParmError("TOI2Map::run() - Bad sample interval");
     107  cout<<"TOI2GMap::run() - Bad sample interval"<<snb<<" , "<<sne<<endl;
     108  throw ParmError("TOI2GMap::run() - Bad sample interval");
    97109}
    98110if(!checkInputTOIIndex(0) || !checkInputTOIIndex(1) || !checkInputTOIIndex(2)) {
    99   cout<<"TOI2Map::run() - Input TOI (Coord1In or Coord2In or BoloIn) not connected! "<<endl;
    100   throw ParmError("TOI2Map::run() Output TOI (Coord1In or Coord2In or BoloIn) not connected!");
     111  cout<<"TOI2GMap::run() - Input TOI (Coord1In or Coord2In or BoloIn) not connected! "<<endl;
     112  throw ParmError("TOI2GMap::run() Output TOI (Coord1In or Coord2In or BoloIn) not connected!");
    101113}
    102114if( !(mTypCoorIn&TypCoordEq || mTypCoorIn&TypCoordGal) ) {
    103   cout<<"TOI2Map::run() - Input Coordinates not Eq or Gal! "<<endl;
    104   throw ParmError("TOI2Map::run() - Input Coordinates not Eq or Gal!");
     115  cout<<"TOI2GMap::run() - Input Coordinates not Eq or Gal! "<<endl;
     116  throw ParmError("TOI2GMap::run() - Input Coordinates not Eq or Gal!");
    105117}
    106118if( !(mTypCoorOut&TypCoordEq || mTypCoorOut&TypCoordGal) ) {
    107   cout<<"TOI2Map::run() - Output Coordinates not Eq or Gal! "<<endl;
    108   throw ParmError("TOI2Map::run() - Output Coordinates not Eq or Gal!");
     119  cout<<"TOI2GMap::run() - Output Coordinates not Eq or Gal! "<<endl;
     120  throw ParmError("TOI2GMap::run() - Output Coordinates not Eq or Gal!");
    109121}
    110122
     
    118130double mjd = MJDfrYear(mActualYear);
    119131
    120 cout<<"TOI2Map::run() from "<<snb<<" to "<<sne;
     132cout<<"TOI2GMap::run() from "<<snb<<" to "<<sne;
    121133#ifndef SANS_BUFFER
    122134int bufsz = 100;
     
    189201  if(theta<0. || theta>=M_PI) continue;
    190202
    191   int_4 ipix = mSph->PixIndexSph(theta,phi);
    192   (*mSph)(ipix) += bolo;   
    193   ((*mWSph)(ipix)) += 1;
     203  int_4 ipix = mMap->PixIndexSph(theta,phi);
     204  (*mMap)(ipix) += bolo;   
     205  ((*mWMap)(ipix)) += 1;
    194206  mNSnFill++;
    195207}
    196208
    197  cout<<"TOI2Map::run(): Fin de boucle sur les sampleNum"<<endl;
     209 cout<<"TOI2GMap::run(): Fin de boucle sur les sampleNum"<<endl;
    198210
    199211// Remplissage des spheres
    200  for(int_4 i=0;i<mSph->NbPixels();i++) {
    201    r_8 wf = (*mWSph)(i);
     212 for(int_4 i=0;i<mMap->NbPixels();i++) {
     213   r_8 wf = (*mWMap)(i);
    202214   if( wf > 0. ) {
    203215     mNpixFill++;
    204      (*mSph)(i) /= wf;
     216     (*mMap)(i) /= wf;
    205217   }
    206218   int_4 nf = int_4(wf);
     
    208220 }
    209221
    210  cout<<"TOI2Map::run(): mNpixTot="<<mSph->NbPixels()
     222 cout<<"TOI2GMap::run(): mNpixTot="<<mMap->NbPixels()
    211223     <<"  mNpixFill="<<mNpixFill
    212224     <<"  mNSnFill="<<mNSnFill<<endl
    213      <<"  --> FracSky="<<mNpixFill*100./(double)mSph->NbPixels()<<"%"
     225     <<"  --> FracSky="<<mNpixFill*100./(double)mMap->NbPixels()<<"%"
    214226     <<"  NFill["<<NFILL<<"] ="<<endl;
    215227 for(ii=0;ii<NFILL;ii++) {cout<<NFill[ii]<<" "; if(ii%10==9) cout<<endl;}
     
    223235//---------------------------------------------------------
    224236} catch (PException & exc) {
    225   cout<<"TOI2Map: Catched Exception "<<(string)typeid(exc).name()
     237  cout<<"TOI2GMap: Catched Exception "<<(string)typeid(exc).name()
    226238      <<"\n .... Msg= "<<exc.Msg()<<endl;
    227239}
Note: See TracChangeset for help on using the changeset viewer.