Changeset 3106 for trunk/src/STMath.h


Ignore:
Timestamp:
10/04/16 18:20:50 (8 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes/No?

Interface Changes: Yes/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...


Check-in asap modifications from Jim regarding casacore namespace conversion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STMath.h

    r2952 r3106  
    3737public:
    3838        // typedef for long method name
    39   typedef casa::InterpolateArray1D<casa::Double,
    40                                    casa::Float>::InterpolationMethod imethod;
     39  typedef casacore::InterpolateArray1D<casacore::Double,
     40                                   casacore::Float>::InterpolationMethod imethod;
    4141
    4242  // typedef for std::map
     
    6969    * @param weight weighting scheme
    7070    * @param avmode the mode ov averaging. Per "SCAN" or "ALL".
    71     * @return a casa::CountedPtr<Scantable> which either holds a new Scantable
     71    * @return a casacore::CountedPtr<Scantable> which either holds a new Scantable
    7272    * or returns the imput pointer.
    7373    */
    74   casa::CountedPtr<Scantable>
    75     average( const std::vector<casa::CountedPtr<Scantable> >& in,
     74  casacore::CountedPtr<Scantable>
     75    average( const std::vector<casacore::CountedPtr<Scantable> >& in,
    7676             const std::vector<bool>& mask = std::vector<bool>(),
    7777             const std::string& weight = "NONE",
     
    8383    * @param mode the averaging mode. Currently only "MEDIAN"
    8484    * @param avmode the mode ov averaging. Per "SCAN" or "ALL".
    85     * @return a casa::CountedPtr<Scantable> which either holds a new Scantable
     85    * @return a casacore::CountedPtr<Scantable> which either holds a new Scantable
    8686    * or returns the imput pointer.
    8787    */
    88   casa::CountedPtr<Scantable>
    89     averageChannel( const casa::CountedPtr<Scantable> & in,
     88  casacore::CountedPtr<Scantable>
     89    averageChannel( const casacore::CountedPtr<Scantable> & in,
    9090                    const std::string& mode = "MEDIAN",
    9191                    const std::string& avmode = "SCAN");
     
    9999    * @return
    100100    */
    101   casa::CountedPtr< Scantable >
    102     averagePolarisations( const casa::CountedPtr< Scantable > & in,
     101  casacore::CountedPtr< Scantable >
     102    averagePolarisations( const casacore::CountedPtr< Scantable > & in,
    103103                          const std::vector<bool>& mask,
    104104                          const std::string& weight );
     
    111111    * @return
    112112    */
    113   casa::CountedPtr< Scantable >
    114     averageBeams( const casa::CountedPtr< Scantable > & in,
     113  casacore::CountedPtr< Scantable >
     114    averageBeams( const casacore::CountedPtr< Scantable > & in,
    115115                   const std::vector<bool>& mask,
    116116                   const std::string& weight );
    117117
    118   casa::CountedPtr<Scantable>
    119     unaryOperate( const casa::CountedPtr<Scantable>& in, float val,
     118  casacore::CountedPtr<Scantable>
     119    unaryOperate( const casacore::CountedPtr<Scantable>& in, float val,
    120120                  const std::string& mode, bool tsys=false,
    121121                  bool skip_flaggedrow=false );
    122122
    123123  // array operation
    124   casa::CountedPtr<Scantable>
    125     arrayOperate( const casa::CountedPtr<Scantable>& in,
     124  casacore::CountedPtr<Scantable>
     125    arrayOperate( const casacore::CountedPtr<Scantable>& in,
    126126                  const std::vector<float> val,
    127127                  const std::string& mode,
     
    131131
    132132  // channel operation
    133   casa::CountedPtr<Scantable>
    134     arrayOperateChannel( const casa::CountedPtr<Scantable>& in,
     133  casacore::CountedPtr<Scantable>
     134    arrayOperateChannel( const casacore::CountedPtr<Scantable>& in,
    135135                         const std::vector<float> val,
    136136                         const std::string& mode, bool tsys=false,
     
    138138
    139139  // row operation
    140   casa::CountedPtr<Scantable>
    141     arrayOperateRow( const casa::CountedPtr<Scantable>& in,
     140  casacore::CountedPtr<Scantable>
     141    arrayOperateRow( const casacore::CountedPtr<Scantable>& in,
    142142                     const std::vector<float> val,
    143143                     const std::string& mode, bool tsys=false,
     
    145145
    146146  // 2d array operation
    147   casa::CountedPtr<Scantable>
    148     array2dOperate( const casa::CountedPtr<Scantable>& in,
     147  casacore::CountedPtr<Scantable>
     148    array2dOperate( const casacore::CountedPtr<Scantable>& in,
    149149                  const std::vector< std::vector<float> > val,
    150150                  const std::string& mode, bool tsys=false );
    151151
    152   casa::CountedPtr<Scantable>
    153     binaryOperate( const casa::CountedPtr<Scantable>& left,
    154                    const casa::CountedPtr<Scantable>& right,
     152  casacore::CountedPtr<Scantable>
     153    binaryOperate( const casacore::CountedPtr<Scantable>& left,
     154                   const casacore::CountedPtr<Scantable>& right,
    155155                   const std::string& mode);
    156156
    157   casa::CountedPtr<Scantable> autoQuotient(const casa::CountedPtr<Scantable>& in,
     157  casacore::CountedPtr<Scantable> autoQuotient(const casacore::CountedPtr<Scantable>& in,
    158158                                           const std::string& mode = "NEAREST",
    159159                                           bool preserve = true);
    160160
    161   casa::CountedPtr<Scantable> quotient( const casa::CountedPtr<Scantable>& on,
    162                                         const casa::CountedPtr<Scantable>& off,
     161  casacore::CountedPtr<Scantable> quotient( const casacore::CountedPtr<Scantable>& on,
     162                                        const casacore::CountedPtr<Scantable>& off,
    163163                                        bool preserve = true );
    164164
     
    168168    * @param caloff uncalibrated Scantable with no CAL signal
    169169    * @param tcal optional scalar Tcal, CAL temperature (K)
    170     * @return casa::CountedPtr<Scantable> which holds a calibrated Scantable
     170    * @return casacore::CountedPtr<Scantable> which holds a calibrated Scantable
    171171    * (spectrum - average of the two CAL on and off spectra;
    172172    * tsys - mean Tsys = <caloff>*Tcal/<calon-caloff> + Tcal/2)
    173173    */             
    174   casa::CountedPtr<Scantable> dototalpower( const casa::CountedPtr<Scantable>& calon,
    175                                             const casa::CountedPtr<Scantable>& caloff,
    176                                             casa::Float tcal=1.0 );
     174  casacore::CountedPtr<Scantable> dototalpower( const casacore::CountedPtr<Scantable>& calon,
     175                                            const casacore::CountedPtr<Scantable>& caloff,
     176                                            casacore::Float tcal=1.0 );
    177177
    178178  /**
     
    185185    * set tau, as well
    186186    * @param tau optional scalar Tau value
    187     * @return casa::CountedPtr<Scantable> which holds combined scans
     187    * @return casacore::CountedPtr<Scantable> which holds combined scans
    188188    * (spectrum = (sig-ref)/ref * Tsys )
    189189    */
    190   casa::CountedPtr<Scantable> dosigref( const casa::CountedPtr<Scantable>& sig,
    191                                         const casa::CountedPtr<Scantable>& ref,
     190  casacore::CountedPtr<Scantable> dosigref( const casacore::CountedPtr<Scantable>& sig,
     191                                        const casacore::CountedPtr<Scantable>& ref,
    192192                                        int smoothref=1,
    193                                         casa::Float tsysv=0.0,
    194                                         casa::Float tau=0.0 );
     193                                        casacore::Float tsysv=0.0,
     194                                        casacore::Float tau=0.0 );
    195195
    196196  /**
     
    203203    * @param tau optional scalar Tau value
    204204    * @param tcal optional scalar Tcal, CAL temperature (K)
    205     * @return casa::CountedPtr<Scantable> which holds calibrated scans
    206     */
    207   casa::CountedPtr<Scantable> donod( const casa::CountedPtr<Scantable>& s,
     205    * @return casacore::CountedPtr<Scantable> which holds calibrated scans
     206    */
     207  casacore::CountedPtr<Scantable> donod( const casacore::CountedPtr<Scantable>& s,
    208208                                     const std::vector<int>& scans,
    209209                                     int smoothref=1,
    210                                      casa::Float tsysv=0.0,
    211                                      casa::Float tau=0.0,
    212                                      casa::Float tcal=0.0 );
     210                                     casacore::Float tsysv=0.0,
     211                                     casacore::Float tau=0.0,
     212                                     casacore::Float tcal=0.0 );
    213213
    214214  /**
     
    221221    * @param tau optional scalar Tau value
    222222    * @param tcal optional scalar Tcal, CAL temperature (K)
    223     * @return casa::CountedPtr<Scantable> which holds calibrated scans
    224     */
    225   casa::CountedPtr<Scantable> dofs( const casa::CountedPtr<Scantable>& s,
     223    * @return casacore::CountedPtr<Scantable> which holds calibrated scans
     224    */
     225  casacore::CountedPtr<Scantable> dofs( const casacore::CountedPtr<Scantable>& s,
    226226                                    const std::vector<int>& scans,
    227227                                    int smoothref=1,
    228                                     casa::Float tsysv=0.0,
    229                                     casa::Float tau=0.0,
    230                                     casa::Float tcal=0.0 );
     228                                    casacore::Float tsysv=0.0,
     229                                    casacore::Float tau=0.0,
     230                                    casacore::Float tcal=0.0 );
    231231
    232232  /**
     
    241241   * @param a string that indicates antenna name
    242242   **/
    243   casa::CountedPtr<Scantable> cwcal( const casa::CountedPtr<Scantable>& s,
    244                                        const casa::String calmode,
    245                                        const casa::String antname );
     243  casacore::CountedPtr<Scantable> cwcal( const casacore::CountedPtr<Scantable>& s,
     244                                       const casacore::String calmode,
     245                                       const casacore::String antname );
    246246
    247247  /**
     
    254254   * @param a string that indicates antenna name
    255255   **/
    256   casa::CountedPtr<Scantable> cwcalfs( const casa::CountedPtr<Scantable>& s,
    257                                        const casa::String antname );
     256  casacore::CountedPtr<Scantable> cwcalfs( const casacore::CountedPtr<Scantable>& s,
     257                                       const casacore::String antname );
    258258
    259259
     
    264264   * @param choffset
    265265   **/
    266   casa::CountedPtr<Scantable> dofold( const casa::CountedPtr<Scantable> &sig,
    267                                       const casa::CountedPtr<Scantable> &ref,
    268                                       casa::Double choffset,
    269                                       casa::Double choffset2 = 0.0 );
     266  casacore::CountedPtr<Scantable> dofold( const casacore::CountedPtr<Scantable> &sig,
     267                                      const casacore::CountedPtr<Scantable> &ref,
     268                                      casacore::Double choffset,
     269                                      casacore::Double choffset2 = 0.0 );
    270270
    271271  /**
    272272   * ALMA calibration
    273273   **/
    274   casa::CountedPtr<Scantable> almacal( const casa::CountedPtr<Scantable>& s,
    275                                        const casa::String calmode ) ;
    276   casa::CountedPtr<Scantable> almacalfs( const casa::CountedPtr<Scantable>& s ) ;
    277 
    278   casa::CountedPtr<Scantable>
    279     freqSwitch( const casa::CountedPtr<Scantable>& in );
    280 
    281   std::vector<float> statistic(const casa::CountedPtr<Scantable>& in,
     274  casacore::CountedPtr<Scantable> almacal( const casacore::CountedPtr<Scantable>& s,
     275                                       const casacore::String calmode ) ;
     276  casacore::CountedPtr<Scantable> almacalfs( const casacore::CountedPtr<Scantable>& s ) ;
     277
     278  casacore::CountedPtr<Scantable>
     279    freqSwitch( const casacore::CountedPtr<Scantable>& in );
     280
     281  std::vector<float> statistic(const casacore::CountedPtr<Scantable>& in,
    282282                               const std::vector<bool>& mask,
    283283                               const std::string& which);
    284284
    285   std::vector<float> statisticRow(const casa::CountedPtr<Scantable>& in,
     285  std::vector<float> statisticRow(const casacore::CountedPtr<Scantable>& in,
    286286                               const std::vector<bool>& mask,
    287287                               const std::string& which,
    288288                               int row);
    289289
    290   std::vector< int > minMaxChan(const casa::CountedPtr<Scantable>& in,
     290  std::vector< int > minMaxChan(const casacore::CountedPtr<Scantable>& in,
    291291                                const std::vector<bool>& mask,
    292292                                const std::string& which);
    293293
    294   casa::CountedPtr<Scantable> bin( const casa::CountedPtr<Scantable>& in,
     294  casacore::CountedPtr<Scantable> bin( const casacore::CountedPtr<Scantable>& in,
    295295                                   int width=5);
    296   casa::CountedPtr<Scantable>
    297     resample(const casa::CountedPtr<Scantable>& in,
     296  casacore::CountedPtr<Scantable>
     297    resample(const casacore::CountedPtr<Scantable>& in,
    298298             const std::string& method, float width);
    299299
    300   casa::CountedPtr<Scantable>
    301     smooth(const casa::CountedPtr<Scantable>& in, const std::string& kernel,
     300  casacore::CountedPtr<Scantable>
     301    smooth(const casacore::CountedPtr<Scantable>& in, const std::string& kernel,
    302302                      float width, int order=2);
    303303
    304   casa::CountedPtr<Scantable>
    305     gainElevation(const casa::CountedPtr<Scantable>& in,
     304  casacore::CountedPtr<Scantable>
     305    gainElevation(const casacore::CountedPtr<Scantable>& in,
    306306                  const std::vector<float>& coeff,
    307307                  const std::string& fileName,
    308308                  const std::string& method);
    309   casa::CountedPtr<Scantable>
    310     convertFlux(const casa::CountedPtr<Scantable>& in, float d,
     309  casacore::CountedPtr<Scantable>
     310    convertFlux(const casacore::CountedPtr<Scantable>& in, float d,
    311311                float etaap, float jyperk);
    312312
    313   casa::CountedPtr<Scantable> opacity(const casa::CountedPtr<Scantable>& in,
     313  casacore::CountedPtr<Scantable> opacity(const casacore::CountedPtr<Scantable>& in,
    314314                                      const std::vector<float>& tau);
    315315
    316   casa::CountedPtr<Scantable>
    317     merge(const std::vector<casa::CountedPtr<Scantable> >& in,
     316  casacore::CountedPtr<Scantable>
     317    merge(const std::vector<casacore::CountedPtr<Scantable> >& in,
    318318          const std::string &freqTol = "");
    319319
    320   casa::CountedPtr<Scantable>
    321     invertPhase( const casa::CountedPtr<Scantable>& in);
    322 
    323   casa::CountedPtr<Scantable>
    324     rotateXYPhase( const casa::CountedPtr<Scantable>& in, float phase);
    325 
    326   casa::CountedPtr<Scantable>
    327     rotateLinPolPhase( const casa::CountedPtr<Scantable>& in, float phase);
    328 
    329   casa::CountedPtr<Scantable>
    330     swapPolarisations(const casa::CountedPtr<Scantable>& in);
    331 
    332   casa::CountedPtr<Scantable>
    333     frequencyAlign( const casa::CountedPtr<Scantable>& in,
     320  casacore::CountedPtr<Scantable>
     321    invertPhase( const casacore::CountedPtr<Scantable>& in);
     322
     323  casacore::CountedPtr<Scantable>
     324    rotateXYPhase( const casacore::CountedPtr<Scantable>& in, float phase);
     325
     326  casacore::CountedPtr<Scantable>
     327    rotateLinPolPhase( const casacore::CountedPtr<Scantable>& in, float phase);
     328
     329  casacore::CountedPtr<Scantable>
     330    swapPolarisations(const casacore::CountedPtr<Scantable>& in);
     331
     332  casacore::CountedPtr<Scantable>
     333    frequencyAlign( const casacore::CountedPtr<Scantable>& in,
    334334                    const std::string& refTime = "",
    335335                    const std::string& method = "cubic" );
    336336
    337   casa::CountedPtr<Scantable>
    338     convertPolarisation( const casa::CountedPtr<Scantable>& in,
     337  casacore::CountedPtr<Scantable>
     338    convertPolarisation( const casacore::CountedPtr<Scantable>& in,
    339339                         const std::string& newtype);
    340340
    341   casa::CountedPtr<Scantable>
    342     mxExtract( const casa::CountedPtr<Scantable>& in,
     341  casacore::CountedPtr<Scantable>
     342    mxExtract( const casacore::CountedPtr<Scantable>& in,
    343343               const std::string& srctype = "on");
    344344
     
    348348   * @param width the number of lags to flag left to the side of the frequency
    349349   */
    350   casa::CountedPtr<Scantable>
    351     lagFlag( const casa::CountedPtr<Scantable>& in, double start,
     350  casacore::CountedPtr<Scantable>
     351    lagFlag( const casacore::CountedPtr<Scantable>& in, double start,
    352352             double end, const std::string& mode="frequency");
    353353
    354354  std::vector<float>
    355     fft( const casa::CountedPtr<Scantable>& in,
     355    fft( const casacore::CountedPtr<Scantable>& in,
    356356         const std::vector<int>& whichrow,
    357357         bool getRealImag=false );
    358358
    359359  // test for average spectra with different channel/resolution
    360   casa::CountedPtr<Scantable>
    361     new_average( const std::vector<casa::CountedPtr<Scantable> >& in,
     360  casacore::CountedPtr<Scantable>
     361    new_average( const std::vector<casacore::CountedPtr<Scantable> >& in,
    362362                 const bool& compel,
    363363                 const std::vector<bool>& mask = std::vector<bool>(),
    364364                 const std::string& weight = "NONE",
    365365                 const std::string& avmode = "SCAN" )
    366     throw (casa::AipsError) ;
     366    throw (casacore::AipsError) ;
    367367
    368368private:
    369   casa::CountedPtr<Scantable>  applyToPol( const casa::CountedPtr<Scantable>& in,
     369  casacore::CountedPtr<Scantable>  applyToPol( const casacore::CountedPtr<Scantable>& in,
    370370                                           STPol::polOperation fptr,
    371                                            casa::Float phase);
     371                                           casacore::Float phase);
    372372
    373373  static imethod stringToIMethod(const std::string& in);
    374374  static WeightType stringToWeight(const std::string& in);
    375375
    376   void scaleByVector(casa::Table& in,
    377                      const casa::Vector<casa::Float>& factor,
     376  void scaleByVector(casacore::Table& in,
     377                     const casacore::Vector<casacore::Float>& factor,
    378378                     bool dotsys);
    379379
    380   void scaleFromAsciiTable(casa::Table& in, const std::string& filename,
     380  void scaleFromAsciiTable(casacore::Table& in, const std::string& filename,
    381381                           const std::string& method,
    382                            const casa::Vector<casa::Float>& xout,
     382                           const casacore::Vector<casacore::Float>& xout,
    383383                           bool dotsys);
    384384
    385   void scaleFromTable(casa::Table& in, const casa::Table& table,
     385  void scaleFromTable(casacore::Table& in, const casacore::Table& table,
    386386                      const std::string& method,
    387                       const casa::Vector<casa::Float>& xout, bool dotsys);
    388 
    389   void convertBrightnessUnits(casa::CountedPtr<Scantable>& in,
     387                      const casacore::Vector<casacore::Float>& xout, bool dotsys);
     388
     389  void convertBrightnessUnits(casacore::CountedPtr<Scantable>& in,
    390390                              bool tokelvin, float cfac);
    391391
    392   casa::CountedPtr< Scantable >
    393     smoothOther( const casa::CountedPtr< Scantable >& in,
     392  casacore::CountedPtr< Scantable >
     393    smoothOther( const casacore::CountedPtr< Scantable >& in,
    394394                 const std::string& kernel,
    395395                 float width, int order=2 );
    396396
    397   casa::CountedPtr< Scantable >
    398     getScantable(const casa::CountedPtr< Scantable >& in, bool droprows);
    399 
    400   casa::MaskedArray<casa::Float>
    401     maskedArray( const casa::Vector<casa::Float>& s,
    402                  const casa::Vector<casa::uChar>& f );
    403   casa::MaskedArray<casa::Double>
    404     maskedArray( const casa::Vector<casa::Double>& s,
    405                  const casa::Vector<casa::uChar>& f );
    406   casa::Vector<casa::uChar>
    407     flagsFromMA(const casa::MaskedArray<casa::Float>& ma);
     397  casacore::CountedPtr< Scantable >
     398    getScantable(const casacore::CountedPtr< Scantable >& in, bool droprows);
     399
     400  casacore::MaskedArray<casacore::Float>
     401    maskedArray( const casacore::Vector<casacore::Float>& s,
     402                 const casacore::Vector<casacore::uChar>& f );
     403  casacore::MaskedArray<casacore::Double>
     404    maskedArray( const casacore::Vector<casacore::Double>& s,
     405                 const casacore::Vector<casacore::uChar>& f );
     406  casacore::Vector<casacore::uChar>
     407    flagsFromMA(const casacore::MaskedArray<casacore::Float>& ma);
    408408
    409409  // Frequency switching
    410   void calibrateFS( casa::CountedPtr<Scantable> &sig,
    411                     casa::CountedPtr<Scantable> &ref,
    412                     const casa::CountedPtr<Scantable> &rsig,
    413                     const casa::CountedPtr<Scantable> &rref,
    414                     const casa::CountedPtr<Scantable> &sky,
    415                     const casa::CountedPtr<Scantable> &hot,
    416                     const casa::CountedPtr<Scantable> &cold,
    417                     const casa::Vector<casa::uInt> &rows ) ;
    418   void calibrateAPEXFS( casa::CountedPtr<Scantable> &sig,
    419                         casa::CountedPtr<Scantable> &ref,
    420                         const vector< casa::CountedPtr<Scantable> > &on,
    421                         const vector< casa::CountedPtr<Scantable> > &sky,
    422                         const vector< casa::CountedPtr<Scantable> > &hot,
    423                         const vector< casa::CountedPtr<Scantable> > &cold,
    424                         const casa::Vector<casa::uInt> &rows ) ;
    425   void copyRows( casa::Table &out,
    426                  const casa::Table &in,
    427                  casa::uInt startout,
    428                  casa::uInt startin,
    429                  casa::uInt nrow,
    430                  casa::Bool copySpectra=true,
    431                  casa::Bool copyFlagtra=true,
    432                  casa::Bool copyTsys=true ) ;
    433   casa::CountedPtr<Scantable> averageWithinSession( casa::CountedPtr<Scantable> &s,
     410  void calibrateFS( casacore::CountedPtr<Scantable> &sig,
     411                    casacore::CountedPtr<Scantable> &ref,
     412                    const casacore::CountedPtr<Scantable> &rsig,
     413                    const casacore::CountedPtr<Scantable> &rref,
     414                    const casacore::CountedPtr<Scantable> &sky,
     415                    const casacore::CountedPtr<Scantable> &hot,
     416                    const casacore::CountedPtr<Scantable> &cold,
     417                    const casacore::Vector<casacore::uInt> &rows ) ;
     418  void calibrateAPEXFS( casacore::CountedPtr<Scantable> &sig,
     419                        casacore::CountedPtr<Scantable> &ref,
     420                        const vector< casacore::CountedPtr<Scantable> > &on,
     421                        const vector< casacore::CountedPtr<Scantable> > &sky,
     422                        const vector< casacore::CountedPtr<Scantable> > &hot,
     423                        const vector< casacore::CountedPtr<Scantable> > &cold,
     424                        const casacore::Vector<casacore::uInt> &rows ) ;
     425  void copyRows( casacore::Table &out,
     426                 const casacore::Table &in,
     427                 casacore::uInt startout,
     428                 casacore::uInt startin,
     429                 casacore::uInt nrow,
     430                 casacore::Bool copySpectra=true,
     431                 casacore::Bool copyFlagtra=true,
     432                 casacore::Bool copyTsys=true ) ;
     433  casacore::CountedPtr<Scantable> averageWithinSession( casacore::CountedPtr<Scantable> &s,
    434434                                                    vector<bool> &mask,
    435435                                                    string weight ) ;
Note: See TracChangeset for help on using the changeset viewer.