Changeset 2329 for branches


Ignore:
Timestamp:
10/05/11 19:44:38 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Merge bug fix on trunk (r2328).


Location:
branches/casa-prerelease/pre-asap
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/casa-prerelease/pre-asap

    • Property svn:mergeinfo changed
      /trunkmerged: 2328
  • branches/casa-prerelease/pre-asap/Makefile

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/SConstruct

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/apps

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/external-alma

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/external-alma/atnf/pks/pks_maths.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/getsvnrev.sh

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/python

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/src

  • branches/casa-prerelease/pre-asap/src/MSWriter.cpp

    r2319 r2329  
    4646namespace asap {
    4747
    48 class PolarizedComponentHolder {
     48class CorrTypeHandler {
    4949public:
    50   PolarizedComponentHolder()
    51     : nchan(0),
    52       maxnpol(4)
    53   {
     50  CorrTypeHandler()
     51  {}
     52  virtual ~CorrTypeHandler() {}
     53  virtual Vector<Stokes::StokesTypes> corrType() = 0 ;
     54  virtual void reset()
     55  {
     56    npol = 0 ;
     57  }
     58  void append( uInt polno )
     59  {
     60    polnos[npol] = polno ;
     61    npol++ ;
     62  }
     63  uInt nPol() { return npol ; }
     64protected:
     65  Vector<Stokes::StokesTypes> polmap ;
     66  uInt polnos[4] ;
     67  uInt npol ;
     68};
     69
     70class LinearHandler : public CorrTypeHandler {
     71public:
     72  LinearHandler()
     73    : CorrTypeHandler()
     74  {
     75    initMap() ;
     76  }
     77  virtual ~LinearHandler() {}
     78  virtual Vector<Stokes::StokesTypes> corrType()
     79  {
     80    Vector<Stokes::StokesTypes> ret( npol, Stokes::Undefined ) ;
     81    if ( npol < 4 ) {
     82      for ( uInt ipol = 0 ; ipol < npol ; ipol++ )
     83        ret[ipol] = polmap[polnos[ipol]] ;
     84    }
     85    else if ( npol == 4 ) {
     86      ret[0] = polmap[0] ;
     87      ret[1] = polmap[2] ;
     88      ret[2] = polmap[3] ;
     89      ret[4] = polmap[1] ;
     90    }
     91    else {
     92      throw( AipsError("npol > 4") ) ;
     93    }
     94    return ret ;
     95  }
     96protected:
     97  void initMap()
     98  {
     99    polmap.resize( 4 ) ;
     100    polmap[0] = Stokes::XX ;
     101    polmap[1] = Stokes::YY ;
     102    polmap[2] = Stokes::XY ;
     103    polmap[3] = Stokes::YX ;
     104  }
     105};
     106class CircularHandler : public CorrTypeHandler {
     107public:
     108  CircularHandler()
     109    : CorrTypeHandler()
     110  {
     111    initMap() ;
     112  }
     113  virtual ~CircularHandler() {}
     114  virtual Vector<Stokes::StokesTypes> corrType()
     115  {
     116    Vector<Stokes::StokesTypes> ret( npol, Stokes::Undefined ) ;
     117    if ( npol < 4 ) {
     118      for ( uInt ipol = 0 ; ipol < npol ; ipol++ )
     119        ret[ipol] = polmap[polnos[ipol]] ;
     120    }
     121    else if ( npol == 4 ) {
     122      ret[0] = polmap[0] ;
     123      ret[1] = polmap[2] ;
     124      ret[2] = polmap[3] ;
     125      ret[3] = polmap[1] ;
     126    }
     127    else {
     128      throw( AipsError("npol > 4") ) ;
     129    }
     130    return ret ;
     131  }
     132private:
     133  void initMap()
     134  {
     135    polmap.resize( 4 ) ;
     136    polmap[0] = Stokes::RR ;
     137    polmap[1] = Stokes::LL ;
     138    polmap[2] = Stokes::RL ;
     139    polmap[3] = Stokes::LR ;
     140  }
     141};
     142class StokesHandler : public CorrTypeHandler {
     143public:
     144  StokesHandler()
     145    : CorrTypeHandler()
     146  {
     147    initMap() ;
     148  }
     149  virtual ~StokesHandler() {}
     150  virtual Vector<Stokes::StokesTypes> corrType()
     151  {
     152    Vector<Stokes::StokesTypes> ret( npol, Stokes::Undefined ) ;
     153    if ( npol <= 4 ) {
     154      for ( uInt ipol = 0 ; ipol < npol ; ipol++ )
     155        ret[ipol] = polmap[polnos[ipol]] ;
     156    }
     157    else {
     158      throw( AipsError("npol > 4") ) ;
     159    }
     160    return ret ;
     161  }
     162private:
     163  void initMap()
     164  {
     165    polmap.resize( 4 ) ;
     166    polmap[0] = Stokes::I ;
     167    polmap[1] = Stokes::Q ;
     168    polmap[2] = Stokes::U ;
     169    polmap[3] = Stokes::V ;
     170  }
     171};
     172class LinPolHandler : public CorrTypeHandler {
     173public:
     174  LinPolHandler()
     175    : CorrTypeHandler()
     176  {
     177    initMap() ;
     178  }
     179  virtual ~LinPolHandler() {}
     180  virtual Vector<Stokes::StokesTypes> corrType()
     181  {
     182    Vector<Stokes::StokesTypes> ret( npol, Stokes::Undefined ) ;
     183    if ( npol <= 2 ) {
     184      for ( uInt ipol = 0 ; ipol < npol ; ipol++ )
     185        ret[ipol] = polmap[polnos[ipol]] ;
     186    }
     187    else {
     188      throw( AipsError("npol > 4") ) ;
     189    }
     190    return ret ;
     191  }
     192private:
     193  void initMap()
     194  {
     195    polmap.resize( 2 ) ;
     196    polmap[0] = Stokes::Plinear ;
     197    polmap[1] = Stokes::Pangle ;
     198  }
     199};
     200
     201class DataHolder {
     202public:
     203  DataHolder( TableRow &tableRow, String polType )
     204    : row( tableRow )
     205  {
     206    nchan = 0 ;
     207    npol = 0 ;
     208    makeCorrTypeHandler( polType ) ;
     209    attach() ;
     210    flagRow.resize( 4 ) ;
    54211    reset() ;
    55   }
    56   PolarizedComponentHolder( uInt n )
    57     : nchan(n),
    58       maxnpol(4)
    59   {
    60     reset() ;
    61   }
    62 
    63   void reset()
    64   {
     212    sigmaTemplate.resize( 4 ) ;
     213    sigmaTemplate = 1.0 ;
     214  }
     215  virtual ~DataHolder() {}
     216  virtual void post() = 0 ;
     217  virtual void reset()
     218  {
     219    corr->reset() ;
     220    flagRow = False ;
    65221    npol = 0 ;
    66     data.clear() ;
    67     flag.clear() ;
    68     flagrow = False ;
    69     polnos.resize() ;
    70   }
    71 
    72   void accumulate( uInt id, Vector<Float> sp, Vector<Bool> fl, Bool flr )
    73   {
    74     map< uInt,Vector<Float> >::iterator itr = data.find( id ) ;
    75     if ( id < maxnpol && itr == data.end() ) {
    76       addPol( id ) ;
    77       accumulateData( id, sp ) ;
    78       accumulateFlag( id, fl ) ;
    79       accumulateFlagRow( flr ) ;
    80       npol++ ;
    81     }
     222  }
     223  virtual void accumulate( uInt id, Vector<Float> &sp, Vector<Bool> &fl, Bool &flr )
     224  {
     225    accumulateCorrType( id ) ;
     226    accumulateData( id, sp ) ;
     227    accumulateFlag( id, fl ) ;
     228    accumulateFlagRow( id, flr ) ;
     229  }
     230  uInt nPol() { return npol ; }
     231  uInt nChan() { return nchan ; }
     232  Vector<Int> corrTypeInt()
     233  {
     234    Vector<Int> v( npol ) ;
     235    convertArray( v, corr->corrType() ) ;
     236    return v ;
     237  }
     238  Vector<Stokes::StokesTypes> corrType() { return corr->corrType() ; }
     239  void setNchan( uInt num )
     240  {
     241    nchan = num ;
     242    resize() ;
     243  }
     244protected:
     245  void postAuxiliary()
     246  {
     247    Vector<Float> w = sigmaTemplate( IPosition(1,0), IPosition(1,npol-1) ) ;
     248    sigmaRF.define( w ) ;
     249    weightRF.define( w ) ;
     250    Cube<Bool> c( npol, nchan, 1, False ) ;
     251    flagCategoryRF.define( c ) ;
     252  }
     253  inline void accumulateCorrType( uInt &id )
     254  {
     255    corr->append( id ) ;
     256    npol = corr->nPol() ;
    82257  }
    83 
    84   void setNchan( uInt n ) { nchan = n ; }
    85   uInt nPol() { return npol ; }
    86   uInt nChan() { return nchan ; }
    87   Vector<uInt> polNos() { return polnos ; }
    88   Vector<Float> getWeight() { return Vector<Float>( npol, 1.0 ) ; }
    89   Vector<Float> getSigma() { return Vector<Float>( npol, 1.0 ) ; }
    90   Bool getFlagRow() { return flagrow ; }
    91   Cube<Bool> getFlagCategory() { return Cube<Bool>( npol, nchan, 1, False ) ; }
    92   Matrix<Float> getData()
    93   {
    94     Matrix<Float> v( npol, nchan ) ;
    95     for ( map< uInt,Vector<Float> >::iterator i = data.begin() ; i != data.end() ; i++ ) {
    96       v.row( i->first ) =  i->second ;
    97     }
    98     return v ;
    99   }
    100   Matrix<Bool> getFlag()
    101   {
    102     Matrix<Bool> v( npol, nchan ) ;
    103     for ( map< uInt,Vector<Bool> >::iterator i = flag.begin() ; i != flag.end() ; i++ ) {
    104       v.row( i->first ) = i->second ;
    105     }
    106     return v ;
    107   }
    108   Matrix<Complex> getComplexData()
    109   {
     258  inline void accumulateFlagRow( uInt &id, Bool &flr )
     259  {
     260    flagRow[id] = flr ;
     261  }
     262  void postFlagRow()
     263  {
     264    *flagRowRF = anyEQ( flagRow, True ) ;
     265  }
     266  inline void accumulateFlag( uInt &id, Vector<Bool> &fl )
     267  {
     268    flag.row( id ) = fl ;
     269  }
     270  virtual void postFlag() = 0 ;
     271  inline void accumulateData( uInt &id, Vector<Float> &sp )
     272  {
     273    data.row( id ) = sp ;
     274  }
     275  virtual void postData() = 0 ;
     276  TableRow &row ;
     277  uInt nchan ;
     278  uInt npol ;
     279  CountedPtr<CorrTypeHandler> corr;
     280  RecordFieldPtr< Vector<Float> > sigmaRF ;
     281  RecordFieldPtr< Vector<Float> > weightRF ;
     282  RecordFieldPtr< Array<Bool> > flagRF ;
     283  RecordFieldPtr<Bool> flagRowRF ;
     284  RecordFieldPtr< Cube<Bool> > flagCategoryRF ;
     285  Vector<Bool> flagRow ;
     286  Matrix<Bool> flag ;
     287  Matrix<Float> data ;
     288  Vector<Float> sigmaTemplate ;
     289private:
     290  void makeCorrTypeHandler( String &polType )
     291  {
     292    if ( polType == "linear" )
     293      corr = new LinearHandler() ;
     294    else if ( polType == "circular" )
     295      corr = new CircularHandler() ;
     296    else if ( polType == "stokes" )
     297      corr = new StokesHandler() ;
     298    else if ( polType == "linpol" )
     299      corr = new LinPolHandler() ;
     300    else
     301      throw( AipsError("Invalid polarization type") ) ;
     302  }
     303  void attach()
     304  {
     305    TableRecord &rec = row.record() ;
     306    sigmaRF.attachToRecord( rec, "SIGMA" ) ;
     307    weightRF.attachToRecord( rec, "WEIGHT" ) ;
     308    flagRF.attachToRecord( rec, "FLAG" ) ;
     309    flagRowRF.attachToRecord( rec, "FLAG_ROW" ) ;
     310    flagCategoryRF.attachToRecord( rec, "FLAG_CATEGORY" ) ;
     311  }
     312  void resize()
     313  {
     314    flag.resize( 4, nchan ) ;
     315    data.resize( 4, nchan ) ;
     316  }
     317};
     318
     319class FloatDataHolder : public DataHolder {
     320public:
     321  FloatDataHolder( TableRow &tableRow, String polType )
     322    : DataHolder( tableRow, polType )
     323  {
     324    attachData() ;
     325  }
     326  virtual ~FloatDataHolder() {}
     327  virtual void post()
     328  {
     329    postData() ;
     330    postFlag() ;
     331    postFlagRow() ;
     332    postAuxiliary() ;
     333  }
     334protected:
     335  virtual void postFlag()
     336  {
     337    flagRF.define( flag( IPosition( 2, 0, 0 ), IPosition( 2, npol-1, nchan-1 ) ) ) ;
     338  }
     339  virtual void postData()
     340  {
     341    dataRF.define( data( IPosition( 2, 0, 0 ), IPosition( 2, npol-1, nchan-1 ) ) ) ;
     342  }
     343private:
     344  void attachData()
     345  {
     346    dataRF.attachToRecord( row.record(), "FLOAT_DATA" ) ;
     347  }
     348  RecordFieldPtr< Matrix<Float> > dataRF;
     349};
     350
     351class ComplexDataHolder : public DataHolder {
     352public:
     353  ComplexDataHolder( TableRow &tableRow, String polType )
     354    : DataHolder( tableRow, polType )
     355  {
     356    attachData() ;
     357  }
     358  virtual ~ComplexDataHolder() {}
     359  virtual void accumulate( uInt id, Vector<Float> &sp, Vector<Bool> &fl, Bool &flr )
     360  {
     361    DataHolder::accumulate( id, sp, fl, flr ) ;
     362    isFilled[id] = True ;
     363  }
     364  virtual void post()
     365  {
     366    postData() ;
     367    postFlag() ;
     368    postFlagRow() ;
     369    postAuxiliary() ;
     370  }
     371  virtual void reset()
     372  {
     373    DataHolder::reset() ;
     374    for ( uInt i = 0 ; i < 4 ; i++ )
     375      isFilled[i] = False ;
     376  }
     377protected:
     378  virtual void postFlag()
     379  {
     380    if ( npol == 4 ) {
     381      Vector<Bool> tmp = flag.row( 3 ) ;
     382      flag.row( 3 ) = flag.row( 1 ) ;
     383      flag.row( 2 ) = flag.row( 2 ) || tmp ;
     384      flag.row( 1 ) = flag.row( 2 ) ;
     385      flagRF.define( flag ) ;
     386    }
     387    else {
     388      flagRF.define( flag( IPosition( 2, 0, 0 ), IPosition( 2, npol-1, nchan-1 ) ) ) ;
     389    }
     390  }
     391  virtual void postData()
     392  {
     393    Matrix<Float> tmp( 2, nchan, 0.0 ) ;
    110394    Matrix<Complex> v( npol, nchan ) ;
    111     Matrix<Float> dummy( 2, nchan, 0.0 ) ;
    112     map< uInt,Vector<Float> >::iterator itr0 = data.find( 0 ) ;
    113     map< uInt,Vector<Float> >::iterator itr1 = data.find( 1 ) ;
    114     if ( itr0 != data.end() ) {
    115       dummy.row( 0 ) = itr0->second ;
    116       v.row( 0 ) = RealToComplex( dummy ) ;
    117     }
    118     if ( itr1 != data.end() ) {
    119       dummy.row( 0 ) = itr1->second ;
    120       v.row( npol-1 ) = RealToComplex( dummy ) ;
    121     }
    122     itr0 = data.find( 2 ) ;
    123     itr1 = data.find( 3 ) ;
    124     if ( itr0 != data.end() && itr1 != data.end() ) {
    125       dummy.row( 0 ) = itr0->second ;
    126       dummy.row( 1 ) = itr1->second ;
    127       v.row( 1 ) = RealToComplex( dummy ) ;
     395    if ( isFilled[0] ) {
     396      tmp.row( 0 ) = data.row( 0 ) ;
     397      v.row( 0 ) = RealToComplex( tmp ) ;
     398    }
     399    if ( isFilled[1] ) {
     400      tmp.row( 0 ) = data.row( 1 ) ;
     401      v.row( npol-1 ) = RealToComplex( tmp ) ;
     402    }
     403    if ( isFilled[2] && isFilled[3] ) {
     404      tmp.row( 0 ) = data.row( 2 ) ;
     405      tmp.row( 1 ) = data.row( 3 ) ;
     406      v.row( 1 ) = RealToComplex( tmp ) ;
    128407      v.row( 2 ) = conj( v.row( 1 ) ) ;
    129408    }
    130     return v ;
    131   }
    132 
    133   Matrix<Bool> getComplexFlag()
    134   {
    135     Matrix<Bool> tmp = getFlag() ;
    136     Matrix<Bool> v( npol, nchan ) ;
    137     v.row( 0 ) = tmp.row( 0 ) ;
    138     if ( npol == 2 ) {
    139       v.row( npol-1 ) = tmp.row( 1 ) ;
    140     }
    141     else if ( npol > 2 ) {
    142       v.row( npol-1 ) = tmp.row( 1 ) ;
    143       v.row( 1 ) = tmp.row( 2 ) || tmp.row( 3 ) ;
    144       v.row( 2 ) = v.row( 1 ) ;
    145     }
    146     return v ;
    147   }
    148  
     409    dataRF.define( v ) ;
     410  }
    149411private:
    150   void accumulateData( uInt &id, Vector<Float> &v )
    151   {
    152     data.insert( pair< uInt,Vector<Float> >( id, v ) ) ;
    153   }
    154     void accumulateFlag( uInt &id, Vector<Bool> &v )
    155   {
    156     flag.insert( pair< uInt,Vector<Bool> >( id, v ) ) ;
    157   }
    158   void accumulateFlagRow( Bool &v )
    159   {
    160     flagrow |= v ;
    161   }
    162   void addPol( uInt id )
    163   {
    164     uInt i = polnos.nelements() ;
    165     polnos.resize( i+1, True ) ;
    166     polnos[i] = id ;
    167   }
    168 
    169   uInt nchan;
    170   const uInt maxnpol;
    171   uInt npol;
    172   Vector<uInt> polnos;
    173 
    174   map< uInt,Vector<Float> > data;
    175   map< uInt,Vector<Bool> > flag;
    176   Bool flagrow;
     412  void attachData()
     413  {
     414    dataRF.attachToRecord( row.record(), "DATA" ) ;
     415  }
     416  RecordFieldPtr< Matrix<Complex> > dataRF;
     417  Bool isFilled[4] ;
    177418};
    178419
     
    418659    row = TableRow( ms ) ;
    419660
    420     holder.reset() ;
    421 
    422     makePolMap() ;
     661    initPolarization() ;
    423662    initFrequencies() ;
    424     initCorrProductTemplate() ;
    425663
    426664    //
     
    505743    Vector<Float> sp = spectraCol( recordNo ) ;
    506744    uInt nchan = sp.nelements() ;
    507     holder.setNchan( nchan ) ;
     745    holder->setNchan( nchan ) ;
    508746
    509747    addSpectralWindow( spwId, freqId ) ;
     
    557795  }
    558796  virtual void leaveTime(const uInt recordNo, Double columnValue) {
    559     if ( holder.nPol() > 0 ) {
    560       Vector<Float> w = holder.getWeight() ;
    561       Cube<Bool> c = holder.getFlagCategory() ;
    562       Bool flr = holder.getFlagRow() ;
    563       Matrix<Bool> fl = holder.getFlag() ;
    564       Vector<uInt> polnos = holder.polNos() ;
    565       Int polId = addPolarization( polnos ) ;
     797    if ( holder->nPol() > 0 ) {
     798      Int polId = addPolarization() ;
    566799      Int ddId = addDataDescription( polId, spwId ) ;
    567800       
    568801      // put field
    569802      *dataDescIdRF = ddId ;
    570       *flagRowRF = flr ;
    571       weightRF.define( w ) ;
    572       sigmaRF.define( w ) ;
    573       flagCategoryRF.define( c ) ;
    574       flagRF.define( fl ) ;
    575       if ( useFloat ) {
    576         Matrix<Float> sp = holder.getData() ;
    577         floatDataRF.define( sp ) ;
    578       }
    579       else {
    580         Matrix<Complex> sp = holder.getComplexData() ;
    581         dataRF.define( sp ) ;
    582       }
     803      holder->post() ;
    583804     
    584805      // commit row
     
    587808
    588809      // reset holder
    589       holder.reset() ;
     810      holder->reset() ;
    590811    }
    591812  }
     
    613834    convertArray( fl, tmp ) ;
    614835    Bool flr = (Bool)flagRowCol.asuInt( recordNo ) ;
    615     holder.accumulate( polNo, sp, fl, flr ) ;
     836    holder->accumulate( polNo, sp, fl, flr ) ;
    616837
    617838    return True ;
     
    637858  void dataColumnName( String name )
    638859  {
    639     TableRecord &r = row.record() ;
    640     if ( name == "DATA" ) {
    641       useFloat = False ;
    642       dataRF.attachToRecord( r, name ) ;
    643     }
    644     else if ( name == "FLOAT_DATA" ) {
    645       useFloat = True ;
    646       floatDataRF.attachToRecord( r, name ) ;
    647     }
     860    if ( name == "DATA" )
     861      holder = new ComplexDataHolder( row, poltype ) ;
     862    else if ( name == "FLOAT_DATA" )
     863      holder = new FloatDataHolder( row, poltype ) ;
    648864  }
    649865  void pointingTableName( String name ) {
     
    743959    porow.put( nrow ) ;
    744960  }
    745   Int addPolarization( Vector<uInt> &nos )
     961  Int addPolarization()
    746962  {
    747963    Int idx = -1 ;
     964    Vector<Int> corrType = holder->corrTypeInt() ;
    748965    uInt nEntry = polEntry.size() ;
    749966    for ( uInt i = 0 ; i < nEntry ; i++ ) {
    750       if ( polEntry[i].conform( nos ) && allEQ( polEntry[i], nos ) ) {
     967      if ( polEntry[i].conform( corrType ) && allEQ( polEntry[i], corrType ) ) {
    751968        idx = i ;
    752969        break ;
     
    754971    }
    755972   
    756     Int numCorr ;
    757     Vector<Int> corrType ;
    758     Matrix<Int> corrProduct ;
    759     polProperty( nos, numCorr, corrType, corrProduct ) ;
     973    Int numCorr = holder->nPol() ;
     974    Matrix<Int> corrProduct = corrProductTemplate[numCorr] ;
    760975
    761976    if ( idx == -1 ) {
     
    771986
    772987      polEntry.resize( nEntry+1 ) ;
    773       polEntry[nEntry] = nos ;
     988      polEntry[nEntry] = corrType ;
    774989    }
    775990
     
    8411056
    8421057    Int mfrInt = (Int)freqframe ;
    843     Int nchan = holder.nChan() ;
     1058    Int nchan = holder->nChan() ;
    8441059    Double bw = nchan * abs( ic ) ;
    8451060    Double reffreq = rv - rp * ic ;
     
    9171132    }
    9181133  }
    919   void makePolMap()
     1134  void initPolarization()
    9201135  {
    9211136    const TableRecord &keys = table.keywordSet() ;
    9221137    poltype = keys.asString( "POLTYPE" ) ;
    9231138
    924     if ( poltype == "stokes" ) {
    925       polmap.resize( 4 ) ;
    926       polmap[0] = Stokes::I ;
    927       polmap[1] = Stokes::Q ;
    928       polmap[2] = Stokes::U ;
    929       polmap[3] = Stokes::V ;
    930     }
    931     else if ( poltype == "linear" ) {
    932       polmap.resize( 4 ) ;
    933       polmap[0] = Stokes::XX ;
    934       polmap[1] = Stokes::YY ;
    935       polmap[2] = Stokes::XY ;
    936       polmap[3] = Stokes::YX ;
    937     }
    938     else if ( poltype == "circular" ) {
    939       polmap.resize( 4 ) ;
    940       polmap[0] = Stokes::RR ;
    941       polmap[1] = Stokes::LL ;
    942       polmap[2] = Stokes::RL ;
    943       polmap[3] = Stokes::LR ;
    944     }
    945     else if ( poltype == "linpol" ) {
    946       polmap.resize( 2 ) ;
    947       polmap[0] = Stokes::Plinear ;
    948       polmap[1] = Stokes::Pangle ;
    949     }
    950     else {
    951       polmap.resize( 0 ) ;
    952     }
     1139    initCorrProductTemplate() ;
    9531140  }
    9541141  void initFrequencies()
     
    10031190    TableRecord &r = row.record() ;
    10041191    dataDescIdRF.attachToRecord( r, "DATA_DESC_ID" ) ;
    1005     flagRowRF.attachToRecord( r, "FLAG_ROW" ) ;
    1006     weightRF.attachToRecord( r, "WEIGHT" ) ;
    1007     sigmaRF.attachToRecord( r, "SIGMA" ) ;
    1008     flagCategoryRF.attachToRecord( r, "FLAG_CATEGORY" ) ;
    1009     flagRF.attachToRecord( r, "FLAG" ) ;
    10101192    timeRF.attachToRecord( r, "TIME" ) ;
    10111193    timeCentroidRF.attachToRecord( r, "TIME_CENTROID" ) ;
     
    11891371    }
    11901372  }
    1191   void polProperty( Vector<uInt> &nos, Int &n, Vector<Int> &c, Matrix<Int> &cp )
    1192   {
    1193     n = nos.nelements() ;
    1194     c.resize( n ) ;
    1195     for ( Int i = 0 ; i < n ; i++ )
    1196       c[i] = (Int)polmap[nos[i]] ;
    1197     if ( n == 4 &&
    1198          ( poltype == "linear" || poltype == "circular" ) ) {
    1199       Int tmp = c[1] ;
    1200       c[1] = c[2] ;
    1201       c[2] = c[3] ;
    1202       c[3] = tmp ;
    1203     }
    1204     cp = corrProductTemplate[n] ;
    1205   }
    12061373  void initCorrProductTemplate()
    12071374  {
     
    12381405  Int feedId;
    12391406  Int subscan;
    1240   PolarizedComponentHolder holder;
     1407  CountedPtr<DataHolder> holder;
    12411408  String ptName;
    12421409  Bool useFloat;
    12431410  String poltype;
    1244   Vector<Stokes::StokesTypes> polmap;
    12451411
    12461412  // MS subtables
     
    12631429  RecordFieldPtr<Int> dataDescIdRF,fieldIdRF,feed1RF,feed2RF,
    12641430    scanNumberRF,stateIdRF;
    1265   RecordFieldPtr<Bool> flagRowRF;
    12661431  RecordFieldPtr<Double> timeRF,timeCentroidRF,intervalRF,exposureRF;
    1267   RecordFieldPtr< Vector<Float> > weightRF,sigmaRF;
    1268   RecordFieldPtr< Cube<Bool> > flagCategoryRF;
    1269   RecordFieldPtr< Matrix<Bool> > flagRF;
    1270   RecordFieldPtr< Matrix<Float> > floatDataRF;
    1271   RecordFieldPtr< Matrix<Complex> > dataRF;
    12721432
    12731433  // MS POINTING columns
     
    12841444  Matrix<Int> ddEntry;
    12851445  Matrix<Int> feedEntry;
    1286   vector< Vector<uInt> > polEntry;
     1446  vector< Vector<Int> > polEntry;
    12871447  map<uInt,Bool> processedFreqId;
    12881448  map<uInt,Double> refpix;
     
    14161576    reset() ;
    14171577  }
     1578  virtual ~BaseTsysHolder() {}
    14181579  virtual Array<Float> getTsys() = 0 ;
    14191580  void setNchan( uInt n ) { nchan = n ; }
     
    14671628    : BaseTsysHolder( tsysCol )
    14681629  {}
     1630  virtual ~TsysHolder() {}
    14691631  virtual Array<Float> getTsys()
    14701632  {
     
    14791641    : BaseTsysHolder( tsysCol )
    14801642  {}
     1643  virtual ~TsysSpectrumHolder() {}
    14811644  virtual Array<Float> getTsys()
    14821645  {
     
    14911654    : col( tcalCol )
    14921655  {}
     1656  virtual ~BaseTcalProcessor() {}
    14931657  void setTcalId( Vector<uInt> &tcalId ) { id.assign( tcalId ) ; }
    14941658  virtual Array<Float> getTcal() = 0 ;
     
    15041668    : BaseTcalProcessor( tcalCol )
    15051669  {}
     1670  virtual ~TcalProcessor() {}
    15061671  virtual Array<Float> getTcal()
    15071672  {
     
    15211686    : BaseTcalProcessor( tcalCol )
    15221687  {}
     1688  virtual ~TcalSpectrumProcessor() {}
    15231689  virtual Array<Float> getTcal()
    15241690  {
  • branches/casa-prerelease/pre-asap/src/SConscript

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.