Changeset 2532 for branches


Ignore:
Timestamp:
05/16/12 14:20:11 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

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...

More speedup of STMath::almacal.
Reduced a number of call of ScalarColumn<T>::getColumn().


Location:
branches/hpc33/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/hpc33/src/STMath.cpp

    r2524 r2532  
    45104510}
    45114511
    4512 vector<float> STMath::getSpectrumFromTime( double reftime,
     4512vector<float> STMath::getSpectrumFromTime( double reftime,
     4513                                           Vector<Double> &timeVec,
    45134514                                           CountedPtr<Scantable>& s,
    45144515                                           string mode )
     
    45264527  }
    45274528  else {
    4528     ROScalarColumn<Double> timeCol( s->table(), "TIME" ) ;
    4529     Vector<Double> timeVec = timeCol.getColumn() ;
     4529    //ROScalarColumn<Double> timeCol( s->table(), "TIME" ) ;
     4530    //Vector<Double> timeVec = timeCol.getColumn() ;
    45304531    vector<int> idx = getRowIdFromTime( reftime, timeVec ) ;
    45314532    if ( mode == "before" ) {
     
    50665067{
    50675068//   string reftime = on->getTime( index ) ;
    5068   ROTableColumn timeCol( on->table(), "TIME" ) ;
     5069  ROScalarColumn<Double> timeCol( off->table(), "TIME" ) ;
     5070  Vector<Double> timeVec = timeCol.getColumn() ;
     5071  //ROTableColumn timeCol( on->table(), "TIME" ) ;
     5072  timeCol.attach( on->table(), "TIME" ) ;
    50695073  double reftime = timeCol.asdouble(index) ;
    50705074  vector<int> ii( 1, on->getIF( index ) ) ;
     
    50765080  sel.setPolarizations( ip ) ;
    50775081  off->setSelection( sel ) ;
    5078   vector<float> spoff = getSpectrumFromTime( reftime, off, "linear" ) ;
     5082  vector<float> spoff = getSpectrumFromTime( reftime, timeVec, off, "linear" ) ;
    50795083  vector<float> spec = on->getSpectrum( index ) ;
    50805084  //vector<float> tcal = getTcalFromTime( reftime, sky, "linear" ) ;
     
    51095113{
    51105114  //   string reftime = on->getTime( index ) ;
    5111   ROTableColumn timeCol( on->table(), "TIME" ) ;
     5115  ROScalarColumn<Double> timeCol( off->table(), "TIME" ) ;
     5116  Vector<Double> timeVec = timeCol.getColumn() ;
     5117  //ROTableColumn timeCol( on->table(), "TIME" ) ;
     5118  timeCol.attach( on->table(), "TIME" ) ;
    51125119  ArrayColumn<Float> tsysCol( on->table(), "TSYS" ) ;
    51135120  vector<float> sp( on->nchan( on->getIF(0) ) ) ;
     
    51155122  for ( int index = 0 ; index < on->nrow() ; index++ ) {
    51165123    double reftime = timeCol.asdouble(index) ;
    5117     vector<float> spoff = getSpectrumFromTime( reftime, off, "linear" ) ;
     5124    vector<float> spoff = getSpectrumFromTime( reftime, timeVec, off, "linear" ) ;
    51185125    vector<float> spec = on->getSpectrum( index ) ;
    51195126    Vector<Float> tsys = tsysCol( index ) ;
     
    51425149{
    51435150//   string reftime = on->getTime( index ) ;
    5144   ROTableColumn timeCol( on->table(), "TIME" ) ;
     5151  ROScalarColumn<Double> timeCol( off->table(), "TIME" ) ;
     5152  Vector<Double> timeVec = timeCol.getColumn() ;
     5153  //ROTableColumn timeCol( on->table(), "TIME" ) ;
     5154  timeCol.attach( on->table(), "TIME" ) ;
    51455155  ArrayColumn<Float> tsysCol( on->table(), "TSYS" ) ;
    51465156  vector<float> sp( on->nchan( on->getIF(rows[0]) ) ) ;
     
    51525162    //double reftime = timeCol.asdouble(index) ;
    51535163    double reftime = timeCol.asdouble(*p) ;
    5154     vector<float> spoff = getSpectrumFromTime( reftime, off, "linear" ) ;
     5164    vector<float> spoff = getSpectrumFromTime( reftime, timeVec, off, "linear" ) ;
    51555165    //vector<float> spec = on->getSpectrum( index ) ;
    51565166    //Vector<Float> tsys = tsysCol( index ) ;
  • branches/hpc33/src/STMath.h

    r2519 r2532  
    403403
    404404  vector<float> getSpectrumFromTime( string reftime, casa::CountedPtr<Scantable>& s, string mode = "before" ) ;
    405   vector<float> getSpectrumFromTime( double reftime, casa::CountedPtr<Scantable>& s, string mode = "before" ) ;
     405  vector<float> getSpectrumFromTime( double reftime, casa::Vector<casa::Double> &v, casa::CountedPtr<Scantable>& s, string mode = "before" ) ;
    406406  vector<float> getTcalFromTime( string reftime, casa::CountedPtr<Scantable>& s, string mode="before" ) ;
    407407  vector<float> getTsysFromTime( string reftime, casa::CountedPtr<Scantable>& s, string mode="before" ) ;
Note: See TracChangeset for help on using the changeset viewer.